<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <tt>I was asking you to call do_accounting() in failure route, for
      each leg.<br>
      <br>
      Best regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 01/16/2017 12:02 PM, Khalil
      Khamlichi wrote:<br>
    </div>
    <blockquote
cite="mid:CAEK98Wak_32d60F3f2EB+HdtRQAn06iy78YOGSV0ZLCok9CHZw@mail.gmail.com"
      type="cite">
      <div dir="ltr">sorry mistype, I am calling do_accounting() twice.</div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Jan 16, 2017 at 9:47 AM, Khalil
          Khamlichi <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:khamlichi.khalil@gmail.com" target="_blank">khamlichi.khalil@gmail.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">thanks for your much appreciated help, 
              <div>I am calling do_routing twice.</div>
              <div><br>
                <div>Here is my actual opensips.cfg : </div>
                <div><br>
                </div>
                <div>route {</div>
                <div>
                  <div><span style="font-family:monospace">...</span></div>
                  <div><span style="font-family:monospace">...</span></div>
                  <div><span style="font-family:monospace"><br>
                    </span></div>
                  <div><span style="font-family:monospace">...</span></div>
                  <div><span style="font-family:monospace">...</span></div>
                </div>
                <div><span style="font-family:monospace"><span
                      style="color:rgb(0,0,0)">        if (has_totag())
                      {
                    </span><br>
                                   <span
                      style="font-weight:bold;color:rgb(84,255,255)">#
                      sequential request withing a dialog should</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                                   <span
                      style="font-weight:bold;color:rgb(84,255,255)">#
                      take the path determined by record-routing</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                                   if (loose_route()) {
                    <br>
                    <br>
                                           <span
                      style="font-weight:bold;color:rgb(84,255,255)">#
                      validate the sequential request against dialog</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                                           if ( $DLG_status!=<span
                      style="font-weight:bold;color:rgb(255,84,255)">NULL
                      && !validate_dialog() ) {</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                                                  <wbr> xlog("In-Dialog
                    $rm from $si (callid=<span
                      style="font-weight:bold;color:rgb(255,84,255)">$ci)
                      is not valid according to dialog\n")</span><span
                      style="font-weight:bold;color:rgb(84,255,255)">;</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                                           }
                    <br>
                    <br>
                                           if (is_method("BYE")) {
                    <br>
                                                  <wbr> <span
                      style="font-weight:bold;color:rgb(84,255,255)">#
                      do accounting even if the transaction fails</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                                                  <wbr> do_accounting("db|log","<wbr>failed|missed",)<span
                      style="font-weight:bold;color:rgb(84,255,255)">;</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                                           } else if
                    (is_method("INVITE")) {
                    <br>
                                                  <wbr> <span
                      style="font-weight:bold;color:rgb(84,255,255)">#
                      even if in most of the cases is useless, do RR for</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                                                  <wbr> <span
                      style="font-weight:bold;color:rgb(84,255,255)">#
                      re-INVITEs alos, as some buggy clients do change
                      route set</span><span style="color:rgb(0,0,0)">
                    </span><br>
                                                  <wbr> <span
                      style="font-weight:bold;color:rgb(84,255,255)">#
                      during the dialog.</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                                                  <wbr> record_route()<span
                      style="font-weight:bold;color:rgb(84,255,255)">;</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                                           }<br>
                    ...</span></div>
                <div><span style="font-family:monospace">...</span></div>
                <div><span style="font-family:monospace"><br>
                  </span></div>
                <div><span style="font-family:monospace">...</span></div>
                <div><span style="font-family:monospace">...</span></div>
                <div><span style="font-family:monospace"><span
                      style="color:rgb(0,0,0)">        $acc_extra(gwid)=</span><span
                      style="font-weight:bold;color:rgb(255,84,255)">$avp(gw_id)</span><span
                      style="font-weight:bold;color:rgb(84,255,255)">;</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                    <br>
                           t_on_failure("GW_<wbr>FAILOVER")<span
                      style="font-weight:bold;color:rgb(84,255,255)">;</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                    <br>
                           do_accounting("db|log",<wbr>"cdr|missed",)<span
                      style="font-weight:bold;color:rgb(84,255,255)">;</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                    <span style="font-weight:bold;color:rgb(84,255,255)">#NAT
                    </span><span style="color:rgb(0,0,0)"> </span><br>
                           if (isbflagset(NAT)) setflag(NAT)<span
                      style="font-weight:bold;color:rgb(84,255,255)">;</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                    <span style="font-weight:bold;color:rgb(84,255,255)">#NAT</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                           route(RELAY)<span
                      style="font-weight:bold;color:rgb(84,255,255)">;</span><span
                      style="color:rgb(0,0,0)">
                    </span><br>
                    }<br>
                    <br>
                  </span></div>
                <div># END OF MAIN ROUTE</div>
                <div>
                  <div class="h5">
                    <div><br>
                    </div>
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote">On Mon, Jan 16, 2017 at
                        8:51 AM, Răzvan Crainea <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:razvan@opensips.org"
                            target="_blank">razvan@opensips.org</a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote"
                          style="margin:0px 0px 0px
                          0.8ex;border-left:1px solid
                          rgb(204,204,204);padding-left:1ex">
                          <div bgcolor="#FFFFFF"> <tt>Hi, Khalil!<br>
                              <br>
                              Did you try to call the do_accounting()
                              function for each leg going to the next
                              gateway?<br>
                              <br>
                              Best regards,<br>
                            </tt>
                            <pre class="m_5885067735228918325gmail-m_4018356164897762301m_1440895108582141234moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a moz-do-not-send="true" class="m_5885067735228918325gmail-m_4018356164897762301m_1440895108582141234moz-txt-link-abbreviated" href="http://www.opensips-solutions.com" target="_blank">www.opensips-solutions.com</a></pre>
                            <div>
                              <div
                                class="m_5885067735228918325gmail-m_4018356164897762301h5">
                                <div
class="m_5885067735228918325gmail-m_4018356164897762301m_1440895108582141234moz-cite-prefix">On
                                  01/15/2017 12:24 AM, Khalil Khamlichi
                                  wrote:<br>
                                </div>
                              </div>
                            </div>
                            <blockquote type="cite">
                              <div>
                                <div
                                  class="m_5885067735228918325gmail-m_4018356164897762301h5">
                                  <div dir="ltr">Hi,
                                    <div>I am testing opensips 2.2, 2.3
                                      I have tried to configure acc
                                      module to save to db failed calls
                                      on drouting configuration, I have
                                      found that it does save only the
                                      first failed call (that is the
                                      first gateway) it does not save to
                                      database any other failures on
                                      second and third gateways that are
                                      tried for the call.</div>
                                    <div>is this the expected behavioure
                                      ?</div>
                                    <div>Thanks for your help.</div>
                                    <div><br>
                                    </div>
                                    <div>regards,</div>
                                    <div>kh</div>
                                  </div>
                                  <br>
                                  <fieldset
class="m_5885067735228918325gmail-m_4018356164897762301m_1440895108582141234mimeAttachmentHeader"></fieldset>
                                  <br>
                                </div>
                              </div>
                              <pre>______________________________<wbr>_________________
Users mailing list
<a moz-do-not-send="true" class="m_5885067735228918325gmail-m_4018356164897762301m_1440895108582141234moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a moz-do-not-send="true" class="m_5885067735228918325gmail-m_4018356164897762301m_1440895108582141234moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    

  </div>


______________________________<wbr>_________________

Users mailing list

<a moz-do-not-send="true" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>

<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>


</blockquote></div>
</div></div></div></div></div>
</blockquote></div>
</div>


<fieldset class="mimeAttachmentHeader"></fieldset>
<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>
</body></html>