Author |
Message |
Ilker Brekeke Newbie
Joined: 24 Oct 2008 Posts: 2
|
Posted: Fri Oct 24, 2008 3:57 am Post subject: Summarizing Dial Plans With Regular Expression |
|
|
1. Brekeke Product Name and version: 2.1.6.6/239
2. Java version: 1.6.0_05
3. OS type and the version: Windows XP
4. UA (phone), gateway or other hardware/software involved:
5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/networkpatterns.html : Pattern 9
6. Your problem: I'm trying to summarize these Dial Plans into a single dialplan and i need your help with it;
$request=^INVITE
To=sip:(1.*)@
$request=^INVITE
To=sip:(2.*)@
$request=^INVITE
To=sip:(3.*)@
How can i compose a single statement for these above?
Thanks!
Ilker |
|
Back to top |
|
james Brekeke Master Guru
Joined: 10 Dec 2007 Posts: 501
|
Posted: Fri Oct 24, 2008 11:33 am Post subject: |
|
|
Code: |
$request = ^INVITE
To = sip:([123].*)@ |
|
|
Back to top |
|
Ilker Brekeke Newbie
Joined: 24 Oct 2008 Posts: 2
|
Posted: Sat Oct 25, 2008 4:45 am Post subject: |
|
|
Thanks James for the tip, it worked out
I have another question, how can i express a rule as such?;
"Accept three digit numbers starting with 1 or 2 or 3" E.g 123, 234, 357 etc..
I checked dial-plan guide of Brekeke SIP Server but could not find anything regarding my previous and current question, sigh
Thanks!
Ilker |
|
Back to top |
|
james Brekeke Master Guru
Joined: 10 Dec 2007 Posts: 501
|
Posted: Tue Oct 28, 2008 11:48 am Post subject: |
|
|
> "Accept three digit numbers starting with 1 or 2 or 3" E.g 123, 234, 357 etc..
Try this..
Code: |
$request = ^INVITE
To = sip:([123]..)@ |
>I checked dial-plan guide of Brekeke SIP Server but could not find anything regarding my previous and current question
Since Brekeke's DialPlan syntax is based on the Regular Expression, you can learn how to write it easily..
http://en.wikipedia.org/wiki/Regular_expression
http://www.google.com/search?q=regular+expression |
|
Back to top |
|
|