A critical issue with this change, FS crash everytime when session.hangup is called with a hook in place.<div>The information from windows showing that the crash mod is js32.dll</div><div><br></div><div>Would you please have a look at this problem?</div>
<div><br><div class="gmail_quote">On Sat, Jul 24, 2010 at 11:28 AM, Anthony Minessale <span dir="ltr"><<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I mixed it up with lua.<div><br></div><div><br></div><div>return "exit";</div><div><br></div><div>in your hanguphook to exit the script.</div><div><div><div></div><div class="h5"><br><br><div class="gmail_quote">
On Fri, Jul 23, 2010 at 8:33 PM, Sergey Okhapkin <span dir="ltr"><<a href="mailto:sos@sokhapkin.dyndns.org" target="_blank">sos@sokhapkin.dyndns.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Makes sense then to use realtime call flow control from the script.<br>
<div><div></div><div><br>
On Friday 23 July 2010, xuyan yang wrote:<br>
> In my application, I seldom route calls. The task is to use FS as a<br>
> automated business coordinator over phone. Users call the system to update<br>
> their information and raise requests. The system collect these information<br>
> and upload to database. With real-time data, FS make decision and give out<br>
> instruction through SMS or out-going calls.<br>
> In this interesting situation, Freeswitch become Never-Switch, because it<br>
> takes the responsibility itself to communicate with each caller/callee<br>
> instead of switching to others.<br>
> That's why my script become complex.<br>
><br>
> On Sat, Jul 24, 2010 at 8:03 AM, Sergey Okhapkin<br>
><br>
> <<a href="mailto:sos@sokhapkin.dyndns.org" target="_blank">sos@sokhapkin.dyndns.org</a>>wrote:<br>
> > Which task do you want to accomplish? To me dynamic generation of FS<br>
> > dialplan<br>
> > from a script (language doesn't matter) works better than realtime call<br>
> > flow<br>
> > control from a script, event socket etc. I do call routing, no PBX<br>
> > functions.<br>
> ><br>
> > On Friday 23 July 2010, xuyan yang wrote:<br>
> > > I know the solution of putting "if(!session.ready())exit()" to every<br>
> ><br>
> > check<br>
> ><br>
> > > point. But as my script already has nearly 3000 lines, there are too<br>
> > > many "if(!session.ready())exit()" to add.<br>
> > ><br>
> > > I tried error(); it works just because error is not defined. Using<br>
> > > intentional mistake to force exit is creative but strange.<br>
> > > After some thoughts I found that throw a user defined exception in the<br>
> ><br>
> > hook<br>
> ><br>
> > > may be a better way to force exit without the red [ERR] line.<br>
> > ><br>
> > > By the way, I still feel that let exit() in the hook stop the whole<br>
> ><br>
> > script<br>
> ><br>
> > > instead of the hook only seems to be more consistent because they are<br>
> > > not executed in separate thread. Would you please consider this if it<br>
> > > is not difficult? Thanks.<br>
> > ><br>
> > ><br>
> > > On Sat, Jul 24, 2010 at 6:17 AM, Anthony Minessale <<br>
> > ><br>
> > > <a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>> wrote:<br>
> > > > if session.ready is false it means the channel is hungup.<br>
> > > ><br>
> > > > error(); will exit your script.<br>
> > > ><br>
> > > > you can probably remove some of them if you are getting better<br>
> > > > results with the patch.<br>
> > > ><br>
> > > > On Fri, Jul 23, 2010 at 4:56 PM, xuyan yang <<a href="mailto:xyangni@gmail.com" target="_blank">xyangni@gmail.com</a>> wrote:<br>
> > > >> Thanks for your update. I have tested it again base on the latest<br>
> > > >> git tree, the hangup hook does work every time and the script<br>
> > > >> continue to run without error message.<br>
> > > >><br>
> > > >> But this behaviour change caused another problem as I still need to<br>
> ><br>
> > stop<br>
> ><br>
> > > >> the script when the session is hangup.<br>
> > > >> Adding if(session.ready()) to every line of my script does not seem<br>
> > > >> to be a good solution. So I decided to call exit() in the hangup<br>
> > > >> hook. However the test result is that exit() in hangup hook only<br>
> > > >> works the same as "return". That means exit() in hangup hook only<br>
> > > >> stops the hook while the main program can not be stopped.<br>
> > > >><br>
> > > >> Is there any good solution to stop the script immediately when<br>
> > > >> hangup?<br>
> > > >><br>
> > > >> On Sat, Jul 24, 2010 at 3:13 AM, Anthony Minessale <<br>
> > > >><br>
> > > >> <a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>> wrote:<br>
> > > >>> give lastest HEAD a try, I pushed in some more checks and made<br>
> ><br>
> > calling<br>
> ><br>
> > > >>> session.hangup() nonfatal when it's already hungup.<br>
> > > >>><br>
> > > >>> On Fri, Jul 23, 2010 at 1:27 PM, xuyan yang <<a href="mailto:xyangni@gmail.com" target="_blank">xyangni@gmail.com</a>><br>
> ><br>
> > wrote:<br>
> > > >>>> I added many session.ready() as below and re-do the test again.<br>
> > > >>>> the steps are:<br>
> > > >>>> 1. type jsrun test.js in fs_cli<br>
> > > >>>> 2. answer the call in x-lite.<br>
> > > >>>> 3. when I hear the speech, hangup the call in about 1 second.<br>
> > > >>>> 4 check the log to find "hangup!!!!!!!!!!!!!"<br>
> > > >>>><br>
> > > >>>> the result is that<br>
> > > >>>> about half of the test failed to call hangup hook.<br>
> > > >>>> in all tests the script end up with [ERR] inline:1 Session is not<br>
> > > >>>> active! then the script stopped and session.ready() near the<br>
> > > >>>> end can not get the chance to run.<br>
> > > >>>><br>
> > > >>>><br>
> > > >>>><br>
> > > >>>> ////test.js<br>
> > > >>>> function on_hangup(session, how){<br>
> > > >>>> console_log("notice","hangup!!!!!!!!!!!!!\n");<br>
> > > >>>> }<br>
> > > >>>><br>
> > > >>>> session = new Session("sofia/gateway/12voip-out/*********");<br>
> > > >>>> session.waitForAnswer();<br>
> > > >>>> session.ready();<br>
> > > >>>> session.execute("set","continue_on_fail=true");<br>
> > > >>>> var res=session.setHangupHook(on_hangup);<br>
> > > >>>> console_log("notice","res:"+res+"\n");<br>
> > > >>>> if(session.ready())session.execute("speak", "This is an example of<br>
> > > >>>> flite text to speech engine. We can test the work of<br>
> > > >>>> hanguphook."); if(session.ready())session.execute("speak","you are<br>
> > > >>>> calling from " + session.caller_id_num + " You are calling " +<br>
> > > >>>> session.destination ); session.ready();<br>
> > > >>>> session.hangup();<br>
> > > >>>><br>
> > > >>>> On Sat, Jul 24, 2010 at 1:08 AM, Anthony Minessale <<br>
> > > >>>><br>
> > > >>>> <a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>> wrote:<br>
> > > >>>>> It checks before and after blocking calls like that.<br>
> > > >>>>><br>
> > > >>>>> On Jul 23, 2010 11:53 AM, "Dan" <<a href="mailto:freeswitch-users@digitaldan.com" target="_blank">freeswitch-users@digitaldan.com</a>><br>
> > > >>>>> wrote:<br>
> > > >>>>><br>
> > > >>>>> So If I call session.recordFile which blocks in code until the<br>
> ><br>
> > user<br>
> ><br>
> > > >>>>> hangs up, and can't make periodic calls to session.ready, is the<br>
> > > >>>>> hangup hook not realiable in this scenario?<br>
> > > >>>>><br>
> > > >>>>> ------------------------------<br>
> > > >>>>> *From: *"Anthony Minessale" <<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>><br>
> > > >>>>> *To: *"FreeSWITCH Users Help" <<br>
> ><br>
> > <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>><br>
> ><br>
> > > >>>>> *Sent: *Thursday, July 22, 2010 10:30:48 AM<br>
> > > >>>>> *Subject: *Re: [Freeswitch-users] Unstable hangup hook in<br>
> ><br>
> > javascript<br>
> ><br>
> > > >>>>> You must make periodic calls to session.ready() or some other<br>
> > > >>>>> freeswitch api functions to trigger ...<br>
> > > >>>>><br>
> > > >>>>> _______________________________________________<br>
> > > >>>>> FreeSWITCH-users mailing list<br>
> > > >>>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
> > > >>>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> > > >>>>> UNSUBSCRIBE:<br>
> > > >>>>> <a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> > > >>>>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> > > >>>>><br>
> > > >>>>><br>
> > > >>>>> _______________________________________________<br>
> > > >>>>> FreeSWITCH-users mailing list<br>
> > > >>>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
> > > >>>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> > > >>>>> UNSUBSCRIBE:<br>
> > > >>>>> <a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> > > >>>>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> > > >>>><br>
> > > >>>> _______________________________________________<br>
> > > >>>> FreeSWITCH-users mailing list<br>
> > > >>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
> > > >>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> > > >>>> UNSUBSCRIBE:<br>
> > > >>>> <a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> > > >>>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> > > >>><br>
> > > >>> --<br>
> > > >>> Anthony Minessale II<br>
> > > >>><br>
> > > >>> FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
> > > >>> ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
> > > >>> Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br>
> > > >>><br>
> > > >>> AIM: anthm<br>
> > > >>> <a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><MSN%3Aanthony_minessale@hotmail.c<br>
> > > >>>om><<br>
> ><br>
</div></div>> > <a href="mailto:MSN%253Aanthony_minessale@hotmail.com" target="_blank">MSN%3Aanthony_minessale@hotmail.com</a><<a href="mailto:MSN%25253Aanthony_minessale@hotmail.com" target="_blank">MSN%253Aanthony_minessale@hotmail.com</a><br>
<div>> >><br>
> ><br>
> > > >>> GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><PAYPAL%3Aanthony.mi<br>
> > > >>><a href="mailto:nessale@gmail.com" target="_blank">nessale@gmail.com</a>><br>
> ><br>
> > <PAYPAL%3Aanthony.miness<br>
> ><br>
> > > >>><a href="mailto:ale@gmail.com" target="_blank">ale@gmail.com</a>> IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
> > > >>><br>
> > > >>> FreeSWITCH Developer Conference<br>
> > > >>> <a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><sip%3A888@conference.freeswitch.o<br>
> > > >>>rg><<br>
> ><br>
</div>> > <a href="mailto:sip%253A888@conference.freeswitch.org" target="_blank">sip%3A888@conference.freeswitch.org</a><<a href="mailto:sip%25253A888@conference.freeswitch.org" target="_blank">sip%253A888@conference.freeswitch.org</a><br>
<div>> >><br>
> ><br>
> > > >>> <a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><googletalk%3Aconf%2B8<br>
> > > >>><a href="mailto:88@conference.freeswitch.org" target="_blank">88@conference.freeswitch.org</a>><br>
> ><br>
> > <googletalk%3Aconf%2B888@c<br>
> ><br>
> > > >>><a href="http://onference.freeswitch.org" target="_blank">onference.freeswitch.org</a>> pstn:+19193869900<br>
> > > >>><br>
> > > >>> _______________________________________________<br>
> > > >>> FreeSWITCH-users mailing list<br>
> > > >>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
> > > >>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> > > >>> UNSUBSCRIBE:<br>
> ><br>
> > <a href="http://lists.freeswitch.org/mailman/options/freeswitch-user" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-user</a><br>
> ><br>
> > > >>>s <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> > > >><br>
> > > >> _______________________________________________<br>
> > > >> FreeSWITCH-users mailing list<br>
> > > >> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
> > > >> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> > > >> UNSUBSCRIBE:<br>
> ><br>
> > <a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> ><br>
> > > >> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> > > ><br>
> > > > --<br>
> > > > Anthony Minessale II<br>
> > > ><br>
> > > > FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
> > > > ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
> > > > Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br>
> > > ><br>
> > > > AIM: anthm<br>
> > > > <a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><<a href="mailto:MSN%253Aanthony_minessale@hotmail.com" target="_blank">MSN%3Aanthony_minessale@hotmail.com</a><br>
> > > >><<br>
> ><br>
</div>> > <a href="mailto:MSN%253Aanthony_minessale@hotmail.com" target="_blank">MSN%3Aanthony_minessale@hotmail.com</a><<a href="mailto:MSN%25253Aanthony_minessale@hotmail.com" target="_blank">MSN%253Aanthony_minessale@hotmail.com</a><br>
<div>> >><br>
> ><br>
> > > > GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><PAYPAL%3Aanthony.mine<br>
</div><div>> > > ><a href="mailto:ssale@gmail.com" target="_blank">ssale@gmail.com</a>><br>
> ><br>
> > <PAYPAL%3Aanthony.minessal<br>
> ><br>
> > > ><a href="mailto:e@gmail.com" target="_blank">e@gmail.com</a>> IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
> > > ><br>
> > > > FreeSWITCH Developer Conference<br>
> > > > <a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><<a href="mailto:sip%253A888@conference.freeswitch.org" target="_blank">sip%3A888@conference.freeswitch.org</a><br>
> > > >><<br>
> ><br>
</div>> > <a href="mailto:sip%253A888@conference.freeswitch.org" target="_blank">sip%3A888@conference.freeswitch.org</a><<a href="mailto:sip%25253A888@conference.freeswitch.org" target="_blank">sip%253A888@conference.freeswitch.org</a><br>
<div>> >><br>
> ><br>
> > > > <a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><googletalk%3Aconf%2B888<br>
</div><div>> > > >@<a href="http://conference.freeswitch.org" target="_blank">conference.freeswitch.org</a>><br>
> ><br>
> > <googletalk%3Aconf%2B888@con<br>
> ><br>
> > > ><a href="http://ference.freeswitch.org" target="_blank">ference.freeswitch.org</a>> pstn:+19193869900<br>
> > > ><br>
> > > > _______________________________________________<br>
> > > > FreeSWITCH-users mailing list<br>
> > > > <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
> > > > <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> > > > UNSUBSCRIBE:<br>
> ><br>
> > <a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> ><br>
> > > > <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> ><br>
> > _______________________________________________<br>
> > FreeSWITCH-users mailing list<br>
> > <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
> > <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> > UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> > <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
><br>
<br>
<br>
</div><div><div></div><div>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div>-- <br><div class="im">Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>
</div><div class="im">GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br></div><div class="im">
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br>
</div><div class="im"><a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br></div>
pstn:+19193869900<br>
</div>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>