<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"><br></span></div><div><font color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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 color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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 color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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 color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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">;branch=z9hG4bK-895-</span><font color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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 color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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 color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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 color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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">&gt;;tag=</span><font color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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 color="blue" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><span style="font-weight:700"><font color="red" style=""><span style="">1</span></font>-895@<font color="red" style=""><span style="">1</span></font>27.0.0.<font color="red" style=""><span style="">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 color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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 color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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 color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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 color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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 color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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 color="red" style="font-family:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px;white-space:pre-wrap"><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 id="sippath" class="" 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 id="sipmsg" class="" 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" style=""><span style="font-weight:700">50<font color="red" style=""><span style="">1</span></font></span></font> Method not allowed
Via: SIP/2.0/UDP <font color="red" style=""><span style="font-weight:700">1</span></font>27.0.0.<font color="red" style=""><span style="font-weight:700">1</span></font>:506<font color="red" style=""><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 color="red" style="color:rgb(51,51,51)"><span style="font-weight:700">1</span></font><font color="#333333">-0
From: sipp &lt;sip:</font><font color="red" style="color:rgb(51,51,51)"><span style="font-weight:700">1</span></font><font color="#333333">00@</font><font color="red" style="color:rgb(51,51,51)"><span style="font-weight:700">1</span></font><font color="#333333">27.0.0.</font><font color="red" style="color:rgb(51,51,51)"><span style="font-weight:700">1</span></font><font color="#333333">&gt;;tag=</font><font color="red" style="color:rgb(51,51,51)"><span style="font-weight:700">1</span></font><font color="#333333">
To: &lt;sip:200@HOSTNAME:5060&gt;;tag=06a366df888</font><font color="red" style="color:rgb(51,51,51)"><span style="font-weight:700">1</span></font><font color="#333333">a4800</font><font color="red" style="color:rgb(51,51,51)"><span style="font-weight:700">1</span></font><font color="#333333">f</font><font color="red" style="color:rgb(51,51,51)"><span style="font-weight:700">1</span></font><font color="#333333">5f72f7</font><font color="red" style="color:rgb(51,51,51)"><span style="font-weight:700">1</span></font><font color="#333333">38d9f.7522
Call-ID: </font><font color="blue" style="color:rgb(51,51,51)"><span style="font-weight:700"><font color="red" style=""><span style="">1</span></font>-895@<font color="red" style=""><span style="">1</span></font>27.0.0.<font color="red" style=""><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:&#39;Helvetica Neue&#39;,Helvetica,Roboto,Arial,sans-serif;font-size:12px;line-height:17.1429px"><font color="#333333"><br></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>