Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
How to strip first digit in TO destination number
Author Message
jfcourteau@pixelweb.net
Brekeke Newbie


Joined: 19 Mar 2012
Posts: 4

PostPosted: Thu Apr 11, 2013 12:58 pm    Post subject: How to strip first digit in TO destination number Reply with quote

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
View user's profile
hope
Brekeke Master Guru


Joined: 15 Jan 2008
Posts: 862

PostPosted: Fri Apr 12, 2013 11:18 am    Post subject: Reply with quote


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
View user's profile
jfcourteau@pixelweb.net
Brekeke Newbie


Joined: 19 Mar 2012
Posts: 4

PostPosted: Mon Apr 15, 2013 11:17 am    Post subject: Reply with quote

Thanks a lot works perfectly.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Brekeke Forum Index » Brekeke SIP Server Forum All times are GMT - 7 Hours
Page 1 of 1