<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:courier,monaco,monospace,sans-serif;font-size:12pt">please update to 4773 or better and see the code examples<br>in the commit log.<br><br><span><a target="_blank" href="http://fisheye.freeswitch.org/changelog/FreeSWITCH/?cs=4773">http://fisheye.freeswitch.org/changelog/FreeSWITCH/?cs=4773</a></span><br><div> </div><div>Anthony Minessale II<br><br><span>FreeSWITCH <a target="_blank" href="http://www.freeswitch.org/">http://www.freeswitch.org/</a></span><br><span>ClueCon <a target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com/</a></span><br><br>AIM: anthm<br>MSN:anthony_minessale@hotmail.com<br>JABBER:anthony.minessale@gmail.com<br>IRC: irc.freenode.net #freeswitch</div><div><br>FreeSWITCH Developer
Conference<br>sip:888@conference.freeswitch.org<br>iax:guest@conference.freeswitch.org/888<br>googletalk:conf+888@conference.freeswitch.org<br>pstn:213-799-1400</div><div style="font-family: courier,monaco,monospace,sans-serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Tamas Cseke <cstomi.levlist@gmail.com><br>To: freeswitch-users@lists.freeswitch.org<br>Sent: Saturday, March 24, 2007 5:34:13 AM<br>Subject: [Freeswitch-users] spidermonkey- session done->script terminate<br><br>Hello,<br><br>I need help using session object, please help me.<br>"Note: While the JavaScript application will continue to execute after a
hangup is detected the session object will be gone and any attempt to
access it will cause the JavaScript to terminate. Save off any
variables you might need for post hangup processing and use your local
variables instead."<br><br>How can i avoid the script termination, is it possible to somehow safely check if the session hungup?<br><br>exactly i'd like to call an user, if don't answer call another, i can't use simply mod_bridgecall because
<br>i know the destinations just in runtime, i try use fetchURLHash to determine the next user, when one fails.<br><br><br><br>var queue = argv;<br>var hash = new Array();<br><br>while (true) {<br><br>// fetch first agent
<br>fetchURLHash("<a rel="nofollow" target="_blank" href="http://localhost:8000/lockagent/">http://localhost:8000/lockagent/</a>" + queue + "/"+session.uuid, "hash");<br>var agent = hash["agent"];<br><br><br>//call agent
<br>//...<br> new_session = new Session(session,<br> "sofia/devil/" + agent + "%192.168.1.93", //dest<br> "xml",//dialplan<br> "default",//context
<br> "",//cid_name<br> ""), //cid_num<br> "",//network_addr<br> "",//ani
<br> "",//anii<br> "",//rdnis<br> "",//username<br> 10);//to<br> <br> <br> // i need help in this condition
<br> // on timeout, new_session is done, and if i try access its properties, script terminate<br><br> if (session.ready() && new_session.ready()) {<br><br> bridge(session, new_session);<br> fetchURLHash("
<a rel="nofollow" target="_blank" href="http://localhost:8000/unlockagent/">http://localhost:8000/unlockagent/</a>" + agent + "/" + session.uuid, "hash");<br> break;<br><br> }<br> else {<br> // should try again, but script terminated
<br> console_log("notice","timeout, try again...\n");<br> //wait a bit<br> }<br> fetchURLHash("<a rel="nofollow" target="_blank" href="http://localhost:8000/unlockagent/">http://localhost:8000/unlockagent/</a>
" + agent + "/" + session.uuid, "hash");<br>}<br><br>Thanks any help,<br>Tamas<br>
<div>_______________________________________________<br>Freeswitch-users mailing list<br>Freeswitch-users@lists.freeswitch.org<br><a target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br></div></div><br></div></div><br>
<hr size=1>We won't tell. Get more on <a href="http://us.rd.yahoo.com/evt=49980/*http://tv.yahoo.com/collections/265
">shows you hate to love</a><br>(and love to hate): <a href="http://us.rd.yahoo.com/evt=49980/*http://tv.yahoo.com/collections/265
">Yahoo! TV's Guilty Pleasures list.</a></body></html>