Thursday, July 28, 2011

3 years of Kamailio

Three years ago, OpenSER project had to choose a new name due to trademark infringements claims by an US company and Kamailio was the winner name.

Shortly after, the project faced a new hit, from inside this time, losing the old web domain. The sourceforge.net OpenSER project (where the source code was hosted) was the one showing the relation between the old name and new name, and the truth about whole thing.

Practically, from that moment Kamailio had to build a new brand from scratch, all the old web references being lost at that time. Despite the pessimism of many people and fighting FUD spread by cowards, I believe we succeeded to continue developing a great application, delivering a rock solid open source SIP server, withing a collaborative environment and open community.

I had no doubt about the success, just read (or google) about who is involved in management of the project or where are the people with relevant impact in the development of the project over the year (config file, database API, variables framework ... more to come soon on this blog).

Note that in present time the devel team is completed by the folks at SER project, Kamailio and SER are effectively same application right now, development being done together since autumn 2008 within sip-router.org development framework. To fully complete this picture, we are celebrating soon 10 years since the first line of code, where the major contributors to the project are among the special guests.

Apart of working to remove duplicates (and clarify better the relation and usage of two names Kamailio - SER -- briefly exposed here), the ongoing development of new features blossoms:
  • IMS extensions being worked to be integrated in main repository
  • Rich Communication Services enhancements (SIMPLE/OMA/RCS IM & Presence, embedded XCAP server)
  • embedded interpreters for high level programming languages (such as Lua)
  • distributed location service and message queues
  • config file pre-processing
  • asynchronous processing and more ...
All these facts are visible on the statistics offered by Ohloh service - few stats presented in the next graph.

If you are interested in the achievements of past releases since Kamailio name, see the release notes for versions 1.5.x, 3.0.0 and 3.1.x. Next major release, 3.2.0 is planned sometime by mid of autumn 2011.

Right now Kamailio is sitting now on a solid foundation, with a completely re-tailored architecture since OperSER time, suitable for current and future needs of real time communications, sustained by an increasing development team and backed up by major companies in the market. Its evolution is safer than ever.

My greetings to all Kamailians and thank you for your support over the last years! I am looking forward to meeting as many of you as possible at 10 years SER conference in Berlin, September 3, 2011.

Wednesday, July 20, 2011

ClueCon 2011

I am going to speak at Cluecon conference in Chicago, USA, Aug 9-11, 2011.

The speech focuses on how to build strong security for large VoIP operators, a topic where Asipto has broad expertise accumulated over the past 10 years. Some of our experiences were already shared via knowledge base site.

If you attend the conference or you are in Chicago area during these days and want to meet, do not hesitate to drop me a message via contact form.

Sunday, July 3, 2011

10yearsSER - things done right - variables

The veteran users of this project probably remember that day in the summer of 2003 when xlog module was introduced in SIP Express Router (SER) by Elena-Ramona Modroiu.

Starting with that moment, the SER config files were invaded by many xlog(...) and xdbg(...) lines - it was a big step forward to allow SER administrators understand what is going internally during processing of SIP traffic.

Little 'bugs' starting with '%' (named at that time 'specifiers') present all over the config were replaced dynamically at runtime with values taken from SIP traffic or runtime environment, giving back meaningful information about current processing.

Driven by their popularity, the specifiers implemented inside xlog module were moved to core, the marker sign '%' was replaced by '$' and since then they were named 'variables' (aka pseudo-variables). (Note: this evolution happened initially through Kamailio (OpenSER) branch).

The 'little bugs' became free to fly everywhere inside configuration file, in expressions, in assignment operations, module parameters or function parameters. And they did so!

For example, adding the prefix 0049 to dialed number became as simple as:

$rU = "0049" + $rU;

Testing if the dialed number starts with 0049? Here it is:

if($rU =~ "^0049") { ... }

Looking over several configuration files I have these days running on production systems, the operations with variables have the leading role in defining the routing logic. Without them, none of these configs would have been possible, without them, many ideas of new services would have been impossible to implement.

In the year of 10th anniversary, it is the time of sending kudos to Elena-Ramona for her contributions to this project.

