Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
How to replace + sign with another string
Author Message
Pretorean
Brekeke Junior Member


Joined: 31 Oct 2006
Posts: 8

PostPosted: Tue Feb 24, 2009 11:53 am    Post subject: How to replace + sign with another string Reply with quote

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


Joined: 15 Jan 2008
Posts: 862

PostPosted: Tue Feb 24, 2009 2:31 pm    Post subject: Reply with quote

matching:
$request=^INVITE
To=sip:+(calling number)@

Deploy
To=sip:%1@destinationIP
Back to top
View user's profile
james
Brekeke Master Guru


Joined: 10 Dec 2007
Posts: 501

PostPosted: Tue Feb 24, 2009 2:51 pm    Post subject: Reply with quote

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
View user's profile
Pretorean
Brekeke Junior Member


Joined: 31 Oct 2006
Posts: 8

PostPosted: Wed Feb 25, 2009 8:28 am    Post subject: Reply with quote

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


Joined: 15 Jan 2008
Posts: 862

PostPosted: Wed Feb 25, 2009 11:08 am    Post subject: Reply with quote

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
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