Hi all,
Just thought about adding a private enum-db to my system and use it as kind of location database in addition to the location-table in mysql.
This would have the advantage that I could handle number suffices for a PBX behind an ISDN telephone adapter rather easily. Example: such an UAC is registered as 012345@1.2.3.4. Someone now calls 0123451000@my.domain, and enum resolves this to 0123451000@1.2.3.4 by applying a proper regexp.
Now the problem is: how do I keep the enum database up to date? The enum module doesn't provide anything for that. The easy part is performing a DNS-update when someone successfully registers, by calling an external script. But how do you delete the entries from DNS when they for example expire?
Or is enum not supposed to be used for that anyway?
Cheers, Andy
Hi,
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)
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.
Cheers,
Hi all,
Just thought about adding a private enum-db to my system and use it as kind of location database in addition to the location-table in mysql.
This would have the advantage that I could handle number suffices for a PBX behind an ISDN telephone adapter rather easily. Example: such an UAC is registered as 012345@1.2.3.4. Someone now calls 0123451000@my.domain, and enum resolves this to 0123451000@1.2.3.4 by applying a proper regexp.
Now the problem is: how do I keep the enum database up to date? The enum module doesn't provide anything for that. The easy part is performing a DNS-update when someone successfully registers, by calling an external script. But how do you delete the entries from DNS when they for example expire?
Or is enum not supposed to be used for that anyway?
Cheers, Andy
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
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@1.2.3.4 and behind the PBX there exists the phone extension 1000. Now someone calls 0123451000@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@1.2.3.4 instead of sip:0123451000@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
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@addaline.com!" . 6.6.2.1.6.4.5.9.6.4 IN NAPTR 100 10 "u" "sip+E2U" "!^.*$!sip:4695461266@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@1.2.3.4 and behind the PBX there exists the phone extension 1000. Now someone calls 0123451000@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@1.2.3.4 instead of sip:0123451000@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@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Greg Fausak www.AddaBrand.com (US) 469-546-1265
Greg Fausak wrote:
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
Ok, but this is also rather static and only changes if a new number is subscribed to the system, isn't it?
What I'm looking for is a solution to maintain a very dynamic location database in enum. I've a few thousand subscribers registering from IP addresses that are assigned by DHCP, so they can and do change from one register to the next.
So I want to perform something like:
if(www_authorize("my.domain", "subscriber")) { save("location"); # just for backup exec_msg('/foo/nsupdate_wrapper register'); } else { ... }
nsupdate_wrapper calls the nsupdate-utility and dynamically updates the DNS entry.
The only problem I can see is how to remove expired entries from the enum tree.
Does that make sense?
Andy
Hi again,
I am not sure what you mean by ISDN PBX - its a PBX located on a dialup-ISDN or?
Just to understand your scenario:
You have: INVITE 0123451000@my.domain
Which you can lookup as: 012345@my.domain
Which returns a contact like: 012345@1.2.3.4
Where you need to append the extention: 0123451000@1.2.3.4
Is this correct?
I think ENUM is maybe an too advanced scheme to do this thing :-). Mostly because you also need to update the location of 012345@1.2.3.4 when it registers and because registers in my system happens much more frequently than invites. I would maybe do something like:
if (uri =~ "sip:012345[0-9]+@.*") {
setuser("012345"); if (!lookup("location")) { # isdn pbx offline, do something break; };
# rewrite using old uri and hostpart from new_uri exec_dst(' SIP_RHOST=${SIP_RURI/sip:*@/} echo "sip:$SIP_OUSER@$SIP_RHOST" '):
};
You can rewrite the script to something blazing fast in C or the like ;-)
Cheers,
Greg Fausak wrote:
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
Ok, but this is also rather static and only changes if a new number is subscribed to the system, isn't it?
What I'm looking for is a solution to maintain a very dynamic location database in enum. I've a few thousand subscribers registering from IP addresses that are assigned by DHCP, so they can and do change from one register to the next.
So I want to perform something like:
if(www_authorize("my.domain", "subscriber")) { save("location"); # just for backup exec_msg('/foo/nsupdate_wrapper register'); } else { ... }
nsupdate_wrapper calls the nsupdate-utility and dynamically updates the DNS entry.
The only problem I can see is how to remove expired entries from the enum tree.
Does that make sense?
Andy
Soren (Home) wrote:
I am not sure what you mean by ISDN PBX - its a PBX located on a dialup-ISDN or?
It's a ISDN-SIP gateway acting as a UAC, see http://inalp.com/en/products/smartnode/index.htm for details. And the PBX is connected to it.
Just to understand your scenario:
You have: INVITE 0123451000@my.domain
Which you can lookup as: 012345@my.domain
Which returns a contact like: 012345@1.2.3.4
Where you need to append the extention: 0123451000@1.2.3.4
Is this correct?
That's it, yes.
exec_dst(' SIP_RHOST=${SIP_RURI/sip:*@/} echo "sip:$SIP_OUSER@$SIP_RHOST" '):
D'oh, yes, SIP_OUSER is the beast i was looking for. I better should RTFM ;o) You're right, that's a much niftier way to do this...
Thanks alot, Andy