[Freeswitch-users] Non-Blocking Music on Hold

Jon Davies jonpauldavies at gmail.com
Wed Jun 9 05:46:57 PDT 2010


Hi There

I'm attempting to port an application I've written in CCXML/VXML to
FreeSwitch/javascript and finding it a very enjoyable experience. I've
hit the limits of the documentation and my knowledge and was wondering
if there were any clever people on the list who can assist me with one
little part.

My scenario is:

Make an outbound call and play it MOH
Make a 2nd outbound call
If the 2nd call connects, take the 1st call off MOH and bridge them together
If the 2nd call fails for whatever reason, take the 1st call off MOH
and play it a 'sorry' message.

My problem is, all my attempts to play MOH to the first call results
in blocking, meaning I dont ever get to originate my 2nd call. I've
tried

firstcall.streamFile("music.wav");

and

firstcall.execute( "fifo", "myqueue in undef 'music.wav'" );

but both block until I hang up. Anyone got any insight as to how I can
achieve this scenario in a non-blocking manner? I'm using javascript.

-- 
Regards

Jon Davies



More information about the FreeSWITCH-users mailing list