Monday, July 9, 2012

SIP over Websocket support integrated into Kamailio

Peter Dunkley, an active member of the Kamailio developer team, has integrated support for SIP over the WebSocket protocol into Kamailio. It will be part of the next release and exist only in the developer code today. There are still some issues to sort out to get a production-ready setup. SIP over Websockets, an IETF draft composed by a number of members of the SER/Kamailio/SIP router community – Iñaki Baz Castillo, Victor Pascual and José Luis Millán Villegas – is still a moving target and hopefully on it’s way to become an RFC.
From the IETF draft abstract:
   The WebSocket [RFC6455] protocol enables messages exchange between
   clients and servers on top of a persistent TCP connection (optionally
   secured with TLS [RFC5246]).  The initial protocol handshake makes
   use of HTTP [RFC2616] semantics, allowing the WebSocket protocol to
   reuse existing HTTP infrastructure.

   Modern web browsers include a WebSocket client stack complying with
   The WebSocket API [WS-API] as specified by the W3C. It is expected
   that other client applications (those running in personal computers
   and devices such as smartphones) will also run a WebSocket client
   stack.  The specification in this document enables usage of the SIP
   protocol in those new scenarios.

   This specification defines a new WebSocket sub-protocol (section 1.9
   in [RFC6455]) for transporting SIP messages between a WebSocket
   client and server, a new reliable and message boundary transport for
   the SIP protocol, new DNS NAPTR [RFC3403] service values and
   procedures for SIP entities implementing the WebSocket transport.
   Media transport is out of the scope of this document."

The Kamailio SIP over Websocket support

Some customisation of the websocket module is possible through modparams, but for most users the defaults should be OK.  The WebSocket module uses
the xhttp and sl modules for the initial handshake, and (unless you have both a Kamailio installation and WebSocket SIP client supporting GRUU, Outbound[1], and Path[2]) nathelper for request routing and the core force_rport() function for response routing (a new nat_uac_test() has been added to detect whether a message has arrived on a WebSocket).  There is an example kamailio.cfg in the websocket module directory.
  • [1] Kamailio does not currently support Outbound
  • [2] I have not updated the Path module for WebSockets
I believe that, once Kamailio supports Outbound and WebSocket support is added to the Path module (and you have a SIP over WebSocket client that
supports this), it will be possible to use the websocket module without the nathelper module and force_rport() and without needing to change the websocket module or Kamailio core code.
If you want to use secure WebSockets (wss) as well as ordinary WebSockets just configure TLS and listen on an appropriate port.
I have added WebSocket support to some modules, but there are definitely going to be others (modules/lcr, modules/sipcapture, modules_k/nat_traversal, modules_k/path, modules_k/seas, and modules_k/snmpstats, at least) that need updating too.  WebSockets is an unusual transport, so I have put a few notes together for anyone who needs to use it in the code (including adding support to additional modules):
  • A WebSocket server cannot initiate a WebSocket connection.  So a WebSocket connection (over TCP or TLS) is like a TCP/TLS connection coming from behind a NAT.  This is why nathelper aliasing and force_rport() is used for the routing, and “set_…_no_connect()” is always used (it’s set within the websocket module).
  • WebSocket (PROTO_WS) and secure WebSocket (PROTO_WSS) connections are just upgraded TCP and TLS connections, so there are no listening sockets for PROTO_WS and PROTO_WSS.  This means that, when deciding on what transport is being used, you need to look at the proto set in the tcp_connection, receive_info, and/or dest_info structure for the message -looking at the socket_info structure (that the message has arrived on or will be sent on) will not give you the right answer.
  • Although WebSocket (PROTO_WS) and secure WebSocket (PROTO_WSS) are different internal protocols there is only one SIP transport type for both ”;transport=ws” (WS and WSS are explicitly used in Via: headers though).  This means that you can’t tell whether the transport parameter in an R-URI, Route/Record-Route, or Contact-URI is for WebSockets or secure WebSockets.  As long as the message makes it into the WebSocket module everything will be OK as that module sorts it all out, but it has led to slightly more complex checks being required in some of the code relating to record-routing to handle this – and it may have an effect on other modules too.
Please give the new module a go and let Peter know (by writing to the developer mailing list) about any issues you find!

Friday, July 6, 2012

Two new Diameter-IMS modules added to Kamailio repository

