Author |
Message |
mayanksharma Brekeke Newbie
Joined: 10 Aug 2017 Posts: 1
|
Posted: Thu Aug 10, 2017 6:58 pm Post subject: Dial Plan assistance |
|
|
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, |
|
Back to top |
|
ambrosio Brekeke Master Guru
Joined: 27 Mar 2008 Posts: 215
|
Posted: Fri Aug 11, 2017 11:10 am Post subject: |
|
|
Use From/displayname in Deploy Pattern
For example..
Matching Patterns | $request = ^INVITE $getDisplayName(From) = (.{2})(\d+)(_\d+)( |( -))([a-zA-Z ]+)|([+.-])
| Deploy Patterns | From/displayname = %1%2%3%4%5%6
|
or
I simplified your regex pattern.
Matching Patterns | $request = ^INVITE $getDisplayName(From) = ^(\S+ \S+) \W*(\w+)
| Deploy Patterns | From/displayname = %1 %2
|
or..
Use $str.remove instead of RegEx
Matching Patterns | $request = ^INVITE $str.remove(($str.remove($str.remove($getDisplayName(From),"+"),".")."-") = (.+)
| Deploy Patterns | From/displayname = %1
|
FYI:
http://wiki.brekeke.com/wiki/DialPlan-Matching-str-remove |
|
Back to top |
|
|