<div dir="ltr">Hi,<br><br>I have the same problem. below is the script which i used.<br>if i don't use session.answer then it give correct session time but if i use session.answer before new session originate it does not gives the correct time.<br>
<br>i have provided the logs also with and without session.answer.<br><br>my script is as following:<br><br>//========start =========<br><br>session.answer();<br>var DialNumber = 919971XXXX;<br><br>console_log("notice", "Your destination :"+DialNumber+"\n");<br>
<br>var dialstr = "sofia/external/"+DialNumber+"@<a href="http://192.168.1.10:5090">192.168.1.10:5090</a>";<br><br><br> new_session = new Session();<br> new_session.setCallerData("caller_id_name", "ABC");<br>
new_session.setCallerData("caller_id_number", "2121231234");<br> new_session.originate(session, dialstr,60);<br> bridge(session, new_session);<br>
<br><br>var Acallduration=session.getVariable("billsec");<br><br>var p1time=session.getVariable("progresssec");<br><br>var odur=session.getVariable("duration");<br><br>var Bcallduration=new_session.getVariable("billsec");<br>
var p2time=new_session.getVariable("progresssec");<br>var ndur=new_session.getVariable("duration");<br><br>console_log("notice", "Your old session bill duration:"+Acallduration+"\n");<br>
console_log("notice", "Your old session progress time :"+p1time+"\n");<br>console_log("notice", "Your old session total time :"+odur+"\n");<br><br>console_log("notice", "Your new session bill duration :"+Bcallduration+"\n");<br>
console_log("notice", "Your new session progress time :"+p2time+"\n");<br>console_log("notice", "Your new session total time :"+ndur+"\n");<br>new_session.hangup();<br>
<br><br>session.hangup();<br><br><br>//======end============<br><br><br>Case 1: when session.answer was commented.run java script call was made to number 919971XXXX and connected for 4 seconds.<br>so this is showing correct time.<br>
<br><br>2008-08-20 16:00:48 [NOTICE] test.js:1 console_log() Your old session bill duration:4<br>2008-08-20 16:00:48 [NOTICE] test.js:1 console_log() Your old session progress time :6<br>2008-08-20 16:00:48 [NOTICE] test.js:1 console_log() Your old session total time :16<br>
2008-08-20 16:00:48 [NOTICE] test.js:1 console_log() Your new session bill duration :false<br>2008-08-20 16:00:48 [NOTICE] test.js:1 console_log() Your new session progress time :false<br>2008-08-20 16:00:48 [NOTICE] test.js:1 console_log() Your new session total time :false<br>
<br><br><br>Case 2: When session.answer was used.call was connected to number 919971XXXX for 8 seconds only but its showing 19 seconds. which is not correct.<br><br>2008-08-20 16:11:47 [NOTICE] test.js:1 console_log() Your old session bill duration:19<br>
2008-08-20 16:11:47 [NOTICE] test.js:1 console_log() Your old session progress time :0<br>2008-08-20 16:11:47 [NOTICE] test.js:1 console_log() Your old session total time :19<br>2008-08-20 16:11:47 [NOTICE] test.js:1 console_log() Your new session bill duration :false<br>
2008-08-20 16:11:47 [NOTICE] test.js:1 console_log() Your new session progress time :false<br>2008-08-20 16:11:47 [NOTICE] test.js:1 console_log() Your new session total time :false<br><br><br><br>can anyone please look into the issue.<br>
<br><br><div class="gmail_quote">On Mon, Aug 18, 2008 at 9:14 PM, 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="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Can you update to the latest SVN trunk and use "make current" and if you can still cause this problem, write a small script that demonstrates the issue so we can test it ourselves and post it to <a href="http://jira.freeswitch.org" target="_blank">http://jira.freeswitch.org</a><br>
<br><br><div class="gmail_quote"><div><div></div><div class="Wj3C7c">On Sun, Aug 17, 2008 at 2:42 PM, Anand Kumar <span dir="ltr"><<a href="mailto:kanand81@gmail.com" target="_blank">kanand81@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">
<div dir="ltr">Hi All,<br><br>Please help me, <br><br>I am trying to find out call answer time duration. i have tested in 2 way..<br><br>1. Make one call using FS and call is terminate on pstn and i hangup from the softphone that time i got answer time using ..<br>
<br>var callduration=session.getVariable("duration");<br><br>console_log() Your call Answer time :4<br><br>2. when i disconnect the call from pstn site that time i am not get answer time duration...<br><br>Your call Answer time :false<br>
same code is return ""<b>false</b>" why ?<br><br>please help me..<br><br>Thanks<br>Anand Dayal<br></div>
<br></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>
<br></blockquote></div><br><br clear="all"><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>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>
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>
<a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<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><br clear="all"><br>-- <br>Thanks and Regards <br><br>Vidhya Sagar Dixit<br>
</div>