Forums Read-only archive

Summarizing Dial Plans With Regular Expression

4 posts · Brekeke SIP Server Forum

Ilker Original post
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/ ... terns.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
james

Code:

$request = ^INVITE 
To = sip:([123].*)@
Ilker
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
james
> "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