[asterisk-users] Play audio and continue to next priority before audio ends...

Steve Edwards asterisk.org at sedwards.com
Mon Apr 9 15:08:09 MST 2007


On Mon, 9 Apr 2007, Alejandro Mejía wrote:

> I would like to know how to playback an audio file to the caller, and while
> it's played asterisk to continue executing the next priorities on
> extensions.conf
> That's not the case when using "playback" command, because the next priority
> is executed until the audio file ends playing. I want to evaluate some
> variables while caller hears the audio file.

I solved this in my application (adult chat billed to a credit card) by 
writing an AGI that created a thread to play the audio ("Please wait while 
your card is being verified") while the AGI mainline queried the credit 
card processor. Most of the time I get the cc response before the audio 
finishes so the authorization appears to be instantaneous.

The "key" was that the mainline cannot interact with Asterisk (i.e. 
"verbose" while the audio thread is executing.

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000


More information about the asterisk-users mailing list