[Serusers] Enum as location-database

Greg Fausak greg at addabrand.com
Thu Aug 12 16:57:49 CEST 2004


We use enum for internal location like routing.
For example, we maintain a simple tab separated file:

ENUM    4695461265      sip+E2U addaline.com
ENUM    4695461266      sip+E2U addaline.com

(Actually, the 'file' comes from a database, but I digress).

We then watch that file for updates, when one happens we
run a little script that converts the above to (for example):

-----
e164.addabrand.com.     IN      SOA     ns1.named.com. root.named.com. (
                                 278379980 ; 2004.08.09 17:13:05 IG_CMP
                                 10800 ; refresh
                                 3600 ; retry
                                 604800 ; expire
                                 1200 ; minttl
                                 ) ;
         IN      NS      ns1.named.com.
         IN      NS      ns2.named.com.

$ORIGIN e164.addabrand.com.

5.6.2.1.6.4.5.9.6.4 IN NAPTR 100 10 "u" "sip+E2U" 
"!^.*$!sip:4695461265 at addaline.com!" .
6.6.2.1.6.4.5.9.6.4 IN NAPTR 100 10 "u" "sip+E2U" 
"!^.*$!sip:4695461266 at addaline.com!" .
-----
The file is written and BIND is bounced.  It doesn't get much easier
than that!  The lookup we use in ser is:

-----

loadmodule "/usr/local/lib/ser/modules/enum.so"
modparam("enum", "domain_suffix", "e164.addabrand.com")

...

         if(uri=~"sip:[+*#][0-9]+@")
         {
                 strip(1);
         };
         prefix("+");

         if(enum_query("e164.addabrand.com"))
         {
              ...route the call...

-----

I am very keen on getting some sort of exo-enum database going so that
routing can be done between sip providers.

---greg



On Aug 12, 2004, at 9:26 AM, Andreas Granig wrote:

> Soren (Home) wrote:
>> I don't really understand the advantage, but it is something like you 
>> want
>> to share the locations between different instances of SER?  (and not 
>> just
>> by sharing the database)
>
> First of all I want to use enum for peering partners who want to route 
> their calls over our PSTN gateways. These entries can be inserted when 
> new numbers are allocated and removed when they are released by our 
> peering partners via a defined interface.
> This is a quite straight-forward task and only requires SER to query 
> the database.
>
> But theoretically I could also insert "real" locations, which could be 
> used for looking up numbers with phone extensions.
>
> My current situation is that I have UACs that connect to ISDN PBX. The 
> UAC registers with 012345 at 1.2.3.4 and behind the PBX there exists the 
> phone extension 1000.
> Now someone calls 0123451000 at my.domain, a does_uri_exist() returns 
> false. So I have to strip down the number to the base number 012345, 
> for which I can look up the location. The problem is that the URI now 
> is sip:012345 at 1.2.3.4 instead of sip:0123451000 at 1.2.3.4
> Now I could implement my own lookup-function which keeps the user-part 
> and replaces only the host-part with the IP of the registered base 
> number.
>
> But since I want to use enum anyway, I thought that I could use enum 
> also for this scenario, because with enum I could insert 
> wildcard-locations and use regexps, so that 012345.*@my.domain always 
> resolves to 012345.*@1.2.3.4
>
>> Locations can change rapidly, while I would think of ENUM as 
>> "semi"-static
>> information. Typically DNS takes atleast some few hours to spread,
>> however, It could be different if you are using local DNS-server (w/o
>> cache) and point your resolv.conf to it.
>
> Right, it's just a local noncaching DNS server.
>
> Andy
>
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers
>
>
Greg Fausak
www.AddaBrand.com
(US) 469-546-1265




More information about the sr-users mailing list