[asterisk-users] Play audio file for both Caller and Callee in a call

ISABEL ORDAS ARNAL ioa at tid.es
Mon Dec 19 03:23:58 CST 2011


Hi all,

I made it easier, AMI was not required, it can be solved directly in the dialplan:

same => n,Dial(SIP/${TRUNK}/${ARG2}${NUM},60,M(inject^${CALLERNUMBER}))

[macro-inject]
same => s,1,Originate(Local/trunk at injectWarning,app,Playback,Message-Callee)
same => n,Originate(Local/${ARG1}@injectWarning,app,Playback,Message-Caller)


[injectWarning]
exten => _+34[69]XXXXXXXX,1,Answer()
same => n, ChanSpy(SIP/${EXTEN},qw)
same => n, Hangup()

exten =>trunk,1,Answer()
same => n, ChanSpy(SIP/${TRUNK},qw)
same => n, Hangup()


Thank you all!
====================================================================
Date: Thu, 15 Dec 2011 23:56:15 -0800
From: Jim Dickenson <dickenson at cfmc.com>
Subject: Re: [asterisk-users] Play audio file for both Caller and
        Callee in       a call
To: Asterisk Users Mailing List - Non-Commercial Discussion
        <asterisk-users at lists.digium.com>
Message-ID: <92E76A79-3929-4978-82F2-EE8C1DB50949 at cfmc.com>
Content-Type: text/plain; charset="windows-1252"

Use an AMI packet like this:

Action: Originate
Channel: Local/do_playback at 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:dickenson at cfmc.com

CfMC
http://www.cfmc.com/




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


More information about the asterisk-users mailing list