Summarizing Dial Plans With Regular Expression

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
Ilker
Posts: 2
Joined: Fri Oct 24, 2008 3:46 am

Summarizing Dial Plans With Regular Expression

Post by Ilker »

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
Posts: 501
Joined: Mon Dec 10, 2007 12:56 pm

Post by james »

Code: Select all

$request = ^INVITE 
To = sip:([123].*)@
Ilker
Posts: 2
Joined: Fri Oct 24, 2008 3:46 am

Post by 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
Posts: 501
Joined: Mon Dec 10, 2007 12:56 pm

Post by james »

> "Accept three digit numbers starting with 1 or 2 or 3" E.g 123, 234, 357 etc..

Try this..

Code: Select all

$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
Post Reply