<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix"><tt>Hi Jayesh,</tt><tt><br>
      </tt><tt><br>
      </tt><tt>have you tried to do directly:</tt><tt><br>
      </tt><tt><br>
      </tt><tt>modparam("acc", "db_extra_bye",
        "sip_dlg_end_reason=$DLG_end_reason")</tt><tt><br>
      </tt><tt><br>
      </tt><tt>Regards,</tt><br>
      <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
      On 23.08.2014 14:25, Jayesh Nambiar wrote:<br>
    </div>
    <blockquote
cite="mid:CANAYozuuaHNxafhQoRins-oO423ODYGON3SdpvRrirCxDj5gLg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>Hello,<br>
          </div>
          How do you insert the $DLG_end_reason in a particular column
          in acc table?? I basically did set a db_extra_bye modparam as
          follows:<br>
          modparam("acc", "db_extra_bye",
          "sip_dlg_end_reason=$avp(dlg_end_reason)")<br>
          <br>
        </div>
        <div>The problem is; when I do this before the loose route:<br>
          <br>
        </div>
        <div>if(is_method("BYE")) {<br>
        </div>
        <div>   $avp(dlg_end_reason) = $DLG_end_reason<br>
        </div>
        <div>   xlog("L_INFO", "Dialog End Reason is
          $avp(dlg_end_reason)");<br>
        </div>
        <div>}<br>
          <br>
        </div>
        <div>The $DLG_end_reason returns NULL, since the dialog is not
          ended yet. And if I do the same after loose route, the xlog
          shows up proper dialog end reason but the same is not inserted
          into the DB since once the transaction enters into loose route
          and probably it cannot set the values for cdr.<br>
        </div>
        <div>So I am in kind of a deadlock here. Is there a solution to
          this??<br>
          <br>
          Thanks in advance,<br>
          <br>
        </div>
        <div>--- Jayesh<br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>