Playback & do something else while audio is playing

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

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

thanks, that is indeed a good idea - I was expecting a standard function to be able to do this !

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 :smile:

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 !

1 Like