[asterisk-users] Playback to channel using AMI

Jon Morgan jmorgan at c-a-solutions.co.uk
Wed May 13 09:57:59 CDT 2009


That's superb, thanks very much Jim.

J.

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jim Dickenson
Sent: 13 May 2009 15:54
To: Asterisk User MailList
Subject: Re: [asterisk-users] Playback to channel using AMI

Here is the AMI packet I use to do this:

Action: Originate
Channel: Local/do_playback at cfmc_cdi_private
Exten: do_chanspy
Context: cfmc_cdi_private
Priority: 1
Variable: CfMC_ActionID=callE1330
Variable: CfMC_WhatToPlay=cfmc/song
Variable: CfMC_WhoHear=SIP/GXP280-16-0844e290
ActionID: callE1330
Async: true


And here are the extensions from extensions.conf: (Watch email line wraps)

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()



What this does is "dial" an extension to play what I want to play and then
bridge in a ChanSpy with whisper so the extension I want to hear the sound
can "listen" in.

This seems to do the trick for me.

-- 
Jim Dickenson
mailto:dickenson at cfmc.com

CfMC
http://www.cfmc.com/



> From: Jon Morgan <jmorgan at c-a-solutions.co.uk>
> Organization: Complete Automotive Solutions
> Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion
> <asterisk-users at lists.digium.com>
> Date: Wed, 13 May 2009 11:46:04 +0100
> To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
> <asterisk-users at lists.digium.com>
> Subject: [asterisk-users] Playback to channel using AMI
> 
> Hi All,
> 
> I was wondering if there's any way in Asterisk 1.4.21.2 to playback a wav
> file to a channel using the AMI?
> 
> I've had a play and, as there wasn't a Playback command implemented
directly
> in the AMI, I thought about maybe calling an AGI script from the AMI to do
> this but it seems there's no support for executing AGI through the AMI
> either?
> 
> All I found so far was this:
> 
> 
> http://www.moythreads.com/wordpress/2007/12/24/asterisk-asynchronous-agi/
> 
> After trying to use "Action: AGI" through the AMI I discovered the
> functionality hasn't been included in the release (Invalid Command in the
> response) and wondered why?
> 
> Is there any other way to playback a wav to a channel using AMI?
> 
> Regards,
> 
> Jon Morgan.
> 
> 
> 
> 
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> 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 --

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

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.329 / Virus Database: 270.12.27/2111 - Release Date: 05/13/09
07:04:00




More information about the asterisk-users mailing list