[Users] Flags In Openser-1.01
klaus.mailinglists at pernau.at
Tue Jul 18 09:57:26 CEST 2006
Michael Papet wrote:
> If I use isflagset(3)in my route(X)to verify the account has passed
> authentication it returns false. I am assuming that means that flags
> aren't persistent and I need to use some other mechanism to set a
> variable in one part of the openser.cfg program to use in another. What
> is my best option?
The flags belong to the transaction. As long as openser has the
transaction in memory, the flags are persistent. Thus, for example if
you set a flag for an INVITE transaction, during the whole transaction
the flags are available (in normal routes, in failure routes, in reply
routes ...). But once the transaction is finished, the flags are deleted
Thus, for example if you receive a reINVITE, the previously flags are
not available any more.
To pass data from one transaction to another there are different
If you set the flag during REGISTER, you can use the NAT flag which will
be stored during save() and which will be restored during lookup().
This is usually used to mark a client behind NAT and to find out, if NAT
traversal is necessary if this user gets called.
If you want to handle data from the dialog building transaction to
another transaction in the same dialog, you can use record-route
parameters and the functions add_rr_param() and check_route_param(re).
This is also used to mark a dialog as dialog for which NAT traversal is
If you want to handle data from one dialog to another dialog, you can
store the data as AVP to the database, and later retrieve the AVP again
from the database.
This can be used for user preferences. E.g. the user calls a certain
service number and you store the user preferences (e.g. CLIP/CLIR,
activate/deactive voicebox, ...) in the AVP table. For further calls you
will the user's preferences.
More information about the sr-users