Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
Summarizing Dial Plans With Regular Expression
Author Message
Ilker
Brekeke Newbie


Joined: 24 Oct 2008
Posts: 2

PostPosted: Fri Oct 24, 2008 3:57 am    Post subject: Summarizing Dial Plans With Regular Expression Reply with quote

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
View user's profile
james
Brekeke Master Guru


Joined: 10 Dec 2007
Posts: 501

PostPosted: Fri Oct 24, 2008 11:33 am    Post subject: Reply with quote

Code:
$request = ^INVITE
To = sip:([123].*)@
Back to top
View user's profile
Ilker
Brekeke Newbie


Joined: 24 Oct 2008
Posts: 2

PostPosted: Sat Oct 25, 2008 4:45 am    Post subject: Reply with quote

Thanks James for the tip, it worked out Smile

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 Sad

Thanks!
Ilker
Back to top
View user's profile
james
Brekeke Master Guru


Joined: 10 Dec 2007
Posts: 501

PostPosted: Tue Oct 28, 2008 11:48 am    Post subject: Reply with quote

> "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
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Brekeke Forum Index » Brekeke SIP Server Forum All times are GMT - 7 Hours
Page 1 of 1