<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi Tito,<br>
      <br>
      All you have to do is to add the "0x02" parameter to the t_relay()
      at this line
      <a class="moz-txt-link-freetext" href="https://github.com/OpenSIPS/opensips/blob/master/etc/opensips.cfg#L229">https://github.com/OpenSIPS/opensips/blob/master/etc/opensips.cfg#L229</a><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>
OpenSIPS Summit 2018
  <a class="moz-txt-link-freetext" href="http://www.opensips.org/events/Summit-2018Amsterdam">http://www.opensips.org/events/Summit-2018Amsterdam</a>
</pre>
    <div class="moz-cite-prefix">On 01/24/2018 11:34 PM, Tito Cumpen
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CANZPVB5if60v-MC4-KMyGU7YJsUx_hPmCrm5R7RRTuovvFTuAw@mail.gmail.com">
      <div dir="ltr">Bogdan,
        <div><br>
        </div>
        <div><br>
        </div>
        <div>My current script does not have a t_relay() for initial
          invites specifically it is based on the </div>
        <div><br>
        </div>
        <div><a
            href="https://github.com/OpenSIPS/opensips/blob/master/etc/opensips.cfg"
            moz-do-not-send="true">https://github.com/OpenSIPS/opensips/blob/master/etc/opensips.cfg</a><br>
        </div>
        <div>script. If I add a t_relay() of any sort in the relay route
          it will provide a return code of 1 and continue to failure
          block before processing the pending branch. I want to evade
          failing the entire call if one of the usr locations fails due
          to a connection error like 477 and so I'd like the rest of the
          branches to be attempted before failing the request.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Thanks,<br>
          Tito</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Jan 15, 2018 at 10:55 AM,
          Bogdan-Andrei Iancu <span dir="ltr"><<a
              href="mailto:bogdan@opensips.org" target="_blank"
              moz-do-not-send="true">bogdan@opensips.org</a>></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"> <tt>Hi Tito,<br>
                <br>
                You do not have to add an additional t_relay(), just add
                the "0x02" flag to your existing t_relay() in script.<br>
                <br>
                Regards,<br>
              </tt>
              <pre class="m_-9221942484619533690moz-signature" cols="72"><span class="">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a class="m_-9221942484619533690moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank" moz-do-not-send="true">http://www.opensips-solutions.<wbr>com</a></span>
OpenSIPS Summit 2018
  <a class="m_-9221942484619533690moz-txt-link-freetext" href="http://www.opensips.org/events/Summit-2018Amsterdam" target="_blank" moz-do-not-send="true">http://www.opensips.org/<wbr>events/Summit-2018Amsterdam</a>
