Forums Read-only archive

How to strip first digit in TO destination number

3 posts · Brekeke SIP Server Forum

jfcourteau@pixelweb.net Original post
1. Brekeke Product Name and Version: 2.4.8.6/286.3

2. Java version: 1.6.0_24

3. OS type and the version: Ubuntu Linux 10.10

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

5. Your problem: I'm trying to remove first digit in my dial-plan rule before sending the call to my customer (Asterisk)

Basically I want to remove the country code (1) and send only 10 digits to the customer...

Here is my current dialplan rule:

Matching Patterns
$request=^INVITE
$addr=10.10.10.10
To=sip:(1819000000|18190000001|18190000002|18190000003)@
$regaddr( "user-sip" )=(.+)

Deploy Patterns
$auth=false
To=sip:%1@%2
$replaceuri.from=true
$continue=false

How would I do this using a regex?

Thanks in advance.
hope
Matching Patterns
$request=^INVITE
$addr=10.10.10.10
To=sip:1(819000000|8190000001|8190000002|8190000003)@
$regaddr( "user-sip" )=(.+)


or

Matching Patterns
$request=^INVITE
$addr=10.10.10.10
To=sip:1(81900000[0-3])@
$regaddr( "user-sip" )=(.+)

remove 1 before number 819000000-819000003

http://rubular.com/
jfcourteau@pixelweb.net
Thanks a lot works perfectly.