[OpenSIPS-Users] registrar lookup() and avp_aor

Darren Sessions dmsessions at gmail.com
Sat Aug 23 00:36:42 CEST 2008


Excellent advice Bogdan! (and sorry about not starting the new thread)

Basically I had a vendor sending 'rn=' number portability tags (see  
RFC4694) in the RURI of the invite. We tracked in the registrar module  
source code (which led us to the parser functions in the core code),  
and while we've been able to see other supported tags in the RURI,  
'rn=' isn't one of them that we could find.

I was able to implement a solution using the aor_avp modparam in the  
registrar module though just as you suggested, and then using  
avp_subst with some regular expression to strip out what I needed gone.

I did a detailed write-up on my website, but basically it goes  
something like this:

---

modparam("registrar", "aor_avp", "$avp(i:1402)")
--snip--
if (!is_avp_set("$avp(i:1402)")) {
   $avp(i:1402) = $ru;
   xlog("L_INFO", "[R14] Setting ruri_user_avp = $avp(i:1402)\n");
}
avp_subst("$avp(i:1402)", "/;rn=[0-9][0-9][0-9][0-9][0-9][0-9][0-9] 
[0-9][0-9][0-9]//");

lookup("location");

---


Thanks again!

_____________________________

Darren Sessions
dmsessions at gmail.com
http://www.darrensessions.com
_____________________________





On Aug 21, 2008, at 2:29 AM, Bogdan-Andrei Iancu wrote:

> Hi Darren,
>
> lookup("location") takes the RURI and uses it as AOR for looking for  
> the registered contact in location table. So, it replaces the AOR  
> with contact. See:
>   http://www.opensips.org/html/registrar.html#id2558350
>
> If you want to use the AOR from other place than RURI, you may  
> consider passing the AOR via an AVP:
>   http://www.opensips.org/html/registrar.html#id2519634
>
> Regards,
> Bogdan
>
> PS: use new thread for new topics, please
>
> Darren Sessions wrote:
>> Need a refresher (I feel like an idiot for asking) . . the  
>> lookup("location") function uses the RURI and checks the contact  
>> field in locations (as an example) ?
>>
>> I can't remember, and the google'd docs are all messed up with the  
>> OpenSER transition . .
>> Thanks
>>
>> :)
>>
>> - Darren
>>
>>
>> _____________________________
>>
>> dmsessions at gmail.com <mailto:dmsessions at gmail.com>
>> http://www.darrensessions.com
>> _____________________________
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20080822/8ad49e82/attachment-0001.htm 


More information about the Users mailing list