Dial Plan assistance

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
mayanksharma
Posts: 1
Joined: Thu Aug 10, 2017 6:00 pm

Dial Plan assistance

Post by mayanksharma »

1. Brekeke Product Name and Version: Brekeke SIP Server version 3.3.9.3/379-8

2. Java version: 1.7.0_65

3. OS type and the version: Redhat Enterprise Linux 6 (64 bit)

4. UA (phone), gateway or other hardware/software involved:

5. Your problem:

Hi all,

Basically what I am wanting achieve with a Dial plan is to look for "+" "." & "-" in a CLID of a call and remove "+" "." & "-" from the CLID.

I have come up with a regex (see below) which I tested with RegExr that is able to pick out the "+" "." & "-" via $getDisplayNAme(From). But I was wanting to know what is deploy pattern I could use to get rid of "+" "." & "-".


(.{2})(\d+)(_\d+)( |( -))([a-zA-Z ]+)|([+.-])

I am happy for alternative suggestion to the above regex to achieve this.

Essentially incoming CLID will be e.g.

4E 14P Nurse+
4E 14P -Nurse
4E 14P Nurse.

and we just want to get rid of the "+" "." & "-" if they appear anywhere in the string and the rest left as it is.

Thank you guys in advance..

Regards,
ambrosio
Posts: 215
Joined: Thu Mar 27, 2008 12:20 pm

Post by ambrosio »

Use From/displayname in Deploy Pattern

For example..

Matching Pattern
$request = ^INVITE
$getDisplayName(From)=(.{2})(\d+)(_\d+)( |( -))([a-zA-Z ]+)|([+.-])

Deploy Pattern
From/displayname = %1%2%3%4%5%6

or
I simplified your regex pattern.

Matching Pattern
$request = ^INVITE
$getDisplayName(From) = ^(\S+ \S+) \W*(\w+)

Deploy Pattern
From/displayname = %1 %2


or..
Use $str.remove instead of RegEx

Matching Pattern
$request = ^INVITE
$str.remove(($str.remove($str.remove($getDisplayName(From),"+"),".")."-")=(.+)

Deploy Pattern
From/displayname = %1

FYI:
http://wiki.brekeke.com/wiki/DialPlan-M ... str-remove
Post Reply