[Devel] domain module patch

Dan Pascu dan at ag-projects.com
Fri Jan 20 10:44:40 CET 2006


Attached is a patch for the domain module which adds a function that 
allows checking if a domain specified in an avp is local. This is a 
generalization of the is_*_local() functions already present in the 
domain module.

The function is called is_domain_local() and accepts as input an avp 
specification. It will then take that avp value and check if the domain 
(which supposedly the avp holds) is local.

the input parameter of the function can be one of:

1. $ruri  - will check the domain part of the request uri
2. $from  - will check the domain part of the From header
3. avp name or alias - will check the value of the avp/alias

For case 3 the avp should contain the domain part only, unlike the cases 1 
or 2 where the domain part will be taken from $ruri/$from internally.

Cases 1 and 2 are present for convenience and to simplify usage in the 
most used cases. They can of course be emulated by using the 3rd form, 
but with an extra avp_write function call:

avp_write("$ruri/domain", "i:888")
is_domain_local("i:888")

The following forms are equivalent with the old forms:

is_domain_local("$ruri") == is_uri_host_local()
is_domain_local("$from") == is_from_local()

but new uses are possible:

is_domain_local("i:888")
is_domain_local("s:my_domain")
is_domain_local("$an_alias")


Who is responsible for this code please consider applying this patch.

-- 
Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: is_domain_local_check_with_avp.diff
Type: text/x-diff
Size: 6542 bytes
Desc: not available
Url : http://openser.org/pipermail/devel/attachments/20060120/690640a9/is_domain_local_check_with_avp.bin


More information about the Devel mailing list