<div dir="ltr">Thank you, working perfectly.<div><br></div><div>Thanks!!</div><div><br></div><div>Wilmar</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 5, 2014 at 12:52 PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a 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>Hi Wilmar,<br>
        <br>
        yes, that is one of ways to do it.<br>
        <br>
        Regards,<br>
      </tt><div class="im">
      <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre></div><div><div class="h5">
      On 05.02.2014 19:50, Wilmar Campos wrote:<br>
    </div></div></div><div><div class="h5">
    <blockquote type="cite">
      <div dir="ltr">Hi Bogdan,
        <div><br>
        </div>
        <div>I Include in the Sequential check:</div>
        <div>
          <div>    if (has_totag()  &amp;&amp;
            is_method(&quot;INVITE|ACK|BYE|UPDATE&quot;))</div>
          <div>    {</div>
          <div>        t_on_failure(&quot;1&quot;);</div>
        </div>
        <div><br>
        </div>
        <div>Then on:</div>
        <div>
          <div>failure_route[1]</div>
          <div>{</div>
          <div>xlog(&quot;L_ERROR&quot;, &quot;$ci|log|FAILURE ROUTE: rU $rU | tu $tu |
            fu $fu | rd $rd | Code $T_reply_code &quot;);</div>
          <div><br>
          </div>
          <div>I logged succesfully when 481.</div>
          <div><br>
          </div>
          <div>Is this the right way?  Including the t_on_failure in the
            sequential check in the script?  </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 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 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>
                  <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                </div>
                <div>
                  <div> On 05.02.2014 16:43, Wilmar Campos
                    wrote:<br>
                  </div>
                </div>
              </div>
              <div>
                <div>
                  <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> Opensips -&gt; Provider SIP Request: BYE
                          sip:<a href="tel:14102248770" value="+14102248770" target="_blank">14102248770</a>@Provider:5061</div>
                        <div> Provider -&gt; Opensips SIP Status: 481
                          Call leg/transaction does not exist</div>
                      </div>
                      <div><br>
                      </div>
                      <div>I have a 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 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 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>    if (has_totag()
                                         &amp;&amp;
                                        is_method(&quot;INVITE|ACK|BYE|UPDATE&quot;))</div>
                                      <div>    {</div>
                                      <div>        if(loose_route()) {</div>
                                      <div>           
                                        if(!match_dialog())</div>
                                      <div>                exit;</div>
                                      <div><br>
                                      </div>
                                      <div>            if
                                        (is_method(&quot;BYE&quot;)) {</div>
                                      <div>               
                                        if(t_check_status(&quot;481&quot;))</div>
                                      <div>                       
                                        acc_db_request(&quot;481
                                        No&quot;,&quot;acc_bye&quot;);</div>
                                      <div>            }</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 href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a 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>
  </div></div></div>

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