Tuesday, January 5, 2010

Best of New in Kamailio 3.0.0 - #11: memcached connector

Another interesting module in Kamailio (OpenSER) 3.0.0 is memcached - readme is available online at:

http://kamailio.org/docs/modules/3.0.x/modules_k/memcached.html

Memcached is a distributed memory object caching system and the Kamailio module sharing the same name gives you the possibility to access the key-values stored in Memcached server from withing Kamailio configuration file.

Main featured offered by memcached module:
  • get/set integer or string values from/to memcached server
  • atomic increment or decrement integer values from memcached server
  • key can be static string or dynamic value build from other config variables
  • set expire time for memcached values
  • operations are done via pseudo-variables, therefore memcached values can be used by other modules, can be printed via xlog, a.s.o.
The pseudo-variables that give access to memcached operations are documented here.

Example of usage - count number of SIP requests to IP 10.10.10.10:

event_route[htable:mod-init] {
$mct(10.10.10.10) = 0;
}

route {
...
if(snd_ip==10.10.10.10)
$mcinc(10.10.10.10) = 1;
...
}
Then you can pull the number of SIP requests from a different application, like web admin portal.

Next in this series will not be about a SIP-related feature, but probably the most important aspect over all: the development team - join of Kamailio (OpenSER) and SIP Express Router (SER) under SIP Router Project, resulting in lot more people working on, with large expertise in the area, backed up by many companies, to ensure solid future and extraordinary quality of project.

SIP-related new features will continue afterwards.

No comments:

Post a Comment