Forums Read-only archive

Strip digit

2 posts · Brekeke SIP Server Forum

emiliano Original post
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/ ... terns.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
voipwell.com
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