[Freeswitch-users] Need to fake ringback

Nicolas Brenner nicolas at medularis.com
Thu Jan 7 21:33:30 PST 2010


I'm trying to fake a ringback for leg1 of a two-legged call without success.

I'm doing this with a JS script, originating one leg first, then the
second and executing the bridge application on both afterwards. I
would like to fake a ringback on the first call while they wait for
the second call to connect.

I tried originating the call and then setting the ringback (like the
example here: http://wiki.freeswitch.org/wiki/Custom_Ring_Back_Tones),
and I also tried setting the ringback in the originate command, but
none of those worked. I even tried using the variable
instant_ringback, but it didn't work either.


This is the code for the first case:

ostr = "{ignore_early_media=true,originate_timeout=90,hangup_after_bridge=false,medularis_uuid="+uuid+",c2c_call=true,api_call=true,leg=1}[leg_timeout="+timeout+"]sofia/gateway/mygw/123456789";
session1 = new Session(ostr);
if (session1.ready())
{
session1.execute("set","instant_ringback=%(2000,4000,440.0,480.0)");
}


And this is the originate string for the second case:

var stUsRing = "%(2000,4000,440,480)";
ostr = "{ignore_early_media=true,originate_timeout=90,hangup_after_bridge=false,ringback='"+stUsRing+"',medularis_uuid="+uuid+",c2c_call=true,api_call=true,leg=1}[leg_timeout="+timeout+"]sofia/gateway/mygw/123456789";


Thanks for your help!


Nico




More information about the FreeSWITCH-users mailing list