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