[Freeswitch-users] Problem in geting call duration

vidhya sagar dixit vids.cs at gmail.com
Wed Aug 20 22:14:28 PDT 2008


Dear Anthony ,

According to your mail ,

*If you answer the inbound leg of the call, of course it will mess up the
times.
The idea is that the bridge app will pass the answer across when the far end
answers.
if you are just trying to establish media, try session.preAnswer instead.*

How it will be possible to take dtmf digits from users when using
session.preAnswer().

my script works like this :

1. User dials a DID number.
2.  Call comes to public .xml and  then runs the javascript .
3. javascript first play the account balance of the user (i know it can be
done with session.preAnswer.)
4.After playing balance  script ask to enter the destination number
...(this will not work with session.preAnswer())
6. then dial the entered number.
7. after call completion get the CDR for the call which shows the duration
of call.(only call duration of new session originated in javascript.)



same like a calling card application.






On Wed, Aug 20, 2008 at 9:20 PM, Anthony Minessale <
anthony.minessale at gmail.com> wrote:

> read my entire email more carefully.
> I addressed your concern.
>
>
>
> On Wed, Aug 20, 2008 at 10:48 AM, vidhya sagar dixit <vids.cs at gmail.com>wrote:
>
>>
>> Hi ,
>>
>> Thanks for the reply . But my concern is not about the false .
>>
>> it should return the correct call duration which its not returning in case
>> if i answer the call.
>> I can not use session.preanswer() as i have to  get dtmf from user  which
>> is not possible without answer.
>>
>> I hope i was able to explain you my problem.
>>
>> Is there any way so that i can get the correct session time?? Please  have
>> a look  on script and logs sent in my previous mail.
>>
>> Thanks.
>>
>>
>> On Wed, Aug 20, 2008 at 8:55 PM, Anthony Minessale <
>> anthony.minessale at gmail.com> wrote:
>>
>>> I fixed the issue in tree so it does not say "false" anymore now it will
>>> just be a blank string.
>>>
>>> If you answer the inbound leg of the call, of course it will mess up the
>>> times.
>>> The idea is that the bridge app will pass the answer across when the far
>>> end answers.
>>> if you are just trying to establish media, try session.preAnswer instead.
>>>
>>>
>>>
>>> On Wed, Aug 20, 2008 at 5:44 AM, vidhya sagar dixit <vids.cs at gmail.com>wrote:
>>>
>>>> Hi,
>>>>
>>>> I have the same problem. below is the script which i used.
>>>> 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.
>>>>
>>>> i have provided the logs also with and without session.answer.
>>>>
>>>> my script is as following:
>>>>
>>>> //========start =========
>>>>
>>>> session.answer();
>>>> var DialNumber = 919971XXXX;
>>>>
>>>> console_log("notice", "Your destination :"+DialNumber+"\n");
>>>>
>>>> var dialstr = "sofia/external/"+DialNumber+"@192.168.1.10:5090";
>>>>
>>>>
>>>>                                         new_session = new Session();
>>>>
>>>> new_session.setCallerData("caller_id_name", "ABC");
>>>>
>>>> new_session.setCallerData("caller_id_number", "2121231234");
>>>>                                         new_session.originate(session,
>>>> dialstr,60);
>>>>                                         bridge(session, new_session);
>>>>
>>>>
>>>> var Acallduration=session.getVariable("billsec");
>>>>
>>>> var p1time=session.getVariable("progresssec");
>>>>
>>>> var odur=session.getVariable("duration");
>>>>
>>>> var Bcallduration=new_session.getVariable("billsec");
>>>> var p2time=new_session.getVariable("progresssec");
>>>> var ndur=new_session.getVariable("duration");
>>>>
>>>> console_log("notice", "Your old session  bill
>>>> duration:"+Acallduration+"\n");
>>>> console_log("notice", "Your old session progress time :"+p1time+"\n");
>>>> console_log("notice", "Your old session total time :"+odur+"\n");
>>>>
>>>> console_log("notice", "Your new session bill duration
>>>> :"+Bcallduration+"\n");
>>>> console_log("notice", "Your new session progress time  :"+p2time+"\n");
>>>> console_log("notice", "Your new session total time  :"+ndur+"\n");
>>>> new_session.hangup();
>>>>
>>>>
>>>> session.hangup();
>>>>
>>>>
>>>> //======end============
>>>>
>>>>
>>>> Case 1:  when session.answer was commented.run java script call was made
>>>> to number 919971XXXX and connected for 4 seconds.
>>>> so this is showing correct time.
>>>>
>>>>
>>>> 2008-08-20 16:00:48 [NOTICE] test.js:1 console_log() Your old session
>>>> bill duration:4
>>>> 2008-08-20 16:00:48 [NOTICE] test.js:1 console_log() Your old session
>>>> progress time :6
>>>> 2008-08-20 16:00:48 [NOTICE] test.js:1 console_log() Your old session
>>>> total time :16
>>>> 2008-08-20 16:00:48 [NOTICE] test.js:1 console_log() Your new session
>>>> bill duration :false
>>>> 2008-08-20 16:00:48 [NOTICE] test.js:1 console_log() Your new session
>>>> progress time  :false
>>>> 2008-08-20 16:00:48 [NOTICE] test.js:1 console_log() Your new session
>>>> total time  :false
>>>>
>>>>
>>>>
>>>> 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.
>>>>
>>>> 2008-08-20 16:11:47 [NOTICE] test.js:1 console_log() Your old session
>>>> bill duration:19
>>>> 2008-08-20 16:11:47 [NOTICE] test.js:1 console_log() Your old session
>>>> progress time :0
>>>> 2008-08-20 16:11:47 [NOTICE] test.js:1 console_log() Your old session
>>>> total time :19
>>>> 2008-08-20 16:11:47 [NOTICE] test.js:1 console_log() Your new session
>>>> bill duration :false
>>>> 2008-08-20 16:11:47 [NOTICE] test.js:1 console_log() Your new session
>>>> progress time  :false
>>>> 2008-08-20 16:11:47 [NOTICE] test.js:1 console_log() Your new session
>>>> total time  :false
>>>>
>>>>
>>>>
>>>> can anyone please look into the issue.
>>>>
>>>>
>>>>
>>>> On Mon, Aug 18, 2008 at 9:14 PM, Anthony Minessale <
>>>> anthony.minessale at gmail.com> wrote:
>>>>
>>>>> 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
>>>>> http://jira.freeswitch.org
>>>>>
>>>>>
>>>>> On Sun, Aug 17, 2008 at 2:42 PM, Anand Kumar <kanand81 at gmail.com>wrote:
>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> Please help me,
>>>>>>
>>>>>> I am trying to find out call answer time duration. i have tested in 2
>>>>>> way..
>>>>>>
>>>>>> 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 ..
>>>>>>
>>>>>> var callduration=session.getVariable("duration");
>>>>>>
>>>>>> console_log() Your call Answer time :4
>>>>>>
>>>>>> 2. when i disconnect the call from pstn site that time i am not get
>>>>>> answer time duration...
>>>>>>
>>>>>> Your call Answer time :false
>>>>>> same code is return ""*false*" why ?
>>>>>>
>>>>>> please help me..
>>>>>>
>>>>>> Thanks
>>>>>> Anand Dayal
>>>>>>
>>>>>> _______________________________________________
>>>>>> Freeswitch-users mailing list
>>>>>> Freeswitch-users at 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 at hotmail.com<MSN%3Aanthony_minessale at hotmail.com>
>>>>> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
>>>>> IRC: irc.freenode.net #freeswitch
>>>>>
>>>>> FreeSWITCH Developer Conference
>>>>> sip:888 at conference.freeswitch.org<sip%3A888 at conference.freeswitch.org>
>>>>> iax:guest at conference.freeswitch.org/888
>>>>> googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
>>>>> pstn:213-799-1400
>>>>>
>>>>> _______________________________________________
>>>>> Freeswitch-users mailing list
>>>>> Freeswitch-users at lists.freeswitch.org
>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>> UNSUBSCRIBE:
>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>> http://www.freeswitch.org
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Thanks and Regards
>>>>
>>>> Vidhya Sagar Dixit
>>>>
>>>> _______________________________________________
>>>> Freeswitch-users mailing list
>>>> Freeswitch-users at 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 at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
>>> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
>>> IRC: irc.freenode.net #freeswitch
>>>
>>> FreeSWITCH Developer Conference
>>> sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
>>> iax:guest at conference.freeswitch.org/888
>>> googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
>>> pstn:213-799-1400
>>>
>>> _______________________________________________
>>> Freeswitch-users mailing list
>>> Freeswitch-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>
>>>
>>
>>
>> --
>> Thanks and Regards
>>
>> Vidhya Sagar Dixit
>>
>> _______________________________________________
>> Freeswitch-users mailing list
>> Freeswitch-users at 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 at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
> IRC: irc.freenode.net #freeswitch
>
> FreeSWITCH Developer Conference
> sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
> iax:guest at conference.freeswitch.org/888
> googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
> pstn:213-799-1400
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>


-- 
Thanks and Regards

Vidhya Sagar Dixit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080821/0a53eb81/attachment-0002.html 


More information about the FreeSWITCH-users mailing list