<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    it seems that the flag not to generate the internal reply was lost
    when adopting the new ser tm module.<br>
    <br>
    Can you try the attached patch on 4.0.x?<br>
    <br>
    Once applied and kamailio reinstalled, before t_relay() use:<br>
    <br>
    t_disable_internal_reply();<br>
    <br>
    An the return code should be -4 in this case.<br>
    <br>
    Let me know if works and I will push the fixes in the git repo, with
    updates to docs.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 8/23/13 12:13 PM, Steve Davies
      wrote:<br>
    </div>
    <blockquote
cite="mid:CABFTEGX6q5UkWSDAt5NZZKAZrgV+dj7U5YLK_cnLc4t41V9cRw@mail.gmail.com"
      type="cite">
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <br>
          <div class="gmail_quote">On 23 August 2013 11:18, Steve Davies
            <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:steve@connection-telecom.com"
                target="_blank">steve@connection-telecom.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div dir="ltr">Here's what I put in RELAY route block:<br>
                <div class="gmail_extra">
                  <div class="gmail_quote">
                    <div><br>
                    </div>
                    <div>
                      <p
                        style="margin:0px;font-size:12px;font-family:Inconsolata">
                                $var(rr) = t_relay();</p>
                      <p
                        style="margin:0px;font-size:12px;font-family:Inconsolata"> 
                              xlog("L_NOTICE","SLD: in RELAY, t_relay
                        returned $var(rr)\n");</p>
                      <p
                        style="margin:0px;font-size:12px;font-family:Inconsolata"> 
                              if (!$var(rr)) {</p>
                      <p
                        style="margin:0px;font-size:12px;font-family:Inconsolata"> 
                                      sl_reply_error();</p>
                      <p
                        style="margin:0px;font-size:12px;font-family:Inconsolata"> 
                              }</p>
                      <p
                        style="margin:0px;font-size:12px;font-family:Inconsolata"><br>
                      </p>
                      <p
                        style="margin:0px;font-size:12px;font-family:Inconsolata"><br>
                      </p>
                    </div>
                    <div>In 4.0.3, t_relay gives a -1 in the case that
                      there is a physical network issue (in my test I
                      have a "-j DROP" iptables rule)</div>
                    <div><br>
                    </div>
                  </div>
                </div>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>Trying to find a way to detect the case where t_relay
              fails but doesn't call the failure block.  I dumped some
              hopeful looking pseudo variables, and tried to use an avp
              to communicate from the failure branch back to the relay
              point.</div>
            <div><br>
            </div>
            <div>I tried this:</div>
            <div><br>
            </div>
            <div>        $avp(senttoast) = 0;</div>
            <div>        $var(rr) = t_relay();</div>
            <div>        xlog("L_NOTICE","SLD: in RELAY, t_relay
              returned $var(rr) err.rcode is $err.rcode t_r_c is
              $T_reply_code sent = $avp(senttoast)\n");</div>
            <div>        if ($var(rr) < 0) {</div>
            <div>                sl_reply_error();</div>
            <div>        }</div>
            <div><br>
            </div>
            <div>and in my failure block I set $avp(senttoast) to 1.</div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div>I get:</div>
            <div><br>
            </div>
            <div>Aug 23 12:07:02 ubuntu /usr/local/sbin/kamailio[7819]:
              NOTICE: <script>: SLD: in RELAY, t_relay returned -1
              err.rcode is <null> t_r_c is 100 sent = 0</div>
            <div><br>
            </div>
            <div>In the case of a 477 being sent back.  So I can't find
              anything distinctive so far.</div>
            <div><br>
            </div>
            <div>In the case of a soft failure (I have the upstream send
              a 500):</div>
            <div><br>
            </div>
            <div>
              <div>Aug 23 12:09:32 ubuntu
                /usr/local/sbin/kamailio[7817]: NOTICE: <script>:
                SLD: in RELAY, t_relay returned 1 err.rcode is
                <null> t_r_c is 100 sent = 0</div>
            </div>
            <div><br>
            </div>
            <div>So the same.</div>
            <div><br>
            </div>
            <div>From the trace I can see that the failure block is only
              executed after the t_relay returns.  The failure block
              runs on a different pid.</div>
            <div><br>
            </div>
            <div>
              <div>So there is a race.  Or maybe the avp doesn't work
                across branches or something?</div>
            </div>
            <div><br>
            </div>
            <div>Clues would be welcome!</div>
            <div><br>
            </div>
            <div>Steve</div>
            <div><br>
            </div>
            <div><br>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
</pre>
  </body>
</html>