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-par...
-- Alex