Method getVariable cause error on FS 1.0.2 in javascript
Hi all, I am using the javascript for call termination, and after call complete, I use getVariable mehtod to get some values like PDD. Below is my javascript that perform this: ============================================================ dialstr="sofia/outbound/1111@xxx.xxx.xx.xx"; newsession.originate(session, dialstr); if(session.ready() && newsession.ready()) bridge(session, newsession); if(newsession.getVariable("progressmsec") != false) //in FS 1.0.2 and SVN version SCRIPT TERMINATES on above line pdd = newsession.getVariable("progressmsec"); else pdd = 0; .................<other code> ========================================================== Above script works fine in FS 1.0.1. Now I am testing FS 1.0.2, It also works fine when call is being ANSWERED, PDD is correctly collected, BUT when Call is not routed successfully due to some network problem, or User No-Answer / Busy, then below error occurs: ------------------------------------------------------------------------------------------------------------------------------------------------------- 2009-01-19 19:40:43 [ERR] inline:1 mod_spidermonkey() You must call the session.originate method before calling this method! -------------------------------------------------------------------------------------------------------------------------------------------------------- And after this error, script DOES NOT continue execution and TERMINATES. I also tested SVN version (revision 11266), but same error occurs there too. What should be the cause here, so this behavior of FS is changed from 1.0.1 to 1.0.2. Thanks. msp -- View this message in context: http://www.nabble.com/Method-getVariable-cause-error-on-FS-1.0.2-in-javascri... Sent from the Freeswitch-users mailing list archive at Nabble.com.
Hi again, How can i resolve this error, Does it require to modify my js code, Or any freeswitch settings (dialplan or profile related etc.) can solve this? I am waiting for your response. Thanks in advance... -- View this message in context: http://www.nabble.com/Method-getVariable-cause-error-on-FS-1.0.2-in-javascri... Sent from the Freeswitch-users mailing list archive at Nabble.com.
You really shouldn't be using the originate method. You're doing more by hand then you should. Care to post a little more detail about how you're using this? /b On Jan 21, 2009, at 1:10 AM, shehzad p wrote:
newsession.originate(session, dialstr);
You *never* could get vars from channels that did not successfully originate. Unless originate was a success there is nothing to get variables from. What you probably did was get the variable from the existing session when a failure occurs because pdd time from a failed call is copied across to the A leg. So try session.getVariable not newsession.getVariable On Wed, Jan 28, 2009 at 5:54 AM, Brian West <brian@freeswitch.org> wrote:
You really shouldn't be using the originate method. You're doing more by hand then you should. Care to post a little more detail about how you're using this?
/b
On Jan 21, 2009, at 1:10 AM, shehzad p wrote:
newsession.originate(session, dialstr);
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
participants (3)
-
Anthony Minessale
-
Brian West
-
shehzad p