OpenSER was renamed to Kamailio as of Jul 28, 2008 – visit http://www.kamailio.org.
Being now in the code frozen state for 1.3, the time for testing started. Making updates to several config files, and seeing the result, I was curios the see some very old versions. I realized that there were important enhancements that gave to the administrators the power to materialize their innovative ideas easier and easier. I am listing 10, the most important in my personal opinion, more or less in the order of appearance. I hope to get your opinions about.
1. Using the logical language structure as opposite to extension base routing
In the past, most of the applications and devices in telecommunications routing used a model of making decision based on dialed extensions. The regular expression was mainly the only element to play with. Going for something different, from the very beginning of SER project, opened the door to lot of flexibility. The VoIP was first adopted by IT guys, with expertise in programming, that found themselves very familiar with the structure of the configuration file.
2. textops module
No much to comment here as SIP is a text protocol. Providing the functions to do raw search, replace, remove, append chunks of text inside the SIP message proved to be over the time the functionality used for common operation, but also, the one that saved in many corner cases.
3. xlog module
Before this module, the admin had very low power in troubleshooting the deployment. Also, monitoring what happens inside the platform, signaling alerts of misbehaving users or devices, or just writing messages for statistic purposes become very handy. Most of the code behind the early stages of xlog module is the base of current pseudo-variables, it is why for long time all debug messages related to script variables were issued by functions prefixed with “xl_”.
4. AVPs and avpops module
By the time of their release, the admins started to feel they get power in their hands. So far, they could just invoke what developers exported from core or modules. Using the avpops module, they started creating own extensions and functionalities just with the configuration language. For long time, functions like avp_printf(), avp_check() were dominating the config file. Serial forking, least cost routing, load balancing are some of the features implemented with AVPs behind the scene.
5. avp_db_query()
Although part of the avpops module, I find it very important just to categorize it alone. Practically, the power of SQL language was brought to OpenSER configuration file — direct access to DB backend became natively integrated.
6. variables in configuration file
By moving the operations with pseudo-variables directly in the configuration language increased the flexibility and functionality given to the admins. Prior, lot of operations could be done via avpops module, but not is the same simple and human readable format. The variables brought more dynamism to modules as well, now many functions accepting variable parameters at runtime.
7. extra accounting
Accounting is the most important component of the VoIP platform, proper and flexible accounting guarantees the expected revenue. It is no longer about recording, origin, destination, start time and duration. To face the competition and attract customers, we talk now about integrated services, packaged offerings, a.s.o. The acc module gives to administrator the decision of what details to be recorded, the details that fit the business model. There is no need for hacking C code if you need to store a new information for each call or event, just configure the DB backend and set the acc parameters.
8. script statements: exit, return, switch, while
Every time one of the above was introduced, the configuration file simplified. It became more modularized, easier to understood, many duplicates were removed. ‘return’ allows to make decision based on the resoult of executing a routing block, ‘exit’ let you stop the execution of configuration script at any point in the file. ‘switch’ get you closer to an extension-based routing decision model and reduced the number of if-else blocks in a row. ‘while’ permits nice iteration though array values: AVPs, headers.
9. transformations
Pseudo-variables represent system variable or parts of a SIP message. ‘transformation’ give access to pseudo-variable components and properties. Getting the length of a pseudo-variable string value, casting to number, or treating the value as an URI and accessing any of its elements are some of the operations you can do with transformations.
10. perl extensions
If all above are not enough for you, don’t desperate, you can simple write your logic in Perl. The ‘perl’ module offers the interface between OpenSER and Perl language. From a Perl script, you have access to SIP message, to AVPs and other pseudo-variables, to functions exported by different modules. After executing a Perl program, the results will be directly visible in the openser configuration script.