<div class="gmail_quote">2012/8/7 Peter Dunkley <span dir="ltr">&lt;<a href="mailto:peter.dunkley@crocodile-rcs.com" target="_blank">peter.dunkley@crocodile-rcs.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

You don&#39;t need to use OverSIP to use the WebSocket module in Kamailio.  The Kamailio implementation will allow you connect one or more WebSocket clients directly to Kamailio and make calls between them.  It can also be used to convert calls from the WebSocket transport to SCTP/TCP/UDP for routing to other proxies.</blockquote>

</div><br>Hi Peter, I wonder if Kamailio&#39;s WebSocket implementation provides the folllowing callbacks and features:<div><br></div><div>1) A callback (i.e. a script &quot;route[X]&quot; in kamailio.cfg) that is called when a new WebSocket connection is requested by a client, by providing access to the HTTP GET request (so the admin, based on local policy can inspect the HTTP request and allow/dissalow the connection after checking the Cookie header, the Origin header, the Host header or whatever).</div>

<div><br></div><div>2) A mechanism to associate custom attributes for each WebSocket connection (i.e. an authorized user identifier, which has been authorized by means of the previous HTTP GET request inspection in step 1).</div>

<div><br></div><div>3) A mechanism to retrieve, in the kamailio.cfg script, the attributes of the WebSocket connection from which a SIP request arrives to Kamailio (i.e. useful to enforce that the From URI matches the connection user identifier retrieved in any custom way in step 1).</div>

<div><br></div><div>4) A mechanism to close an existing WebSocket connection from the kamailio.cfg script (i.e: during the WebSocket handshake we decided, somehow, that the user identifier is &quot;alice&quot;, but at some point we receive an INVITE from that WS connection with From user &quot;bob&quot;, so it could be an attacker and we want to close the connection).</div>

<div><br></div><div>5) A callback that is called when a previously accepted WebSocket connection is closed (by passing as argument the terminator of the connection: the client or kamailio.cfg).</div><div><br></div><div><div>

<br></div><div>Said that, WWW people WON&#39;T like the idea of providing a SIP username and SIP password in the JavaScript code retrieved by the user when visiting the web page, and for sure most of WWW people will prefer to validate/authenticate/authorize the WebSocket connections by inspecting the HTTP GET request (Origin, Cookie, some custom API_KEY in the request-URI of the GET method or whatever).</div>

<div><br></div><div><br></div><div>Cheers.</div><div><br></div><div><br></div>-- <br>Iñaki Baz Castillo<br>&lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;<br>
</div>