[Serusers] ENUM comfort query, uri mangling

Klaus Darilion klaus.mailinglists at pernau.at
Thu Mar 31 18:38:16 CEST 2005


1. use strip() and prefix() to bring the URI into E.164 format.

2. Make an ENUM lookup.

2a. successful? t_relay()

2b. If the lookup fails, the request URI is still the E.164 number. 
Thus, send it to the gateway (maybe you have to use strip/prefix again 
to bring the number into a format knwon by the gateway).

regards,
klaus



Alex Mack wrote:

> Hi everyone!
> 
> I want to implement an ENUM query in my routing block with comfort. I 
> want ENUM queries always to be done because VoIP-Calls are cheaper than 
> PSTN-routed ones.
> I want to let the user request e.g. "sip:089123456 at mydomain.org" and the 
> script should query for "6.5.4.3.2.1.9.8.9.4.e164.arpa" (I'm in munich 
> (prefix 089), germany (prefix +49); a single zero indicates long 
> distance calls, two zeros indicate international calls, local calls 
> don't have leading zeros)
> 
> The idea is to complete the requested uri to be a e164 address and then 
> start a query
> 
> The logic should be like:
> 
> if (uri_is_e164) {
>    if (do_enum_query)
>       t_relay;
> } else if (uri =~ "sip:0[1-9][0-9]{1,14}@.*") {
>    # national call
>    replace "leading 0" with "+49";
>    if (do_enum_query)
>       t_relay;
> } else if (uri =~ "sip:00[1-9][0-9]{1,13}@.*") {
>    # international call
>    replace "leading 00" with "+";
>    if (do_enum_query)
>       t_relay;
> }
> 
> I don't get the hang of those textops functions because sometimes they 
> work and sometimes they don't, especially after other modules have been 
> changing the uri.
> In addition, if one of those enum-queries fails, the uri should be 
> reverted to the original one (with "0" or "00").
> How would the correct ser.cfg-script look like?
> 
> Alex Mack
> 
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers
> 
> 




More information about the sr-users mailing list