[sr-dev] Implementation question / usrloc / registrar

Carsten Bock lists at bock.info
Tue Feb 8 21:58:40 CET 2011


Hi,

after reviewing "modules_s/usrloc" i could merge the reg-avps into
"modules_k/usrloc". The functionality is as follows:

in module-parameters:
modparam("usrloc", "reg_avp_flag", "name_of_avp_flag")

in Routing logic:
In order to save a param into usrloc:

$test = "Something";
setvarflag($test, "name_of_avp_flag");
save("location");

Restore the parameters:
lookup("location");
read_reg_avps("location", "$fU")
(where $fU is user, for which the parameters will be loaded. It will
then take the modified URI of the current message, to get the contact,
for which the parameters will be loaded).

It took a little while to understand the functionality of the
modules_s/usrloc, since it is not documented.

The variables of SER ($test = "something") and the
setvarflag()/getvarflag() are disabled in Kamailio; so probably i
should think of something else here.

Any comments?

Carsten

2011/2/8 Carsten Bock <lists at bock.info>:
> Hi,
>
> thanks for the hint.
> I was always about to say, it does not exist but it is simply not documented.
> I will take a look at it; thanks!
>
> Thanks,
> Carsten
>
> 2011/2/8 Daniel-Constantin Mierla <miconda at gmail.com>:
>> Hello,
>>
>> On 2/8/11 11:59 AM, Carsten Bock wrote:
>>>
>>> Hi everyone,
>>>
>>> just a short request for comments:
>>> Similar to the dialog-variables, which i implemented in my IMS branch
>>> recently, i need something similar for usrloc. Basically, i need to
>>> store additional data to a registration; which i can access after
>>> "lookup()" or upon a "is_registered()" call. Basically:
>>>
>>> $reg_var(test) = "some value";
>>> save();
>>> - - -
>>> lookup();
>>> xlog("reg_var(test) is $reg_var(test)\n");
>>>
>>> Now there are different approaches:
>>> 1) implement this funtionality in usrloc/registrar directly (similar
>>> to my dialog-pvar-implementation). The performance when doing this
>>> impact should be minor if not used, since simply an empty pointer
>>> would be carried along every registration. This would be the cleanest
>>> way to do this; but however since many people are using usrloc i have
>>> a little respect doing changes on such core-module. Maybe it could be
>>> implemented as a change in usrloc and a dedicated module just for
>>> getting and setting the values.
>>> 2) another way would be to implement this in a dedicated module. This
>>> would mean, that i would not touch usrloc module and it would of
>>> course have no impact on "regular" usrloc usage at all if not used. I
>>> would have to add a second list of in-memory values, which would have
>>> to be synched with db, a second timer to do so. The list would be
>>> dependent on the usrloc callbacks. There is always the danger
>>> data-inconsistency.
>>> 3) is there any way, to do this with some event-routes,
>>> shared-variables or something similar?
>>>
>>> Any thoughts?
>>> Comments very welcome!
>>
>> I think that modules_s/usrloc has something like this, maybe looking at it
>> can help somehow to get it in k version.
>>
>> Cheers,
>> Daniel
>>
>>> Kind regards,
>>> Carsten
>>>
>>> P.S.: If i do not receive any comments, i would implement the first
>>> approach (directly in usrloc/registrar) in my IMS-branch for later
>>> merging into master.
>>>
>>> _______________________________________________
>>> sr-dev mailing list
>>> sr-dev at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>>
>> --
>> Daniel-Constantin Mierla
>> http://www.asipto.com
>>
>>
>
>
>
> --
> Carsten Bock
> Schomburgstr. 80
> 22767 Hamburg
> Germany
>
> Mobile +49 179 2021244
> Home +49 40 34927217
> Büro (Verl) +49 5246 801427
> Fax +49 40 34927218
> mailto:carsten at bock.info
>



-- 
Carsten Bock
Schomburgstr. 80
22767 Hamburg
Germany

Mobile +49 179 2021244
Home +49 40 34927217
Büro (Verl) +49 5246 801427
Fax +49 40 34927218
mailto:carsten at bock.info



More information about the sr-dev mailing list