[OpenSIPS-Devel] [PATCH] add find_udomain() to usrloc API

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Apr 22 09:34:54 CEST 2009


Hi John,

John Khvatov wrote:
> Hi Bogdan,
>
> On Fri, Apr 10, 2009 at 07:18:06PM +0300, Bogdan-Andrei Iancu wrote:
>   
>> Hi John,
>>
>> why do you need this function to be exported in order to add/remove  
>> contacts from other module?
>>     
>
> I do need to get a pointer to udomain_t structure of existing domain (just as
> in mi_usrloc_add() function at ul_mi.c) before to add/remove contacts.
>
>   
mi_usrloc_add() is an internal function and it uses different mechanism 
to access the data.
>> The registrar module is doing this kind of ops with contacts and it does  
>> not require it.
>>     
>
> The registrar module gets udomain_t pointer using register_udomain(), right?
>   
Correct, this is the proper way for an external module to access the 
usrloc internal data.
> Ok, this way for me as well, thanks. But I'm confused by the fact that usrloc's
> mi functions do not use this way.
>   
yes, because mi functions are internal functions for usrloc module :)
> Btw, mi_find_domain() from ul_mi.c duplicated with find_domain() from
> dlist.c. May be fix it?
>   
yes, more or less they are doing the same. They were duplicated as:
     1) it is a small function
     2) the prototypes are slightly different
     3) they are inline function (not shared via .h file)

Regards,
Bogdan



More information about the Devel mailing list