[SR-Users] Is there any globle variable/flag mechanism in Kamailio

Alex Balashov abalashov at evaristesys.com
Tue Apr 12 20:00:15 CEST 2011


On 04/12/2011 01:54 PM, Derrick Ding wrote:

> I wonder if there's any other mechanism that I can use to record the
> state and can be used as flag.

That is because a stateful proxy is, by default, transaction-stateful. 
A "call" is a dialog, which consists of several transactions.  Proxies 
are not, by default, dialog-stateful.  It sounds like you're looking for 
something that can persist throughout the lifetime of a dialog.

Fortunately, Kamailio does have a 'dialog' module that adds this 
functionality.  The doc page for the module is here:

   http://www.kamailio.org/docs/modules/3.1.x/modules_k/dialog.html

If you set a dialog to be tracked using the 'dialog' module, you can use 
so-called dialog flags:

 
http://www.kamailio.org/docs/modules/3.1.x/modules_k/dialog.html#id2965748

 
http://www.kamailio.org/docs/modules/3.1.x/modules_k/dialog.html#id2965808

These will be valid for the life of a dialog.

Another option--which also has the effect of being dialog-persistent, 
but does not involve use of the dialog module--is to stow something in a 
Record-Route header value, which I assume your proxy is adding:

   http://www.kamailio.org/docs/modules/3.1.x/modules_k/rr.html#id2663290
 
http://www.kamailio.org/docs/modules/3.1.x/modules_k/rr.html#check-route-param-id

-- Alex

-- 
Alex Balashov - Principal
Evariste Systems LLC
260 Peachtree Street NW
Suite 2200
Atlanta, GA 30303
Tel: +1-678-954-0670
Fax: +1-404-961-1892
Web: http://www.evaristesys.com/



More information about the sr-users mailing list