Use an AMI packet like this:

Action: Originate
Channel: Local/do_playback@cfmc_cdi_private
Exten: do_chanspy
Context: cfmc_cdi_private
Priority: 1
Variable: CfMC_ActionID=PlayBack
Variable: CfMC_WhatToPlay=lyrics-louie-louie
Variable: CfMC_WhoHear=SIP/GXP280
ActionID: PlayBack
Async: true


With dialplan like this:

exten => do_playback,1,Answer()
exten => do_playback,n,UserEvent(BeforePlayBack,ActionID:${CfMC_ActionID} & 
${UNIQUEID} & ${CHANNEL} & ${CfMC_WhatToPlay} & ${CfMC_WhoHear})
exten => do_playback,n,Wait(0.3)
exten => do_playback,n,Playback(${CfMC_WhatToPlay})
; PLAYBACKSTATUS - SUCCESS FAILED
exten => do_playback,n,UserEvent(AfterPlayBack,ActionID:${CfMC_ActionID} & 
${UNIQUEID} & ${CHANNEL} & ${CfMC_WhatToPlay} & ${CfMC_WhoHear} & 
${PLAYBACKSTATUS})
exten => do_playback,n,Hangup()

exten => do_chanspy,1,Answer()
exten => do_chanspy,n,UserEvent(BeforeChanSpy,ActionID:${CfMC_ActionID} & 
${UNIQUEID} & ${CHANNEL} & ${CfMC_WhatToPlay} & ${CfMC_WhoHear})
exten => do_chanspy,n,ChanSpy(${CfMC_WhoHear},qW)
exten => do_chanspy,n,UserEvent(AfterChanSpy,ActionID:${CfMC_ActionID} & 
${UNIQUEID} & ${CHANNEL} & ${CfMC_WhatToPlay} & ${CfMC_WhoHear})
exten => do_chanspy,n,Hangup()


You need to issue an AMI packet for each leg of the call. Each leg will hear 
the same audio feed offset by however long it takes the packets to be 
processed. In general this is a few milliseconds and should not be a big deal.
-- 
Jim Dickenson
mailto:dicken...@cfmc.com

CfMC
http://www.cfmc.com/



On Dec 15, 2011, at 10:27 PM, virendra bhati wrote:

> Hi,
> 
> Plese give a little example of script so that it will be clear.
> 
> On Thu, Dec 15, 2011 at 11:09 PM, Jim Dickenson <dicken...@cfmc.com> wrote:
> You also use AMI to inject audio into the conversation using the ChanSpy 
> application.
> -- 
> Jim Dickenson
> mailto:dicken...@cfmc.com
> 
> CfMC
> http://www.cfmc.com/
> 
> 
> 
> On Dec 15, 2011, at 9:23 AM, Danny Nicholas wrote:
> 
>> You can’t per se, but you can call an AGI using stream?
>>  
>> From: asterisk-users-boun...@lists.digium.com 
>> [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of 
>> c.savinov...@itntelecom.com
>> Sent: Thursday, December 15, 2011 11:22 AM
>> To: Asterisk Users Mailing List - Non-Commercial Discussion
>> Subject: Re: [asterisk-users] Play audio file for both Caller and Callee in 
>> a call
>>  
>> Dear Danny:
>>  
>>     How can you use Playback in the middle of 2 channels engaged in a 
>> conversation?
>>  
>> Thanks
>> C. Savinovich
>>  
>> -------- Original Message --------
>> Subject: Re: [asterisk-users] Play audio file for both Caller and
>> Callee in a call
>> From: "Danny Nicholas" <da...@debsinc.com>
>> Date: Thu, December 15, 2011 9:31 am
>> To: "'Asterisk Users Mailing List - Non-Commercial Discussion'"
>> <asterisk-users@lists.digium.com>
>> 
>> Playback?  What flavor of Asterisk are you using?
>>  
>> From: asterisk-users-boun...@lists.digium.com 
>> [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of ISABEL ORDAS 
>> ARNAL
>> Sent: Thursday, December 15, 2011 10:29 AM
>> To: asterisk-users@lists.digium.com
>> Subject: [asterisk-users] Play audio file for both Caller and Callee in a 
>> call
>>  
>> Dear all,
>> Anyone of you knows how to play an audio file at the beginning of a call for 
>> both Caller and Callee?
>> A(x) of Dial application only plays audio for callee. I don’t want to use 
>> MeetMe because I want to use Monitor and MixMonitor.
>>  
>> Thank you!
>>  
>> Este mensaje se dirige exclusivamente a su destinatario. Puede consultar 
>> nuestra política de envío y recepción de correo electrónico en el enlace 
>> situado más abajo.
>> This message is intended exclusively for its addressee. We only send and 
>> receive email on the basis of the terms set out at.
>> http://www.tid.es/ES/PAGINAS/disclaimer.aspx
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>> http://www.asterisk.org/hello
>> 
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>> http://lists.digium.com/mailman/listinfo/asterisk-users
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>               http://www.asterisk.org/hello
>> 
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-users
> 
> 
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
> 
> 
> 
> -- 
> 
> Thanks and regards
> 
>  Virendra Bhati
> +91-8885268942
> Software Engineer
> 
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to