Author |
Message |
Pretorean Brekeke Junior Member
Joined: 31 Oct 2006 Posts: 8
|
Posted: Tue Feb 24, 2009 11:53 am Post subject: How to replace + sign with another string |
|
|
1. Brekeke Product Name and version: 1.5.2.0/172
2. Java version: 1.4.2_05
3. OS type and the version:Linux 2.4.20-28.8smp
4. UA (phone), gateway or other hardware/software involved:
5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/networkpatterns.html : 9
6. Your problem: I want to forward a call to a certain IP, and the calling number has the '+' sign in front of it. How can I remove or replace the '+' before forwarding the call?
thanks |
|
Back to top |
|
hope Brekeke Master Guru
Joined: 15 Jan 2008 Posts: 862
|
Posted: Tue Feb 24, 2009 2:31 pm Post subject: |
|
|
matching:
$request=^INVITE
To=sip:+(calling number)@
Deploy
To=sip:%1@destinationIP |
|
Back to top |
|
james Brekeke Master Guru
Joined: 10 Dec 2007 Posts: 501
|
Posted: Tue Feb 24, 2009 2:51 pm Post subject: |
|
|
All,
I think "To=sip:+(calling number)@ " shoud be
To=sip:\+(calling number)@
this is because "+" has a special meaning in regex so we need to escape it with "\". |
|
Back to top |
|
Pretorean Brekeke Junior Member
Joined: 31 Oct 2006 Posts: 8
|
Posted: Wed Feb 25, 2009 8:28 am Post subject: |
|
|
I am talking about calling number, so To is not the place to do it.
Also what I am looking is a conditional: if '+' exists then translate it, otherwise don't touch the calling number. |
|
Back to top |
|
hope Brekeke Master Guru
Joined: 15 Jan 2008 Posts: 862
|
Posted: Wed Feb 25, 2009 11:08 am Post subject: |
|
|
if calling is caller then
matching:
$request=^INVITE
From=sip:\+(.+)@(.+)
Deploy
From=sip:%1@%2
$replaceuri=true
James:
Thank you for the correction. |
|
Back to top |
|
|