<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    try to do dlg_manage() or lose_route() before accessing the dialog
    variables.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 15/01/15 08:25, Will Ferrer wrote:<br>
    </div>
    <blockquote
cite="mid:CA+pifNRrLJ-=s+5RuHeiEDWKrJGGkQnNgrD6L6uH1c5W8hyGkQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">An update on this.
        <div><br>
        </div>
        <div>I tried setting my dialog module to the use the db. No db
          entry is ever made.</div>
        <div><br>
        </div>
        <div>My config looks like this now:</div>
        <div><br>
        </div>
        <div>
          <div style="font-size:12.6666669845581px">loadmodule
            "dialog.so"<br>
          </div>
          <div style="font-size:12.6666669845581px"><br>
          </div>
          <div style="font-size:12.6666669845581px">...</div>
          <div style="font-size:12.6666669845581px">
            <div style="font-size:small">modparam("dialog", "db_url",
              DBURL)</div>
            <div style="font-size:small">modparam("dialog", "db_mode",
              1)</div>
          </div>
          <div style="font-size:12.6666669845581px">
            <div>modparam("dialog", "dlg_flag", 4)</div>
            <div>modparam("dialog", "dlg_match_mode", 1)</div>
          </div>
          <div style="font-size:12.6666669845581px"><br>
          </div>
          <div style="font-size:12.6666669845581px">...<br>
          </div>
          <div style="font-size:12.6666669845581px"><br>
          </div>
          <div style="font-size:12.6666669845581px">request_route {<br>
          </div>
          <div style="font-size:12.6666669845581px">
            <div>        if (is_method("INVITE") && (!
              has_totag() ) ) {</div>
            <div><span style="white-space:pre-wrap"> </span>dlg_manage();</div>
            <div>        }</div>
            <div><span style="white-space:pre-wrap"> </span>if
              (is_method("BYE")) {</div>
            <div><span style="white-space:pre-wrap"> </span>$var(elapsed)
              = ( $TV(s) - $dlg(start_ts) );</div>
            <div><span style="white-space:pre-wrap"> </span>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");</div>
            <div>        }</div>
          </div>
          <div style="font-size:12.6666669845581px">....</div>
        </div>
        <div style="font-size:12.6666669845581px"><br>
        </div>
        <div><br>
        </div>
        <div>I hope this message finds every one well.</div>
        <div><br>
        </div>
        <div>All the best.</div>
        <div><br>
        </div>
        <div>Will</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Thu, Jan 15, 2015 at 12:03 AM, Will
          Ferrer <span dir="ltr"><<a moz-do-not-send="true"
              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 All
              <div><br>
              </div>
              <div>I am in need of being able to see what the duration
                of the call was at the time of hang out.</div>
              <div><br>
              </div>
              <div>I tried turning on the dialog module, but the result
                is that the values I need are either null or always show
                as zero.</div>
              <div><br>
              </div>
              <div>I tried to follow the suggestions in the thread about
                this here:</div>
              <div><br>
              </div>
              <div><a moz-do-not-send="true"
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>
              </div>
              <div><br>
              </div>
              <div>In the end my config looks like this:</div>
              <div><br>
              </div>
              <div>loadmodule "dialog.so"<br>
              </div>
              <div><br>
              </div>
              <div>...</div>
              <div><br>
              </div>
              <div>
                <div>modparam("dialog", "dlg_flag", 4)</div>
                <div>modparam("dialog", "dlg_match_mode", 1)</div>
              </div>
              <div><br>
              </div>
              <div>...<br>
              </div>
              <div><br>
              </div>
              <div>request_route {<br>
              </div>
              <div>
                <div>        if (is_method("INVITE") && (!
                  has_totag() ) ) {</div>
                <div><span style="white-space:pre-wrap"> </span>dlg_manage();</div>
                <div>        }</div>
                <div><span style="white-space:pre-wrap"> </span>if
                  (is_method("BYE")) {</div>
                <div><span style="white-space:pre-wrap"> </span>$var(elapsed)
                  = ( $TV(s) - $dlg(start_ts) );</div>
                <div><span style="white-space:pre-wrap"> </span>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");</div>
                <div>        }</div>
              </div>
              <div>....</div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>Note that I put at the top of the request route just
                for testing purposes</div>
              <div><br>
              </div>
              <div>The result I get in the log is this:</div>
              <div><br>
              </div>
              <div>
                <div>INFO: <script>: request_route DIALOG TEST:
                  Completed <a moz-do-not-send="true"
                    href="mailto:sip%3Awillf1976Test@develop-sbc.switchsoft.com"
                    target="_blank">sip:willf1976Test@develop-sbc.switchsoft.com</a>
                  to <a moz-do-not-send="true"
                    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></div>
              </div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>I was wondering if any one could point out to me what
                I have set up wrong.</div>
              <div><br>
              </div>
              <div>Thanks in advance</div>
              <div><br>
              </div>
              <div>All the best.</div>
              <span class="HOEnZb"><font color="#888888">
                  <div><br>
                  </div>
                  <div>Will Ferrer</div>
                  <div>Switchsoft</div>
                  <div><br>
                  </div>
                </font></span></div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
  </body>
</html>