<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>&nbsp;</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 &lt;cstomi.levlist@gmail.com&gt;<br>To: freeswitch-users@lists.freeswitch.org<br>Sent: Saturday, March 24, 2007 5:34:13 AM<br>Subject: [Freeswitch-users] spidermonkey- session done-&gt;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>&nbsp; new_session = new Session(session,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "sofia/devil/" + agent + "%192.168.1.93", //dest<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "xml",//dialplan<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "default",//context
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "",//cid_name<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ""), //cid_num<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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bsp;&nbsp;&nbsp; // i need help in this condition
<br>&nbsp;&nbsp;&nbsp; // on timeout, new_session is done, and if i try access its properties, script terminate<br><br>&nbsp;&nbsp;&nbsp; if (session.ready() &amp;&amp; new_session.ready()) {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bridge(session, new_session);<br>&nbsp;&nbsp;&nbsp;&nbsp; fetchURLHash("
<a rel="nofollow" target="_blank" href="http://localhost:8000/unlockagent/">http://localhost:8000/unlockagent/</a>" + agent + "/" + session.uuid, "hash");<br>&nbsp;&nbsp;&nbsp;&nbsp; break;<br><br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // should try again, but script terminated
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console_log("notice","timeout, try again...\n");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //wait a bit<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp; 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>