<p dir="ltr">Thanks. I will see if I can post the actual packet tomorrow.</p>
<p dir="ltr">The only reason the contact header has 127.0.0.1 is because this test example is generated with sipp and ir is picking that off from [local_ip] there. Even with an identical packet, if you change the cseq to 1 it will work as expected. Hence cseq 0 is the suspect as that can reliably be replicated with it being the only difference.</p>
<p dir="ltr">While these particular packets were generated, we are actually hitting this in real world where we have someone constantly pinging us starting with cseq 0. The packet with cseq 0 never gets a reply. All others (1-100, then they start from 0 again) get a reply. I&#39;ll post a copy of that packet tomorrow too.</p>
<p dir="ltr">Thanks.</p>
<div class="gmail_quote">On 6 Jul 2016 5:55 p.m., &quot;Eric Tamme&quot; &lt;<a href="mailto:eric@uphreak.com">eric@uphreak.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div 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>On 07/06/2016 10:44 AM, Karolis
      Pabijanskas wrote:<br>
    </div>
    <blockquote 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(&quot;OPTIONS&quot;)) {</div>
            <div>        sl_send_reply(&quot;501&quot;, &quot;Method not allowed&quot;);</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:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">
</span></div>
        <div><font style="font-family:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">27.0.0.</span><font style="font-family:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">:506</span><font style="font-family:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">00@</span><font style="font-family:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">27.0.0.</span><font style="font-family:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,H elvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">&gt;;tag=</span><font style="font-family:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap" color="blue"><span style="font-weight:700"><font color="red"><span>1</span></font>-895@<font color="red"><span>1</span></font>27.0.0.<font color="red"><span>1</span></font></span></font><span style="color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">
CSeq: 0 </span><font style="font-family:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">
Contact: sip:</span><font style="font-family:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">00@</span><font style="font-family:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">27.0.0.</span><font style="font-family:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,Helveti ca,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">:506</span><font style="font-family:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap">
Max-Forwards: </span><font style="font-family:&#39;Helvetica Neue&#39;,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:&#39;Helvetica Neue&#39;,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 style="white-space:pre-wrap;padding-top:10px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,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 style="white-space:pre-wrap;padding-top:10px;font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px"><span style="color:rgb(51,51,51)">SIP/2.0 <font color="red"><span style="font-weight:700">50<font color="red"><span>1</span></font></span></font> Method not allowed
Via: SIP/2.0/UDP <font color="red"><span style="font-weight:700">1</span></font>27.0.0.<font color="red"><span style="font-weight:700">1</span></font>:506<font 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 color="red"><span>1</span></font>-895@<font color="red"><span>1</span></font>27.0.0.<font color="red"><span>1</span></font></span></font><font color="#333333">
CSeq: 0 OPTIONS
Server: User Agent String
Content-Length: 0</font></div>
        </div>
        <div style="white-space:pre-wrap;padding-top:10px;font-family:&#39;Helvetica Neue&#39;,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></fieldset>
      <br>
      <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>

<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div>