Ben:
You can try the following. I did not check it for accuracy but the basic idea should be correct.
-Steve
if (uri=~"^sip:[0-9]{4}@your-sip-domain") { prefix("111222"); if (does_uri_exist()) { strip (6); lookup("location"); t_relay(); break; } else { xlog("L_INFO", "\n[SER]: [%Tf] Subscriber check failed for <%fu> - declined\n"); sl_send_reply("603", "Declined - subscriber unavailable"); break; }; } else {
.... break; };
You could prefix the xxxx with 111222, check if the new username is a subscriber and if so strip the 111222 then t_relay.
POON Ben wrote:
I'll give that a try, thanks. I'm new to the whole Unix thing, so it's taking me a while to understand what's going on...
Thanks Ben
-----Original Message----- From: Steve Blair [mailto:blairs@isc.upenn.edu] Sent: Tuesday, March 06, 2007 9:05 AM To: POON Ben Subject: Re: [Serusers] Dial Plans
POON Ben wrote:
Thanks for the quick reply. If I use alias, then I have to make an alias for each user, is that correct? I was wondering if there's a dynamic way of doing it so I don't have to make a new alias every
time.
Yes. I can think of several ways but they would all involve checking some database value. Just striping the "111222" off of the R-URI won't do it because the resultant username does not exist in the location table.
You could prefix the xxxx with 111222, check if the new username is a subscriber and if so strip the 111222 then t_relay.
-Steve
Thanks, Ben
-----Original Message----- From: Steve Blair [mailto:blairs@isc.upenn.edu] Sent: Tuesday, March 06, 2007 8:56 AM To: POON Ben Cc: serusers@lists.iptel.org Subject: Re: [Serusers] Dial Plans
You could add an alias for these numbers. Then forward based on the result of a lookup"aliases".
POON Ben wrote:
Hi,
I need help with setting up a dial plan.
Basically, I want to do this: If my phone #'s are 111-222-xxxx where xxxx is the extension, I want to be able to call xxxx instead of the full 10 digits when calling within the local loop.
I tried looked for dial plans with SER online but found very little information. Any help is greatly appreciated.
I've tried using prefix option without luck. This is what I had: if(!uri=~"sip:111.*") { prefix("111222"); };
When I try to call using just the extension, I get a busy tone. Are there any special modules I need? And are there any good tutorials on
creating dial plans and how to set them up?
I hope I posted the question to the right place, if not please let me
know where I should ask.
Thank you very much, Ben
--
Serusers mailing list Serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers