<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><tt>Hi Wilmar,<br>
        <br>
        yes, that is one of ways to do it.<br>
        <br>
        Regards,<br>
      </tt>
      <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 05.02.2014 19:50, Wilmar Campos wrote:<br>
    </div>
    <blockquote
cite="mid:CAH_cxxF7oLFs34zktGutpD3GMyVzbO27iq6FZ-8JkYTmeKEChw@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Bogdan,
        <div><br>
        </div>
        <div>I Include in the Sequential check:</div>
        <div>
          <div>&nbsp; &nbsp; if (has_totag() &nbsp;&amp;&amp;
            is_method("INVITE|ACK|BYE|UPDATE"))</div>
          <div>&nbsp; &nbsp; {</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; t_on_failure("1");</div>
        </div>
        <div><br>
        </div>
        <div>Then on:</div>
        <div>
          <div>failure_route[1]</div>
          <div>{</div>
          <div>xlog("L_ERROR", "$ci|log|FAILURE ROUTE: rU $rU | tu $tu |
            fu $fu | rd $rd | Code $T_reply_code ");</div>
          <div><br>
          </div>
          <div>I logged succesfully when 481.</div>
          <div><br>
          </div>
          <div>Is this the right way? &nbsp;Including the t_on_failure in the
            sequential check in the script? &nbsp;</div>
        </div>
        <div><br>
        </div>
        <div>Thanks,</div>
      </div>
      <div class="gmail_extra">
        <br>
        <br>
        <div class="gmail_quote">On Wed, Feb 5, 2014 at 12:31 PM,
          Bogdan-Andrei Iancu <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:bogdan@opensips.org"
              target="_blank">bogdan@opensips.org</a>&gt;</span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div><tt>Hello Wilmar,<br>
                  <br>
                  Are you sure you set the the failure route before
                  routing the BYE request out ( via t_on_failure() - <a
                    moz-do-not-send="true"
                    href="http://www.opensips.org/html/docs/modules/1.10.x/tm.html#id295064"
                    target="_blank">http://www.opensips.org/html/docs/modules/1.10.x/tm.html#id295064</a>
                  ) ?<br>
                  <br>
                  BTW, what are you trying to achieve here ? simply
                  accounting the BYE ?<br>
                  <br>
                  Regards,<br>
                </tt>
                <div class="im">
                  <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                </div>
                <div>
                  <div class="h5"> On 05.02.2014 16:43, Wilmar Campos
                    wrote:<br>
                  </div>
                </div>
              </div>
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <div dir="ltr">Hi Bogdam,
                      <div><br>
                      </div>
                      <div>Thanks for your feedback on this.</div>
                      <div><br>
                      </div>
                      <div>Let me explain a little better the scenario.</div>
                      <div><br>
                      </div>
                      <div>Customer-&gt;Opensips</div>
                      <div>Opensips-&gt;Provider</div>
                      <div><br>
                      </div>
                      <div>After the INVITE, the call get connected ok.</div>
                      <div>After a couple of seconds/minutes/hours,
                        provider have an issue and equipment on provider
                        side gets restarted.</div>
                      <div>Customer notice call was now without audio,
                        hangs UP.</div>
                      <div>BYE is generated from customer to Opensips,
                        Opensips rely the message to provider, provider
                        responds with 481.</div>
                      <div><br>
                      </div>
                      <div>
                        <div>&nbsp;Opensips -&gt; Provider SIP Request: BYE
                          sip:<a moz-do-not-send="true"
                            href="tel:14102248770" value="+14102248770"
                            target="_blank">14102248770</a>@Provider:5061</div>
                        <div>&nbsp;Provider -&gt; Opensips SIP Status: 481
                          Call leg/transaction does not exist</div>
                      </div>
                      <div><br>
                      </div>
                      <div>I have a&nbsp;failure_route[1], but its never
                        being called on this scenario.</div>
                      <div><br>
                      </div>
                      <div>Thanks for looking at this.</div>
                      <div><br>
                      </div>
                      <div>Wilmar</div>
                    </div>
                    <div class="gmail_extra"><br>
                      <br>
                      <div class="gmail_quote">On Wed, Feb 5, 2014 at
                        5:53 AM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:bogdan@opensips.org"
                            target="_blank">bogdan@opensips.org</a>&gt;</span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div bgcolor="#FFFFFF" text="#000000">
                            <div><tt>Hello,<br>
                                <br>
                                The piece of script you posted is for
                                handling the requests, so logically, you
                                cannot inspect the reply code (for BYE)
                                when you are still routing the BYE
                                request - right :) ?<br>
                                <br>
                                So, in the script, when handling the BYE
                                request, you need to arm a failure_route
                                (to catch the negative replies) and to
                                check in that route what is the reply
                                code -&gt; do the acc.<br>
                                <br>
                                Let me know if you have problems in
                                scripting this.<br>
                                <br>
                                Regards,<br>
                              </tt>
                              <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                              <div>
                                <div> On 05.02.2014 06:36, Wilmar Campos
                                  wrote:<br>
                                </div>
                              </div>
                            </div>
                            <blockquote type="cite">
                              <div>
                                <div>
                                  <div dir="ltr">Hi All,
                                    <div><br>
                                    </div>
                                    <div>I am trying to log into the
                                      database all BYE messages that
                                      contains the return code 481.</div>
                                    <div><br>
                                    </div>
                                    <div>I have this piece of code:</div>
                                    <div>
                                      <div>&nbsp; &nbsp; if (has_totag()
                                        &nbsp;&amp;&amp;
                                        is_method("INVITE|ACK|BYE|UPDATE"))</div>
                                      <div>&nbsp; &nbsp; {</div>
                                      <div>&nbsp; &nbsp; &nbsp; &nbsp; if(loose_route()) {</div>
                                      <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                        if(!match_dialog())</div>
                                      <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;</div>
                                      <div><br>
                                      </div>
                                      <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if
                                        (is_method("BYE")) {</div>
                                      <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                        if(t_check_status("481"))</div>
                                      <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                        acc_db_request("481
                                        No","acc_bye");</div>
                                      <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
                                    </div>
                                    <div><br>
                                    </div>
                                    <div>But is giving me this error.</div>
                                    <div>ERROR:tm:t_check_status: cannot
                                      check status for a reply which has
                                      no transaction-state established<br>
                                    </div>
                                    <div><br>
                                    </div>
                                    <div>I have try different ways to
                                      accomplish this without any luck.</div>
                                    <div><br>
                                    </div>
                                    <div>Can anyone please point me to
                                      the right direction?</div>
                                    <div><br>
                                    </div>
                                    <div>Thanks,</div>
                                    <div><br>
                                    </div>
                                    <div> Wilmar</div>
                                  </div>
                                  <br>
                                  <fieldset></fieldset>
                                  <br>
                                </div>
                              </div>
                              <pre>_______________________________________________
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" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                            </blockquote>
                            <br>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>