PS: to clarify, the terminology 'pseudo-variables' was used due to the fact that SER's configuration language variables concept is different than classic variables. For example: some are read only, some have the value in private memory or shared memory, some are single-value some are multi-value.

Saturday, July 2, 2011

10yearsSER - things done right - database api

Besides throwing a party and being happy about it, a celebration remembers you how old you are. Same applies to SIP Express Router (aka SER) project. It started 10 years ago and the world was so different at that time (imagine: no twitter, no facebook!!!).

Targeting large IP telephony deployments with even millions of subscriber on same instance, using text files to store user profiles was out of discussion. Natural choice by year 2001: SQL database. Which one? Several options out there, so choosing one could have been proven wrong over the years.

The solution was on implement an abstract layer that allows to switch to a different database system without affecting the rest of the code. ODBC is something similar and UnixODBC is one open source implementation of it. The decision not to use unixodbc had to do with the target of going beyond SQL-like database, complexity of the ODBC system and willingness to control the component completely considering that database interaction is a critical factor for performance.

Jan Janak designed and implemented the internal DB API, which exists currently in two versions: v1 implemented mainly in Kamailio-specific modules and v2 implemented mainly in SER-specific modules.

Unlike ODBC, the internal DB API is looking to offer a limited set of features to interact with database, only those required from SER point of view.

These days, the list of database API connectors includes a significant number of implementations:
  • MySQL
  • PostgreSQL
  • SQLite
  • UnixODBC
  • DBText
  • BerkeleyDB
  • Oracle
  • LDAP
  • Flatstore
Practically, SER modules are not affected by what type of database connector you want. Besides that, different modules can connect to different database systems.

The abstract database API was a component that attracted many users to SER over the time. In the year of 10th anniversary, it is the time of sending kudos to Jan for his work.

Friday, July 1, 2011

10yearsSER - things done right - configuration file

Looking back over the past 10 years since SIP Express Router (aka SER) is developed, I found several things that made it famous. First such thing to talk about is the configuration file.

SER's configuration file is completely different than one may expect, like typical .ini file or, common in telephony, the prefix based routing rules (e.g., Asterisk's dialplan).

SIP promises included flexibility, extensibility and ability to route calls on IP/DNS based networks, with telephony just a subset of its capabilities. Based on that, going for prefix based routing seemed inappropriate for long term goals.

Initially designed by Andrei Pelinescu-Onciul, the structure of SER's configuration file ended to be very like a programming language. That succeeded to get over the time a lot of people to dislike SER itself, mainly those coming from legacy telephony products, very used in routing telephone numbers, based on prefixes.

Summarizing the evolution and comparing with what happened to other IP telephony projects, I can definitely conclude that the decision was the right one. Here is a short example of routing SIP INVITE requests to 10.0.0.1 and the other request types to 10.0.0.2:
route {
if(method=="INVITE") {
t_relay_to("udp:10.0.0.1:5060");
} else {
t_relay_to("udp:10.0.0.2:5060");
}
}
For example, Asterisk and Freeswitch, although they have their own call routing config language, text or xml based, in most of the cases the routing is decided using programming languages such as Lua, PHP, Perl a.s.o, through embedded interpreters or control interfaces such as AGI.

Probably SER came too early with this idea, at that time there was no fast scripting language that could have been used to match our performance goals, being necessary to define a new one. No matter how many hated it so far, several order or magnitudes more loved it, resulting over the time in a well defined SIP routing language, optimized to be fast for handling SIP traffic. With the power of a logical language in hands, people could easily build their ideas of new services on top of it.

At this moment SER and Kamailio (forked from SER in 2005 and back together since 2008) have embedded interpreters for Lua, Perl or Python, so you can route SIP using applications written in such programming languages, but still the default config language is the internal one.

It is no way I can be sure or claim that using a logical language for configuration file of telephony engines was invented in SER, but for sure it contributed substantially to show the power of such concept in building new and advanced telephony services.

In the year of 10th anniversary, it is the time of sending kudos to Andrei for such idea and his work to implement it.