Sched hangup javascript example
About
An example for Sched hangup in Javascript;
Example
/**schedhangup.js --example script to execute scheduled hangup from javascript **/
session.Answer();
session.streamFile("ivr/ivr-welcome_to_freeswitch.wav", "");
session.streamFile("ivr/ivr-hold_connect_call.wav", "");
var DialNumber = 910000000000;
var calllength = "60";
var dialstr = "sofia/external/"+DialNumber+"@myproviderip";
new_session = new Session();
// The following lines are WRONG WRONG WRONG please don't use them
//new_session.setCallerData("caller_id_name", "Vidhya");
//new_session.setCallerData("caller_id_number", "1234567890");
//new_session.originate(session, dialstr,60);
//
new_session.execute("sched_hangup","+"+calllength+" alloted_timeout");
bridge(session, new_session);
new_session.hangup();
session.hangup();