Author |
Message |
emiliano Brekeke Newbie
Joined: 09 Oct 2007 Posts: 1
|
Posted: Wed Nov 28, 2007 5:00 am Post subject: Strip digit |
|
|
1. Brekeke Product Name and version:2.0.7.2
2. Java version:1.4.2
3. OS type and the version:RED HAT 9
4. UA (phone), gateway or other hardware/software involved:FAX
5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/networkpatterns.html :
6. Your problem:
Hi,
I would need to strip the plus (+)from incoming call in To field and send without a plus.
I already put two rules in Dial Plan in order to send a specific number to a specific address
This is an axample of my Dial Plan
Matching
$request=^INVITE
To=sip:(011.+)@
Deployed
$target=88.34.148.163
what happens is that sometimes I receive the + in front of 011 and I would like to remove.
Thanks in advance
emiliano |
|
Back to top |
|
voipwell.com Partner PBX
Joined: 20 Sep 2005 Posts: 528
Location: Tannersville, Pennsylvania
|
Posted: Wed Nov 28, 2007 6:17 pm Post subject: |
|
|
Hi,
Since the + character is a meta character used in the syntax, I think you can escape it by preceding it with a \ . Since the + is sometimes there and sometimes not you want to put the * after it which means "must match zero or more times" . What you want will look something like this.
$request=^INVITE
To=sip:\+*(011.+)@
Deployed
$target=88.34.148.163
To=%1@
You almost had it but there would not be a match when the + sign was preceeding the 011.
Nick |
|
Back to top |
|
|