[asterisk-users] play a sound file directly to a caller channel

Jim Dickenson dickenson at cfmc.com
Sun May 16 09:11:38 CDT 2010


We do the following:

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_18-00000002
ActionID: PlayBack
Async: true


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


-- 
Jim Dickenson
mailto:dickenson at cfmc.com

CfMC
http://www.cfmc.com/



On May 16, 2010, at 4:16 AM, Daniel Knoll wrote:

> Hello User-List,
> is it possible to play a sound file directly to a caller channel? 
> 
> Like this AMI command
> 
> Action: Originate
> Channel: SIP/20-00001d41
> Application: Playback
> Data: /path/to/audio/file
> 
> I get an Error Message. My intension is to play a sound file to a caller and the other callers don't hear this.
> Can someone help me ?
> 
> Thanks a lot 
> Bye Daniel
> 
> 
> 
> 
> -- 
> _____________________________________________________________________
> -- 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




More information about the asterisk-users mailing list