Author |
Message |
jfcourteau@pixelweb.net Brekeke Newbie
Joined: 19 Mar 2012 Posts: 4
|
Posted: Thu Apr 11, 2013 12:58 pm Post subject: How to strip first digit in TO destination number |
|
|
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. |
|
Back to top |
|
hope Brekeke Master Guru
Joined: 15 Jan 2008 Posts: 862
|
Posted: Fri Apr 12, 2013 11:18 am Post subject: |
|
|
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/ |
|
Back to top |
|
jfcourteau@pixelweb.net Brekeke Newbie
Joined: 19 Mar 2012 Posts: 4
|
Posted: Mon Apr 15, 2013 11:17 am Post subject: |
|
|
Thanks a lot works perfectly. |
|
Back to top |
|
|