Jason Penton of Smile Communications has just  committed CDP and CDP_AVP modules.
CDP (C Diameter Peer) allows Diameter communication from Kamailio and CDP AVP is a helper module for various applications on top of CDP (C Diameter Peer). CDP AVP module adds support for the following applications:
  • Various base AVPs (implemented in base.h) for RFC3588 base AVPs
  • Base AVPs (implemented in nasapp.h) for RFC4005 base AVPs
  • Diameter Credit Control App (implemented in ccap.h) for RFC4006 AVPs
  • EPC (implemented in epcapp.h) for 3GPP Rx, Gx(x) interface AVPs – see TS29l061, TS29.212, TS29.214, TS29.272 and TS29.299
  • IMS (implemented in imsapp.h) for 3GPP IMS AVPs, Cx, Dx, Sh interfaces – see TS29.229 and TS29.329
You can read more about them in the module documentation:
RFCs

Monday, June 25, 2012

Packages for Kamailio v3.3.0

Debian/Ubuntu packages are ready in the usual APT repository, including nightly builds of the GIT branch 3.3, details at:
RPMs for CentOS/RedHat, Fedora, openSuse (various versions for each OS) are now available on openSuse build factory repository, details at:
There you find the note about Peter Dunkley’s repository, which has also builds for Raspberry Pi.

Tuesday, June 19, 2012

Save the bits! Act now!

It's about the time to announce publicly one of the most important world wide initiatives - "SAVE THE BITS!" Foundation.

If you are not familiar with the concept, the BIT is the smallest entity of computers and Internet data ecosystem, wikipedia is a good place to read about it.

There are many species of bits out there, probably over-exceeding the animal and plant species on the earth. The bits are growing in colonies, by grouping themselves they become live entities, for example being able to move, execute tasks, perform math operations faster than humans - one can clearly hear or even see different kinds of such colonies.

The first focus of our foundation is to take care of real time communication bits, especially those related to rich communication services (RCS - e.g., VoIP or Internet-based telephony, instant messaging, tweeting, a.s.o.). It's not about an endangered category of bit species in terms of high risk of extinction, but about the maltreatment they have to suffer.

IP based real time communication involves migrations of a lot of bits from one device to another one. This process can be very stressful for the tiny, the little cuties bits.

Just think about what kind of abusive, degrading and mercy-less situations the bits have to tolerate, such as:
  • did you know that each bit is electrocuted? And not only once, but by each device it is passing through, like computers, routers, switches, servers, iphones, ipads, etc. During RCS sessions each bit can get thousand of electricity shocks. Imagine that for you and think how you would tolerate that. Stop using RCS, save the bits from paintful treatments!
  • you are in Miami on the beach and start calling your friend in Alaska? Have you thought about thermal shocks? You are sending bits from a very hot temperature to freezing in miliseconds. Did you wear them with proper clothes? Do you like to be parachuted naked in Alaska during Christmas?
  • how many times you've got a call before waking up? Did you brush your teeth before answering? Your mouth flow slaps the bits straight in the face. Eating and drinking crap, smoking & co flood the bits with terrible smell
  • have you heard anyone yelling at the phone? Dirty words, swearing! It's the feeble bits that have to endure all of that
  • do you know that many RCS bits are dying at premature age? Many devices destroy them in short after receiving. Fortunately governments started to act and require long term protection for them, forcing communication companies to keep RCS bits on high quality comfort storage systems (like 5 stars hotels for people), where state agencies (and 'good-will' hackers) can keep an eye on them whenever they wish
It is not honorable for our civilization to allow such maltreatment and humiliations to any of exiting beings on out planet, the colonies of bits, especially the ones in RCS are alive, they move, you can hear them, you can see them -- they are all your voice and video session.

Even it was an initiative that acted pretty discreet so far, we've got lot of support. Recently large mobile operators publicly announced new policies to protect the innocent RCS bits on their infrastructure (e.g., operators from Sweden, Spain, Germany, just to name very few),  by completely blocking usage of VoIP or overcharging for it. In several locations, where this unacceptable situation was truly understood, using bits for VoIP and RCS has been made a crime by legislation, like facing up to 15 years in prison for infringement. Even many vendors take our side by deploying ALG guardians in their home-routers to stop VoIP from working.

