[sr-dev] WebSocket cookie authentication and passing data

Daniel Pocock daniel at pocock.com.au
Tue Feb 4 07:55:53 CET 2014




Here is a full overview of the way we did this in reSIProcate / repro:

  http://www.resiprocate.org/SIP_Over_WebSocket_Cookies

Here is a PHP test script which sets the cookies:

http://svn.resiprocate.org/viewsvn/resiprocate/main/repro/test/web/websocket-cookie-test.php?format=markup

JSCommunicator can set the extension header for passing supplementary
data in config.js:

https://github.com/opentelecoms-org/jscommunicator/blob/master/config-sample.js#L62
(look for extra_headers)

To build a complete solution, you can simply combine the phone.shtml
code from JSCommunicator and the PHP test code into a simple script.

Notice we put a version number in the cookie.  If the Kamailio
implementation of this evolves and adds extra fields, please increment
the version number or use different cookie names to distinguish it from
the reSIProcate cookie scheme.




More information about the sr-dev mailing list