<div dir="ltr">The above sanity check is intended to make sure that:<div><div><ul><li>SIP over TCP/TLS arriving on the ports intended for SIP over WebSocket is correctly rejected<br></li><li>SIP over TCP/TLS arriving on the port intended for MSRP is correctly rejected</li>
</ul><div>In examples/websocket.cfg with default settings:</div></div><div><ul><li>SIP over UDP is supported on port 5060</li><li>SIP over TCP is supported on port 5060</li><li>SIP over TLS is supported on port 5061</li><li>
SIP over WS is supported on port 80</li><li>SIP over WSS is supported on port 443</li><li>MSRP is supported over TLS on port 9000</li><li>traffic of the wrong type/transport arriving on the wrong ports is correctly rejected</li>
</ul></div><div>I believe that the check you have described, and the related ones in onreply_route, event_route[xhttp:request], and event_route[msrp:frame-in], are not too tough do exactly what they are meant to.  Whether the checks are too tough for your exact use case depends on what that is.</div>
<div><br></div><div>Regards,</div><div><br></div><div>Peter</div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 24 September 2013 12:30, Mikko Lehto <span dir="ltr"><<a href="mailto:mslehto@iki.fi" target="_blank">mslehto@iki.fi</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi websocketeers, examples/websocket.cfg starts with this check:<br>
<br>
---<br>
request_route {<br>
        if ((($Rp == MY_WS_PORT || $Rp == MY_WSS_PORT)<br>
                && !(proto == WS || proto == WSS)) || $Rp == MY_MSRP_PORT) {<br>
                xlog("L_WARN", "SIP request received on $Rp\n");<br>
                sl_send_reply("403", "Forbidden");<br>
                exit;<br>
        }<br>
---<br>
<br>
My in-dialog SIP over TCP requests got 403 treatment because of this.<br>
I believe reason was MY_WS_ADDR in route set, added by record_route().<br>
<br>
Above sanity check seems sensible tough, so I fixed advertised route set<br>
with call to force_send_socket() as seen on attached patch.<br>
<br>
I wonder if my fix is the best approach.<br>
Should the remaining other two t_relay() calls also be prepared<br>
with force_send_socket()?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Mikko<br>
</font></span><br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><font face="courier new, monospace">Peter Dunkley</font></div><div><font face="courier new, monospace">Technical Director</font></div><div>
<font face="courier new, monospace">Crocodile RCS Ltd</font></div></div>
</div>