Moreover, each human must be aware and join the movement. Don't tolerate abuses again the bits! Use analog telephony and operator's voice plans, by that bits are happy, operators are happy, you are going to be [poor, but] happy! Yeah, everyone happy!

It is not an easy fight, we could call it war, a tough one, but there is visible progress. The foundation urges all mobile and fixed operators to act and start protecting RCS bits, NOW! Block VoIP, block RCS!

To join the foundation or donate for the cause, contact the author of this blog! Remember, each bit matters!

And don't forget to spread the word to the world! Leave a comment and tell us how you protect the bits! Tell us what torturres against bits you witnessed so far!

Facebook fan page, website and other online resources will be launched soon!


Full disclaimer - I do work in RCS business, one of my main activities being the development of an open source SIP server application (Kamailio), used to provide rich communication services. In more than 10 years of activity in this sector, I came to deep understanding of this abusing issue against innocent bits, fighting from inside and offering delicate care to the bits passing through Kamailio, for example:
  • all received bits are stored in clean buffers
  • we have our own friendly manager to care of the bits in memory storage
  • we don't allow unaccredited persons to send us bits, authenticating and carefully checking each packet we receive
  • we don't send the bits to untrusted party, in this way being sure the bits are well cared at destination
  • we add extra protection layer (based on strong TLS security) whenever we have to send the signaling bits through unknown paths

Monday, June 18, 2012

Kamailio v3.3.0 Released

Kamailio SIP Server v3.3.0 is out – a new major release with a very large number of new features and improvements.
 
On June 18, 2012, Kamailio (OpenSER) 3.3.0 has been released – this release is a result of about 6 months of development and 2 months of testing from the teams of Kamailio (OpenSER) and SIP Express Router (SER) projects.
 
This version comes with 7 brand new modules in addition to a lot of fresh features in core and old modules. Continue reading full release notes at:
Enjoy SIP routing in a secure, flexible and easier way with Kamailio v3.3.0!

Asipto has recently announced two new training and consultancy public events where you can learn how to use Kamailio to build your rich communication services, read more about them at:

Friday, June 15, 2012

New Kamailio Developer – Vicente Hernando

Kamailio SIP Server project announced Vicente Hernando as a new registered developer – he submitted lately very useful patches to ndb_redis module (e.g., array support in replies, redis free function for config), new ones being on the pipe — watch our mailing list where he is going present better his plans or see his contributed commits.

Mainly he will be in charge with ndb_redis module, being a heavy user of it, but there have been submissions from him to other parts of code, we welcome improvements and new good features anywhere!

Welcome and everyone is looking forward to his contributions!

Thursday, June 14, 2012

Updates of Kamailio Debian Packages

Courtesy of Jon Bonilla, Debian packaging got a bit of updates in preparation to release Kamailio v3.3.0.

Next is his announcement on the Kamailio's users mailing list.

With the upcoming release of version 3.3.0, we have updated our Kamailio Debian repositories.
  • Debian 5.0 “lenny” will no longer be supported. This means that no more nightly builds for this distribution will be triggered. We’ll provide builds for stable releases of 3.0, 3.1 and 3.2 branches though.
  • Ubuntu 12.04 “Precise” is now supported for nightly builds and 3.2+ versions. Next time a 3.2.x version is tagged we’ll provide the build. Meanwhile you can download the nightly build of 3.2 branch for this distro.
  • There will be no more nightly builds of 3.1 branch. We’ll provide stable builds in case another version is released though.
  • We now support nightly builds of branch 3.3 (same as 3.2 and master). You can test latest git versions of branch 3.3 until a stable release is built using these repositories:
deb http://deb.kamailio.org/kamailio33-nightly squeeze main
deb http://deb.kamailio.org/kamailio33-nightly wheezy main
deb http://deb.kamailio.org/kamailio33-nightly lucid main
deb http://deb.kamailio.org/kamailio33-nightly precise main

All the information and repositories can be found in Kamailio wiki as usual:

Wednesday, June 6, 2012

Kamailio Packages for Raspberry Pi

Peter Dunkley, a registered Kamailio developer, has built some RPMs of upcoming Kamailio 3.3.0, including for the Raspberry Pi (running Fedora 17).

If anyone wants to try them, they are available via Yum repository:
The post at Peter Dunkley’s blog: