playback & do something else while audio is playing

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

playback & do something else while audio is playing

Postby cerien.jean » Mon Jun 01, 2015 1:49 pm

Hi

I am trying to have a sort of asynchronous playback - I'd like to answer a channel, play an audio file, then start requesting data via curl to a third party app, while the music is playing, and when I get the response back, stop the music and continue processing

playback, background, musiconhold all "stop" the dialplan while audio is not finished or interrupted... How could I achieve this ?

thanks for the help

J
cerien.jean
Oldsterisk
 
Posts: 155
Joined: Thu Jan 22, 2009 8:47 pm

Re: playback & do something else while audio is playing

Postby satish4asterisk » Tue Jun 02, 2015 8:25 am

Just a hint.
After answer, I would dial into local context with option G.
G - If the call is answered, transfer the calling party to the specified priority and the called party to the specified priority plus one.
context
exten
priority


--Satish Barot
satish4asterisk
Oldsterisk
 
Posts: 210
Joined: Fri Dec 23, 2011 1:12 am

Re: playback & do something else while audio is playing

Postby cerien.jean » Tue Jun 02, 2015 8:27 am

thanks, that is indeed a good idea - I was expecting a standard function to be able to do this !
cerien.jean
Oldsterisk
 
Posts: 155
Joined: Thu Jan 22, 2009 8:47 pm

Re: playback & do something else while audio is playing

Postby funda » Sat Jan 30, 2016 4:38 am

AGI is the solution for this

It is of course better to create a symbolic link instead of copying the echo application as I proposed in my previous post :-)

1)create symbolic link : ln -s /bin/echo /usr/share/asterisk/agi-bin/echo
2) start music on hold in dialplan : exten => s,n,agi(echo, SET MUSIC ON)
3) stop music on hold in dialplan : exten => s,n,agi(echo, SET MUSIC OFF)

good luck !
funda
Newsterisk
 
Posts: 1
Joined: Sat Jan 30, 2016 3:19 am


Return to Asterisk Support

Who is online

Users browsing this forum: Google [Bot] and 12 guests

cron