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

Derrick Ding dding at aastra.com
Tue Apr 12 19:54:54 CEST 2011


Hi, All

Currently, I try to install Kamailio as a partial call-stateful server.
My purpose is: 

A call B. (sendrecv)
A hold B  (sendonly) A call C(sendrecv)
A hold C  (sendonly) A unhold B (sendonly)

Because of Some bugs on A, when I repeat hold/unhold very fast, eg.

A -----B (sendrecv), A ---C (sendonly)
When switch hold/unhold
A send reINVITE to C(sendrecv) before A set B(sendonly), some real proxy
server will reply "491 request pending".

I want to simulate this server with Kamailio. I use setflag. But I find
this flag's lifetime is within a transaction. In a new transaction, the
flag's initial value is 0.

Eg. I plan:
    When get sendrecv in SDP of INVITE request, I setflag(11). //flag 11
on
    When get sendonly in SDP of INVITE request, I resetflag(11). //flag
11 off
    When get sendrecv again, if (isFlagSet(11)), I send 491.

But next time when get sendrecv, the flag 11 is 0. even though I comment
the lines I reset the flag.

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

Could you give me some hint?

Thanks in advance.

Derrick
























More information about the sr-users mailing list