[Devel] domain module patch

Bogdan-Andrei Iancu bogdan at voice-system.ro
Fri Jan 20 12:56:37 CET 2006


HI Dan,

thanks for the contribution. Until somebody will take a look and commit 
it on CVS, please upload your patch on the tracker 
(http://sourceforge.net/tracker/?group_id=139143). Also be sure that 
your patch contains the documentation update (only for the sgml part 
will be just fine).

regards,
bogdan

Dan Pascu wrote:

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



More information about the Devel mailing list