<div dir="ltr"><pre><i>Hi Will,<br>Thanks for sharing very useful information.<br><br></i></pre><pre><i>//Gafar<br></i></pre></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 16, 2015 at 12:48 PM, Will Ferrer <span dir="ltr"><<a href="mailto:will.ferrer@switchsoft.com" target="_blank">will.ferrer@switchsoft.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Daniel<br><br>Thanks so much for the response and help as always.<br><br>I tried changing my config to use loose route.<br><br>It looks like this now:<span class=""><br><br>loadmodule "dialog.so"<br><br>...<br>modparam("dialog", "db_url", DBURL)<br>modparam("dialog", "db_mode", 1)<br>modparam("dialog", "dlg_flag", 4)<br>modparam("dialog", "dlg_match_mode", 1)<br><br>...<br><br>request_route {<br>        if (is_method("INVITE") && (! has_totag() ) ) {<br>dlg_manage();<br></span>xlog ("L_INFO", "request_route DIALOG TEST: Dialog initiated");<br>        }<br>if (is_method("BYE")) {<br>#dlg_manage();<br>loose_route();<span class=""><br>$var(elapsed) = ( $TV(s) - $dlg(start_ts) );<br>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");<br>        }<br>....<br><br></span>I now get:<br><br>INFO: <script>: request_route DIALOG TEST: Dialog initiate<br>INFO: <script>: request_route DIALOG TEST: Completed <a href="mailto:sip%3Awillf1976Test@develop-sbc.switchsoft.com" target="_blank">sip:willf1976Test@develop-sbc.switchsoft.com</a> to <a href="mailto:sip%3A%2B18054515526@develop-sbc.switchsoft.com" target="_blank">sip:+18054515526@develop-sbc.switchsoft.com</a>, elapsed: 1421386898, now seconds: 1421386898, dlg start time: 0, DLG_lifetime: 1421386898<br><br><br>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.<br><br>I also tried using the dlg_manage() instead of the loose route in my test and got the same result.<br><br>Any idea what might be missing?<br><br>Thanks again for your help.<br><br>All the best.<span class="HOEnZb"><font color="#888888"><br><br>Will</font></span><div><div class="h5"><br><br><br><br><br><br>On Thu, Jan 15, 2015 at 5:53 AM, Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>> wrote:<br>><br>> Hello,<br>><br>> try to do dlg_manage() or lose_route() before accessing the dialog variables.<br>><br>> Cheers,<br>> Daniel<br>><br>><br>> On 15/01/15 08:25, Will Ferrer wrote:<br>><br>> An update on this.<br>><br>> I tried setting my dialog module to the use the db. No db entry is ever made.<br>><br>> My config looks like this now:<br>><br>> loadmodule "dialog.so"<br>><br>> ...<br>> modparam("dialog", "db_url", DBURL)<br>> modparam("dialog", "db_mode", 1)<br>> modparam("dialog", "dlg_flag", 4)<br>> modparam("dialog", "dlg_match_mode", 1)<br>><br>> ...<br>><br>> request_route {<br>>         if (is_method("INVITE") && (! has_totag() ) ) {<br>> dlg_manage();<br>>         }<br>> if (is_method("BYE")) {<br>> $var(elapsed) = ( $TV(s) - $dlg(start_ts) );<br>> 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");<br>>         }<br>> ....<br>><br>><br>> I hope this message finds every one well.<br>><br>> All the best.<br>><br>> Will<br>><br>> On Thu, Jan 15, 2015 at 12:03 AM, Will Ferrer <<a href="mailto:will.ferrer@switchsoft.com" target="_blank">will.ferrer@switchsoft.com</a>> wrote:<br>>><br>>> Hi All<br>>><br>>> I am in need of being able to see what the duration of the call was at the time of hang out.<br>>><br>>> I tried turning on the dialog module, but the result is that the values I need are either null or always show as zero.<br>>><br>>> I tried to follow the suggestions in the thread about this here:<br>>><br>>> <a href="http://lists.sip-router.org/pipermail/sr-users/2010-October/065889.html" target="_blank">http://lists.sip-router.org/pipermail/sr-users/2010-October/065889.html</a><br>>><br>>> In the end my config looks like this:<br>>><br>>> loadmodule "dialog.so"<br>>><br>>> ...<br>>><br>>> modparam("dialog", "dlg_flag", 4)<br>>> modparam("dialog", "dlg_match_mode", 1)<br>>><br>>> ...<br>>><br>>> request_route {<br>>>         if (is_method("INVITE") && (! has_totag() ) ) {<br>>> dlg_manage();<br>>>         }<br>>> if (is_method("BYE")) {<br>>> $var(elapsed) = ( $TV(s) - $dlg(start_ts) );<br>>> 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");<br>>>         }<br>>> ....<br>>><br>>><br>>><br>>> Note that I put at the top of the request route just for testing purposes<br>>><br>>> The result I get in the log is this:<br>>><br>>> INFO: <script>: request_route DIALOG TEST: Completed <a href="mailto:sip%3Awillf1976Test@develop-sbc.switchsoft.com" target="_blank">sip:willf1976Test@develop-sbc.switchsoft.com</a> to <a href="mailto:sip%3A%2B18054515526@develop-sbc.switchsoft.com" target="_blank">sip:+18054515526@develop-sbc.switchsoft.com</a>, elapsed: 1421305210, now seconds: 1421305210, dlg start time: 0, DLG_lifetime: <null><br>>><br>>><br>>> I was wondering if any one could point out to me what I have set up wrong.<br>>><br>>> Thanks in advance<br>>><br>>> All the best.<br>>><br>>> Will Ferrer<br>>> Switchsoft<br>>><br>><br>><br>><br>> _______________________________________________<br>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>> <a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>><br>><br>> -- <br>> Daniel-Constantin Mierla<br>> <a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a><br>><br>><br>> _______________________________________________<br>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>> <a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>><br></div></div></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>