[Users] Flags In Openser-1.01

Klaus Darilion 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 
as well.

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 
possibilities.

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().
http://www.openser.org/docs/modules/1.1.x/registrar.html#AEN123
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).
http://www.openser.org/docs/modules/1.1.x/rr.html#ADD-RR-PARAM-ID
This is also used to mark a dialog as dialog for which NAT traversal is 
necessary.

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.

regards
klaus




More information about the Users mailing list