[SR-Users] Trouble getting start time / call duration from dialog module

Will Ferrer will.ferrer at switchsoft.com
Wed Jan 28 05:56:10 CET 2015


Hi.

I wanted to update every one on this issue.

I found that while the dlg start time: $dlg(start_ts), DLG_lifetime:
$DLG_lifetime aren't populating I can still use the following to record the
start time of the call as a dialog variable:

$dlg_var(TVs) = $TV(s);

A strange problem with this however is that when I compare that start time
to the time when the bye occurs I see 10 extra seconds that never actually
happened.

In other words this:

$avp(elapsed) = ( $TV(s) -  $dlg_var(TVs));

sets my $avp(elapsed) to be 10 seconds longer than the call actually was.

I fixed it simply enough like so:

$var(dialog_duration_fix) = DIALOG_DURATION_FIX;
$avp(elapsed) = ( ($TV(s) - $var(dialog_duration_fix)) - $dlg_var(TVs));

I have worked around these issues for my own purposes but still seems like
there are some odd bugs here.

I hope this message finds every well.

All the best.

Will Ferrer

Switchsoft



On Thu, Jan 22, 2015 at 3:56 PM, Will Ferrer <will.ferrer at switchsoft.com>
wrote:

> Hi Abdul
>
> I just wanted to check int. Did you have any ideas of things we could try
> or more information we could get you to assistance?
>
> Thanks again for your help, the input we have gotten from you and Daniel
> has always been invaluable.
>
> All the best.
>
> Will Ferrer
> Switchsoft
>
> On Fri, Jan 16, 2015 at 7:42 PM, Will Ferrer <will.ferrer at switchsoft.com>
> wrote:
>
>> Hi Abdul
>>
>> That's great. I look forward to the advice.
>>
>> Thanks again for the assistance and I hope you have a great weekend.
>>
>> All the best.
>>
>> Will
>>
>> On Fri, Jan 16, 2015 at 6:44 PM, Abdul Gafar <abdul.gafar.tim at gmail.com>
>> wrote:
>>
>>> Hi Wiil
>>>
>>> I will be try help you
>>>
>>> //Gafar
>>>
>>> On Sat, Jan 17, 2015 at 4:43 AM, Will Ferrer <will.ferrer at switchsoft.com
>>> > wrote:
>>>
>>>> Hi Adbul
>>>>
>>>> Thanks, I am glad the information is useful.
>>>>
>>>> Do you have any thoughts on what I could I try next to get that $dlg(start_ts)
>>>> value populated in the dialog as it is still not working about adding the
>>>> loose_route() function?
>>>>
>>>> I also tried looking at the logs for any reference to dialog -- tail -f
>>>> /var/log/syslog | grep dialog
>>>>
>>>> The only thing that came up with rtpengine talking about dialogs so no
>>>> clues there.
>>>>
>>>> Thanks to you guys for the help.
>>>>
>>>> All the best.
>>>>
>>>> Will
>>>>
>>>> On Fri, Jan 16, 2015 at 1:25 AM, Abdul Gafar <abdul.gafar.tim at gmail.com
>>>> > wrote:
>>>>
>>>>>
>>>>>
>>>>>
>>>>> *Hi Will,Thanks for sharing very useful information.*
>>>>>
>>>>>
>>>>> *//Gafar*
>>>>>
>>>>>
>>>>> On Fri, Jan 16, 2015 at 12:48 PM, Will Ferrer <
>>>>> will.ferrer at switchsoft.com> wrote:
>>>>>
>>>>>> Hi Daniel
>>>>>>
>>>>>> Thanks so much for the response and help as always.
>>>>>>
>>>>>> I tried changing my config to use loose route.
>>>>>>
>>>>>> It looks like this now:
>>>>>>
>>>>>> loadmodule "dialog.so"
>>>>>>
>>>>>> ...
>>>>>> modparam("dialog", "db_url", DBURL)
>>>>>> modparam("dialog", "db_mode", 1)
>>>>>> modparam("dialog", "dlg_flag", 4)
>>>>>> modparam("dialog", "dlg_match_mode", 1)
>>>>>>
>>>>>> ...
>>>>>>
>>>>>> request_route {
>>>>>>         if (is_method("INVITE") && (! has_totag() ) ) {
>>>>>> dlg_manage();
>>>>>> xlog ("L_INFO", "request_route DIALOG TEST: Dialog initiated");
>>>>>>         }
>>>>>> if (is_method("BYE")) {
>>>>>> #dlg_manage();
>>>>>> loose_route();
>>>>>> $var(elapsed) = ( $TV(s) - $dlg(start_ts) );
>>>>>> xlog ("L_INFO", "request_route DIALOG TEST: Completed $dlg(from_uri)
>>>>>> to $dlg(to_uri), elapsed: $var(elapsed), now seconds: $TV(s), dlg start
>>>>>> time: $dlg(start_ts), DLG_lifetime: $DLG_lifetime");
>>>>>>         }
>>>>>> ....
>>>>>>
>>>>>> I now get:
>>>>>>
>>>>>> INFO: <script>: request_route DIALOG TEST: Dialog initiate
>>>>>> INFO: <script>: request_route DIALOG TEST: Completed
>>>>>> sip:willf1976Test at develop-sbc.switchsoft.com to
>>>>>> sip:+18054515526 at develop-sbc.switchsoft.com, elapsed: 1421386898,
>>>>>> now seconds: 1421386898, dlg start time: 0, DLG_lifetime: 1421386898
>>>>>>
>>>>>>
>>>>>> So the $DLG_lifetime is being populated, but it has all the seconds
>>>>>> since epoch time. You can also see that the $dlg(start_ts) is 0.
>>>>>>
>>>>>> I also tried using the dlg_manage() instead of the loose route in my
>>>>>> test and got the same result.
>>>>>>
>>>>>> Any idea what might be missing?
>>>>>>
>>>>>> Thanks again for your help.
>>>>>>
>>>>>> All the best.
>>>>>>
>>>>>> Will
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Jan 15, 2015 at 5:53 AM, Daniel-Constantin Mierla <
>>>>>> miconda at gmail.com> wrote:
>>>>>> >
>>>>>> > Hello,
>>>>>> >
>>>>>> > try to do dlg_manage() or lose_route() before accessing the dialog
>>>>>> variables.
>>>>>> >
>>>>>> > Cheers,
>>>>>> > Daniel
>>>>>> >
>>>>>> >
>>>>>> > On 15/01/15 08:25, Will Ferrer wrote:
>>>>>> >
>>>>>> > An update on this.
>>>>>> >
>>>>>> > I tried setting my dialog module to the use the db. No db entry is
>>>>>> ever made.
>>>>>> >
>>>>>> > My config looks like this now:
>>>>>> >
>>>>>> > loadmodule "dialog.so"
>>>>>> >
>>>>>> > ...
>>>>>> > modparam("dialog", "db_url", DBURL)
>>>>>> > modparam("dialog", "db_mode", 1)
>>>>>> > modparam("dialog", "dlg_flag", 4)
>>>>>> > modparam("dialog", "dlg_match_mode", 1)
>>>>>> >
>>>>>> > ...
>>>>>> >
>>>>>> > request_route {
>>>>>> >         if (is_method("INVITE") && (! has_totag() ) ) {
>>>>>> > dlg_manage();
>>>>>> >         }
>>>>>> > if (is_method("BYE")) {
>>>>>> > $var(elapsed) = ( $TV(s) - $dlg(start_ts) );
>>>>>> > xlog ("L_INFO", "request_route DIALOG TEST: Completed
>>>>>> $dlg(from_uri) to $dlg(to_uri), elapsed: $var(elapsed), now seconds:
>>>>>> $TV(s), dlg start time: $dlg(start_ts), DLG_lifetime: $DLG_lifetime");
>>>>>> >         }
>>>>>> > ....
>>>>>> >
>>>>>> >
>>>>>> > I hope this message finds every one well.
>>>>>> >
>>>>>> > All the best.
>>>>>> >
>>>>>> > Will
>>>>>> >
>>>>>> > On Thu, Jan 15, 2015 at 12:03 AM, Will Ferrer <
>>>>>> will.ferrer at switchsoft.com> wrote:
>>>>>> >>
>>>>>> >> Hi All
>>>>>> >>
>>>>>> >> I am in need of being able to see what the duration of the call
>>>>>> was at the time of hang out.
>>>>>> >>
>>>>>> >> I tried turning on the dialog module, but the result is that the
>>>>>> values I need are either null or always show as zero.
>>>>>> >>
>>>>>> >> I tried to follow the suggestions in the thread about this here:
>>>>>> >>
>>>>>> >>
>>>>>> http://lists.sip-router.org/pipermail/sr-users/2010-October/065889.html
>>>>>> >>
>>>>>> >> In the end my config looks like this:
>>>>>> >>
>>>>>> >> loadmodule "dialog.so"
>>>>>> >>
>>>>>> >> ...
>>>>>> >>
>>>>>> >> modparam("dialog", "dlg_flag", 4)
>>>>>> >> modparam("dialog", "dlg_match_mode", 1)
>>>>>> >>
>>>>>> >> ...
>>>>>> >>
>>>>>> >> request_route {
>>>>>> >>         if (is_method("INVITE") && (! has_totag() ) ) {
>>>>>> >> dlg_manage();
>>>>>> >>         }
>>>>>> >> if (is_method("BYE")) {
>>>>>> >> $var(elapsed) = ( $TV(s) - $dlg(start_ts) );
>>>>>> >> xlog ("L_INFO", "request_route DIALOG TEST: Completed
>>>>>> $dlg(from_uri) to $dlg(to_uri), elapsed: $var(elapsed), now seconds:
>>>>>> $TV(s), dlg start time: $dlg(start_ts), DLG_lifetime: $DLG_lifetime");
>>>>>> >>         }
>>>>>> >> ....
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> Note that I put at the top of the request route just for testing
>>>>>> purposes
>>>>>> >>
>>>>>> >> The result I get in the log is this:
>>>>>> >>
>>>>>> >> INFO: <script>: request_route DIALOG TEST: Completed
>>>>>> sip:willf1976Test at develop-sbc.switchsoft.com to
>>>>>> sip:+18054515526 at develop-sbc.switchsoft.com, elapsed: 1421305210,
>>>>>> now seconds: 1421305210, dlg start time: 0, DLG_lifetime: <null>
>>>>>> >>
>>>>>> >>
>>>>>> >> I was wondering if any one could point out to me what I have set
>>>>>> up wrong.
>>>>>> >>
>>>>>> >> Thanks in advance
>>>>>> >>
>>>>>> >> All the best.
>>>>>> >>
>>>>>> >> Will Ferrer
>>>>>> >> Switchsoft
>>>>>> >>
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > _______________________________________________
>>>>>> > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
>>>>>> list
>>>>>> > sr-users at lists.sip-router.org
>>>>>> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>>>> >
>>>>>> >
>>>>>> > --
>>>>>> > Daniel-Constantin Mierla
>>>>>> > http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
>>>>>> >
>>>>>> >
>>>>>> > _______________________________________________
>>>>>> > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
>>>>>> list
>>>>>> > sr-users at lists.sip-router.org
>>>>>> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>>>> >
>>>>>>
>>>>>> _______________________________________________
>>>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
>>>>>> list
>>>>>> sr-users at lists.sip-router.org
>>>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>>>> sr-users at lists.sip-router.org
>>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>>> sr-users at lists.sip-router.org
>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>>
>>>>
>>>
>>> _______________________________________________
>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>> sr-users at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150127/b77159ae/attachment.html>


More information about the sr-users mailing list