Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Cant get Disposition status in Javascript


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
yudha2008 at gmail.com
Guest





PostPosted: Thu Feb 26, 2009 6:54 am    Post subject: [Freeswitch-users] Cant get Disposition status in Javascript Reply with quote

Hi,

    I am using javascript to store uuid, phone_no, endpoint_disposition and hangup cause in my MYSQL. I can get the session UUID , Phone_no, endpoint disposition but i cant get the originate disposition.


Javascript :


session.setVariable("session.uuid", "ses_uuid: " + session.uuid);  

session.setVariable("phone", "phone_no: " +argv[0]);

result = session.getVariable("endpoint_disposition")

hangup = session.getVariable("originate_disposition")





OUTPUT:


S_UUID                                                                       PHONE_NO         RESULT          HANGUP_STATE


f579cb15-5145-4eb1-a080-03b9e53b90f739841799874     39841799874        ANSWER                    



for "originate_disposition" i did not get any value stored in the Table. So how can get the originate_disposition ????

--
Warm Regards,
N.Baskar
Back to top
yudha2008 at gmail.com
Guest





PostPosted: Thu Feb 26, 2009 7:56 am    Post subject: [Freeswitch-users] Cant get Disposition status in Javascript Reply with quote

Hi,

     One thing i forget to tell i can able to get this Disconnection cause and Disconnection code in Freeswitch console but when i set in the variable i did not get the cause or cause code in javascript.


I use these line in Javascript i get the output in the Freeswitch console.


console_log("notice", "Disconnect cause: " + session.cause + "\n");
console_log("notice", "Disconnect cause: " + session.causecode + "\n");


OUTPUT: (For the Above line)


2009-02-26 18:08:57 [NOTICE] odbc1.js:1 console_log() Disconnect cause: NORMAL_CLEARING
2009-02-26 18:08:57 [NOTICE] odbc1.js:1 console_log() Disconnect cause: 16



But same session cause and code if i set in the variable i did not get output


session.setVariable("session.causecode", "discause: " + session.causecode+ "\n);
session.setVariable("notice", "Disconnect cause: " + session.cause + "\n");




OUTPUT:


variable_session.causecode: [discause: 0]
variable_notice: [Disconnect cause: NONE]


Correct me where i am wrong how can i get the disconnection cause in variable.


Please help to solve the problem.






--
Warm Regards,
N.Baskar
Back to top
anthony.minessale at g...
Guest





PostPosted: Thu Feb 26, 2009 9:24 am    Post subject: [Freeswitch-users] Cant get Disposition status in Javascript Reply with quote

both of your set lines are wrong:

session.cause and session.causecode are attributes

session.setVariable("session.causecode", "discause: " + session.causecode+ "\n);
session.setVariable("notice", "Disconnect cause: " + session.cause + "\n");

session.setVariable("cause_code", session.causecode);
session.setVariable("cause_name", session.cause);
 
would be more appropriate.

Also originate_disposition is only on outgoing legs.

Doing this sort of thing in the same script is not a good plan. 
You should really be doing it in the CDR engine where you can get records for both legs of the call in a relaxed environment.



On Thu, Feb 26, 2009 at 6:44 AM, Baskar <yudha2008@gmail.com (yudha2008@gmail.com)> wrote:
Quote:
Hi,

     One thing i forget to tell i can able to get this Disconnection cause and Disconnection code in Freeswitch console but when i set in the variable i did not get the cause or cause code in javascript.


I use these line in Javascript i get the output in the Freeswitch console.


console_log("notice", "Disconnect cause: " + session.cause + "\n");
console_log("notice", "Disconnect cause: " + session.causecode + "\n");


OUTPUT: (For the Above line)


2009-02-26 18:08:57 [NOTICE] odbc1.js:1 console_log() Disconnect cause: NORMAL_CLEARING
2009-02-26 18:08:57 [NOTICE] odbc1.js:1 console_log() Disconnect cause: 16



But same session cause and code if i set in the variable i did not get output


session.setVariable("session.causecode", "discause: " + session.causecode+ "\n);
session.setVariable("notice", "Disconnect cause: " + session.cause + "\n");




OUTPUT:


variable_session.causecode: [discause: 0]
variable_notice: [Disconnect cause: NONE]


Correct me where i am wrong how can i get the disconnection cause in variable.


Please help to solve the problem.






--
Warm Regards,
N.Baskar



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (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 ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
yudha2008 at gmail.com
Guest





PostPosted: Thu Feb 26, 2009 10:07 am    Post subject: [Freeswitch-users] Cant get Disposition status in Javascript Reply with quote

Hi Anthony Minessale,

I have added these lines in my javascript with your guidance. But still i did not get any status like  busy , no answer, etc .


session.setVariable("cause_code", session.causecode);

session.setVariable("cause_name", session.cause);

I Get this output only for all the call:


variable_cause_code: [0]
variable_cause_name: [NONE]




--
Warm Regards,
N.Baskar
Back to top
nik.middleton at noble...
Guest





PostPosted: Thu Feb 26, 2009 4:18 pm    Post subject: [Freeswitch-users] Cant get Disposition status in Javascript Reply with quote

Works for me, see snippet below

var first_session = new Session(dial_string);

// Trap for call failure
if (!first_session.ready()) {
consoleLog("err", "Disposition: " + first_session.cause + "\n");
if (first_session.cause == "USER_BUSY") {
Disposition = "BUSY";
}
else if (first_session.cause == "NO_ROUTE_DESTINATION") {
Disposition = "DCN";
}

else if (first_session.cause == "NO_ANSWER") {
Disposition = "NA";
}


exit();
}


From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Baskar
Sent: 26 February 2009 14:56
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Cant get Disposition status in Javascript


Hi Anthony Minessale,
I have added these lines in my javascript with your guidance. But still i did not get any status like busy , no answer, etc .



session.setVariable("cause_code", session.causecode);

session.setVariable("cause_name", session.cause);


I Get this output only for all the call:



variable_cause_code: [0]

variable_cause_name: [NONE]





--
Warm Regards,
N.Baskar
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services