give lastest HEAD a try, I pushed in some more checks and made calling session.hangup() nonfatal when it's already hungup.
I added many session.ready() as below and re-do the test again.the steps are:1. type jsrun test.js in fs_cli2. answer the call in x-lite.3. when I hear the speech, hangup the call in about 1 second.4 check the log to find "hangup!!!!!!!!!!!!!"the result is thatabout half of the test failed to call hangup hook.in all tests the script end up with [ERR] inline:1 Session is not active! then the script stopped and session.ready() near the end can not get the chance to run.////test.jsfunction on_hangup(session, how){console_log("notice","hangup!!!!!!!!!!!!!\n");}session = new Session("sofia/gateway/12voip-out/*********");session.waitForAnswer();session.ready();session.execute("set","continue_on_fail=true");var res=session.setHangupHook(on_hangup);console_log("notice","res:"+res+"\n");if(session.ready())session.execute("speak", "This is an example of flite text to speech engine. We can test the work of hanguphook.");if(session.ready())session.execute("speak","you are calling from " + session.caller_id_num + " You are calling " + session.destination );session.ready();session.hangup();On Sat, Jul 24, 2010 at 1:08 AM, Anthony Minessale <anthony.minessale@gmail.com> wrote:
It checks before and after blocking calls like that.
So If I call session.recordFile which blocks in code until the user hangs up, and can't make periodic calls to session.ready, is the hangup hook not realiable in this scenario?
From: "Anthony Minessale" <anthony.minessale@gmail.com>
To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org>
Sent: Thursday, July 22, 2010 10:30:48 AM
Subject: Re: [Freeswitch-users] Unstable hangup hook in javascript
You must make periodic calls to session.ready() or some other freeswitch api functions to trigger ...
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org