Saturday 29 September 2012

Kamailio: SIP over WebSockets

There are a lot of really interesting things happening in the world of telecoms today.  One of the coolest is the work the IETF is doing on RTCWeb - that is media (audio and video) sessions between web-browsers without needing plugins.

RTCWeb is going to be a great enabler for all sorts of new types of web application (many of which haven't even been imagined yet) - but RTCWeb only focusses on the media part of communication.  In a lot of cases (particularly if telephony features or integration are required) the media alone isn't enough.  To this end Inaki Baz Castillo, Jose Luis Millan Villegas, and Victor Pascual have been working on an IETF draft, "The WebSocket Protocol as a Transport for the Session Initiation Protocol (SIP)" (draft-ietf-sipcore-sip-websocket-03).

There are now a number of implementations of SIP over WebSockets.  Servers include Asterisk, Kamailio, Mobicents SIP Servlets, OverSIP, and Repro/webrtc2sip.  Clients include jsSIP and sipML5.  This is not bad for a draft.

The Kamailio implementation of SIP over WebSockets (supporting both WebSockets (ws) and Secure WebSockets (wss)) has been available in the master branch of the SIP Router Git repository since early July 2012.  A number of people have tried using this and, aside from some configuration related issues, it appears to be working well.  I have tested (and seen others test) the Kamailio implementation with both the jsSIP and sipML5 clients.

If you want to try SIP over WebSockets, and you want to use it with a SIP server that supports lots of rich features (including scripting in Lua/Mono/Perl/Python, presence server, offline instant message handling, load-balancing, least-cost-routing, and far too many other things to list), Kamailio is an excellent place to start - there is even an example configuration file for SIP over WebSockets that is ready to go.

13 comments:

  1. hey Peter .. a good read indeed .. would u tell me which one is easier and proficient to work with sip ml5 or jssip ?

    ReplyDelete
  2. It depends on what you want to do. I have done most of my testing with JsSIP.

    ReplyDelete
  3. Hi Peter,

    the link to sample config is down ???
    http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=blob_plain;f=modules/websocket/example/kamailio.cfg;hb=HEAD

    Glyn

    ReplyDelete
  4. The sample configuration file is now in the main examples directory in the source tree.

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. If you need help please make use of the Kamailio mailing lists.

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. As I put in my last comment...

    If you need help please make use of the Kamailio mailing lists.

    ReplyDelete
  10. Hi Peter,
    Is there any javascript SIP client to test kamailio presence functionality?As SipMl5 sends publish subscribe request in pidf format I am searching XCAP compatible sample code to send PUBLISH/SUBSCRIBE Request.

    ReplyDelete
  11. As I put in my last two comments...

    If you need help please make use of the Kamailio mailing lists.

    ReplyDelete
  12. hi, good post, I am interested in know more about the kamailio configuration over websockets, but the link is broken. Please put the link again. I am trying to test the Jssip library, only i need the websocket configuration. Thanks.

    ReplyDelete
  13. Greetings, I abhor. And I saw the answers on the link in other reviews. Thank you. Seeketh as indicated.

    ReplyDelete