[Freeswitch-users] Question about javascript

Tomoya Matsubara matsubara_tomoya at intec.co.jp
Tue Jan 26 19:35:33 PST 2010


Hello,

When the following scripts were tested, it seems to do the memory leak. 
Please teach when there is a problem in this script. 

-- test script --
session.execute("ring_ready");
session.answer();
session.setVariable("ringback", "%(1000, 2000, 440, 460)");

var bleg = new Session();
var sound_wav = "sounds/test01.wav";
var sound_leg = "both";
var op = "api_on_answer=uuid_broadcast "+session.uuid+" "+sound_wav+" "+sound_leg;
var ret = bleg.originate(session, "{"+op+"}" + "sofia/gateway/profile0_gateway1/1000");
if(!session.ready()){
  return;
}

if(!ret){ // bleg not answered.
  var sound_wav = "sounds/test02.wav";
  session.streamFile(sound_wav);
  if(session.ready()){
    session.hangup();
  }
  return;
}

if(bleg.ready()){
  bridge(session, bleg);
}




More information about the FreeSWITCH-users mailing list