</pre>
              <div>
                <div class="h5">
                  <div class="m_-9221942484619533690moz-cite-prefix">On
                    01/12/2018 09:35 AM, Tito Cumpen wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">Bogdan,
                      <div><br>
                      </div>
                      <div><br>
                        The issue is I'm not sure where to enter the 
                         t_relay("0x02"). I don't see it used in the
                        standard relay route examples. I tried putting
                        it in my relay route like this </div>
                      <div><br>
                      </div>
                      <div>
                        <div>route[relay] {</div>
                        <div>        # for INVITEs enable some
                          additional helper routes</div>
                        <div>        if (is_method("INVITE")) {</div>
                        <div><br>
                        </div>
                        <div>t_relay("0x02");</div>
                        <div><br>
                        </div>
                        <div>        do_accounting("evi", "missed");</div>
                        <div>        setflag(accounted);</div>
                        <div><br>
                        </div>
                        <div>                t_on_branch("handle_nat");</div>
                        <div>                t_on_reply("handle_nat");</div>
                        <div>               
                          t_on_failure("missed_call");</div>
                        <div>        } else if (is_method("BYE|CANCEL"))
                          {</div>
                        <div>                rtpengine_delete();</div>
                        <div>        }</div>
                        <div><br>
                        </div>
                        <div><br>
                        </div>
                        <div>   if (!t_relay("3")) {</div>
                        <div><br>
                        </div>
                        <div>if (is_method("INVITE")){</div>
                        <div>         </div>
                        <div><br>
                        </div>
                        <div>                xlog("connection failure
                          here at $rU\n");</div>
                        <div>        #        route(handletmfail) ;</div>
                        <div>        #       exit;</div>
                        <div>}</div>
                        <div>}</div>
                        <div>        if (!t_relay()) {</div>
                        <div>                xlog("failure sending call
                          to $rU\n");</div>
                        <div>                send_reply("500","Internal
                          Error");</div>
                        <div>        };</div>
                        <div>        exit;</div>
                        <div>}</div>
                        <div><br>
                        </div>
                      </div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div>But it gets sent to the failure route  prior
                        to failing the pending branch.</div>
                      <div><br>
                      </div>
                      <div>Thanks,<br>
                        Tito</div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div class="gmail_extra">
                        <div class="gmail_quote">On Tue, May 9, 2017 at
                          6:17 AM, Bogdan-Andrei Iancu <span dir="ltr"><<a
                              href="mailto:bogdan@opensips.org"
                              target="_blank" moz-do-not-send="true">bogdan@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 Tito,<br>
                                <br>
                                The 477 is locally generated by OpenSIPS
                                prior to send the the request out. This
                                is why you cannot have in in the failure
                                route (which is triggered by the failure
                                of the transaction, AFTER the request
                                was sent out).<br>
                                <br>
                                What you can do is to use the 2 flag for
                                t_relay() (see <a
class="m_-9221942484619533690gmail-m_8062212044147558505moz-txt-link-freetext"
href="http://www.opensips.org/html/docs/modules/2.3.x/tm.html#t_relay"
                                  target="_blank" moz-do-not-send="true">http://www.opensips.org/html/d<wbr>ocs/modules/2.3.x/tm.html#t_re<wbr>lay</a>)
                                and check in script for the failure of
                                t_relay().<br>
                                <br>
                                Regards,<br>
                              </tt>
                              <pre class="m_-9221942484619533690gmail-m_8062212044147558505moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  <a class="m_-9221942484619533690gmail-m_8062212044147558505moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank" moz-do-not-send="true">http://www.opensips-solutions.<wbr>com</a>

OpenSIPS Summit May 2017 Amsterdam
  <a class="m_-9221942484619533690gmail-m_8062212044147558505moz-txt-link-freetext" href="http://www.opensips.org/events/Summit-2017Amsterdam.html" target="_blank" moz-do-not-send="true">http://www.opensips.org/events<wbr>/Summit-2017Amsterdam.html</a>
</pre>
                              <div>
                                <div
                                  class="m_-9221942484619533690gmail-h5">
                                  <div
                                    class="m_-9221942484619533690gmail-m_8062212044147558505moz-cite-prefix">On
                                    05/01/2017 10:55 PM, Tito Cumpen
                                    wrote:<br>
                                  </div>
                                </div>
                              </div>
                              <blockquote type="cite">
                                <div>
                                  <div
                                    class="m_-9221942484619533690gmail-h5">
                                    <div dir="ltr">
                                      <div>Group,</div>
                                      <div><br>
                                      </div>
                                      Is there a tm param to force 477
                                      failures to go to failure block ?
                                      <div><br>
                                      </div>
                                      <div>IE: I have a wss socket that
                                        times out or closes connection
                                        but the UL entry is still active</div>
                                      <div>so the connection attempt
                                        fails and the 477 is sent back
                                        to the UAC instead of trying the
                                        logic in the failure block. Can
                                        anything be done here ?</div>
                                      <div><br>
                                      </div>
                                      <div><br>
                                        Thanks,<br>
                                        Tito</div>
                                      <div>
                                        <div><br>
                                        </div>
                                        <div><br>
                                        </div>
                                      </div>
                                    </div>
                                    <br>
                                    <fieldset
class="m_-9221942484619533690gmail-m_8062212044147558505mimeAttachmentHeader"></fieldset>
                                    <br>
                                  </div>
                                </div>
                                <pre>______________________________<wbr>_________________
Users mailing list
<a class="m_-9221942484619533690gmail-m_8062212044147558505moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="m_-9221942484619533690gmail-m_8062212044147558505moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
                              </blockquote>
                              <br>
                            </div>
                          </blockquote>
                        </div>
                        <br>
                      </div>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>