<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    obscuring the ip/hostnames in this makes it difficult to
    troubleshoot - please dont do that in the future.<br>
    <br>
    I am not certain the CSeq is the issue.  I believe that the contact
    is broken, aka it contains localhost, so when opensips tries to
    route it, it fails on udp_send: sendto.<br>
    <br>
    Again, this is my guess, but since you have manipulated and obscured
    the complete sip trace it makes it difficult to confirm.<br>
    <br>
    -Eric<br>
    <br>
    <div class="moz-cite-prefix">On 07/06/2016 10:44 AM, Karolis
      Pabijanskas wrote:<br>
    </div>
    <blockquote
cite="mid:CANYNSSLkqcKq+BatEwf74aS-uUqibSrwZy7LfPALim4kxAd3KQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi List,
        <div><br>
        </div>
        <div>We seem to be hitting a strange behaviour when we get an
          OPTIONS ping with a Cseq of 0. (latest 1.11 branch).</div>
        <div><br>
        </div>
        <div>Our routing script contains this at the very beginning to
          decline OPTIONS messages:</div>
        <div>route {</div>
        <div>
          <div>
            <div>    if (is_method("OPTIONS")) {</div>
            <div>        sl_send_reply("501", "Method not allowed");</div>
            <div>        exit;</div>
            <div>    };</div>
          </div>
        </div>
        <div>   ## blah...</div>
        <div>}</div>
        <div><br>
        </div>
        <div>If we send this OPTIONS request:</div>
        <div><br>
        </div>
        <div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">2016-07-06 17:12:05 +0100 : CLIENT_IP:5061 -&gt; OPENSIPS_IP:5060</span><br>
        </div>
        <div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">
</span></div>
        <div><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">OPTIONS</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"> sip:200@</span><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">HOSTNAME</span><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">:5060 SIP/2.0
Via: SIP/2.0/UDP </span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">1</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">27.0.0.</span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">1</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">:506</span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">1</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',He
lvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">;branch=z9hG4bK-895-</span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">1</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">-0
From: sipp &lt;sip:</span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">1</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">00@</span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">1</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">27.0.0.</span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">1</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',H
elvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">&gt;;tag=</span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">1</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">
To: &lt;sip:200@</span><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">HOSTNAME</span><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">:5060&gt;
Call-ID: </span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="blue"><span style="font-weight:700"><font style="" color="red"><span style="">1</span></font>-895@<font style="" color="red"><span style="">1</span></font>27.0.0.<font style="" color="red"><span style="">1</span></font></span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">
CSeq: 0 </span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">OPTIONS</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">
Contact: sip:</span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">1</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">00@</span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">1</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">27.0.0.</span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">1</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helveti
ca,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">:506</span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">1</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">
Max-Forwards: </span><font style="font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="red"><span style="font-weight:700">1</span></font><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">00
Content-Length: 0
</span></div>
        <div><br>
        </div>
        There is no reply from OpenSIPS. Interestingly, siptrace module
        is also running and saving captures in Homer. Homer, actually,
        is getting a copy of the generated reply:
        <div>
          <div id="sippath" class="" style="white-space:pre-wrap;padding-top:10px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px">2016-07-06 17:12:05 +0100 : OPENSIPS_IP:5060 -&gt; CLIENT_IP:5061</div>
          <div id="sipmsg" class="" style="white-space:pre-wrap;padding-top:10px;font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px"><span style="color:rgb(51,51,51)">SIP/2.0 <font style="" color="red"><span style="font-weight:700">50<font style="" color="red"><span style="">1</span></font></span></font> Method not allowed
Via: SIP/2.0/UDP <font style="" color="red"><span style="font-weight:700">1</span></font>27.0.0.<font style="" color="red"><span style="font-weight:700">1</span></font>:506<font style="" color="red"><span style="font-weight:700">1</span></font>;received=</span><font color="#ff0000"><b>CLIENT_IP</b></font><font color="#333333">;branch=z9hG4bK-895-</font><font style="color:rgb(51,51,51)" color="red"><span style="font-weight:700">1</span></font><font color="#333333">-0
From: sipp &lt;sip:</font><font style="color:rgb(51,51,51)" color="red"><span style="font-weight:700">1</span></font><font color="#333333">00@</font><font style="color:rgb(51,51,51)" color="red"><span style="font-weight:700">1</span></font><font color="#333333">27.0.0.</font><font style="color:rgb(51,51,51)" color="red"><span style="font-weight:700">1</span></font><font color="#333333">&gt;;tag=</font><font style="color:rgb(51,51,51)" color="red"><span style="font-weight:700">1</span></font><font color="#333333">
To: &lt;sip:200@HOSTNAME:5060&gt;;tag=06a366df888</font><font style="color:rgb(51,51,51)" color="red"><span style="font-weight:700">1</span></font><font color="#333333">a4800</font><font style="color:rgb(51,51,51)" color="red"><span style="font-weight:700">1</span></font><font color="#333333">f</font><font style="color:rgb(51,51,51)" color="red"><span style="font-weight:700">1</span></font><font color="#333333">5f72f7</font><font style="color:rgb(51,51,51)" color="red"><span style="font-weight:700">1</span></font><font color="#333333">38d9f.7522
Call-ID: </font><font style="color:rgb(51,51,51)" color="blue"><span style="font-weight:700"><font style="" color="red"><span style="">1</span></font>-895@<font style="" color="red"><span style="">1</span></font>27.0.0.<font style="" color="red"><span style="">1</span></font></span></font><font color="#333333">
CSeq: 0 OPTIONS
Server: User Agent String
Content-Length: 0</font></div>
        </div>
        <div id="sipmsg" class="" style="white-space:pre-wrap;padding-top:10px;font-family:'Helvetica Neue',Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px"><font color="#333333">
</font></div>
        But running a tcpdump on the OpenSIPS host reveals that no
        actual packet is ever sent to the client. Debug shows:
        <div>
          <div>Jul  6 17:40:25 HOSTNAME /sbin/opensips[48357]:
            ERROR:core:udp_send:
            sendto(sock,0x7f7867aee470,324,0,0x7fff77d00090,16):
            Operation not permitted(1)</div>
          <div>Jul  6 17:40:25 HOSTNAME /sbin/opensips[48357]:
            ERROR:sl:msg_send: udp_send failed</div>
        </div>
        <div><br>
        </div>
        <div>OpenSIPS is running as root.</div>
        <div><br>
        </div>
        <div>Switching Cseq to 1 in that original OPTIONS message works.
          But in this particular case we have no control over the Cseq
          of the host we are being pinged from, and need to reply.
          According to the RFC, Cseq should be a 32bit unsigned integer,
          so 0 should not be an issue.</div>
        <div><br>
        </div>
        <div>Any ideas?</div>
        <div><br>
        </div>
        <div>Thanks!</div>
        <div>Karolis</div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <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>
    <br>
  </body>
</html>