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

Daniel-Constantin Mierla miconda at gmail.com
Thu Jan 15 13:53:16 CET 2015


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 <mailto: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
>     <mailto:sip%3Awillf1976Test at develop-sbc.switchsoft.com> to
>     sip:+18054515526 at develop-sbc.switchsoft.com
>     <mailto:sip%3A%2B18054515526 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150115/a535cc82/attachment.html>


More information about the sr-users mailing list