cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
143
Views
0
Helpful
7
Replies
Highlighted
Beginner

CUBE SIP Header Manipulation to Remove +1

Hello, I am getting the invite from carrier with +1 on the SIP-Req-URI/From/TO fields etc. I need remove the +1 and keep the remaining digits. For example, see below. I want to remove +1 and keep the remaining. What will be the best way to handle the sip profile? 

 

INVITE sip:+13092001000@10.10.10.10 SIP/2.0
From: <sip:+12241005000@Twilio.com:5060>;tag=46900291_6772d868_880b9f34
To: <sip:+130920010009@10.10.10.10>

7 REPLIES 7
Highlighted
Beginner

Hi

Try Translation Rule

 

voice translation-rule 1

rule 1 /^\+/ //

 

voice translation-profile voip-generic

translate calling 1

 

Apply in Incoming Dial-Peer from SIP Provider

 

translation-profile incoming voip-generic

Thanks
Riyaz
Rate Useful Post If it resolve your issue
Highlighted

Hi Riyaz, we have the translation rules already but its not quite working in all scenarios and hence looking for sip manipulation, any suggestions on this? 

Highlighted

So you're referring to a scenario where your incoming calls present US numbers in E164 format, and you want the Invite that you send on to CUCM to have these numbers presented in 10 digit form.

You've referred to From headers, do you need to support calls from International callers, or do only ever have US callers?

Often it's easier and more understandable to do this with number translation rules, but SIP profiles are more powerful.

The translation rule noted above should work although it would need "translate called 1" in the profile.  As posted it would only change the calling number.   If it's not working for you could you post your rule and profile configuration, and also the Invite as received from the ITSP and as sent to CUCM.

Highlighted

Hi Tony, I have the below manipulation for the sip profile. I just want to get rid off the +1 from the URI and From Field. 

 

voice class sip-profiles 1

request INVITE sip-header SIP-Req-URI modify "sip:+1(.*\)" "sip:\1"
request INVITE sip-header From modify "sip:+1(.*\)" "sip:\1"

Highlighted

Create a SIP transform profile where you have a slice function to capture the remaining part of the number you’d want to keep and the use that slice in the replace part to make the modifications to the field you’d want to modify. Note that this is a per field match and replace, so you’d need as many lines as you have fields you want to modify in your SIP profile.

Have a look at this excellent document, it contains very good information about this. https://www.cisco.com/c/en/us/support/docs/voice/ip-telephony-voice-over-ip-voip/211306-In-Depth-Explanation-of-Cisco-IOS-and-IO.html

Please rate all useful posts
Highlighted

Hi Roger:

 

How is something like this to get rid off the +1? 

 

voice class sip-profiles 1

request INVITE sip-header SIP-Req-URI modify "sip:+1(.*\)" "sip:\1"
request INVITE sip-header From modify "sip:+1(.*\)" "sip:\1"

Highlighted

Hi,
In gereral it looks okay. If I may suggest some small alterations I would have crafted it like this.

voice class sip-profiles 1
 request ANY sip-header From modify "From:(.*)(<sip:)+1(.*@.*>)" "From: \2\3" 
 response ANY sip-header From modify "From:(.*)(<sip:)+1(.*@.*>)" "From: \2\3"
 request ANY sip-header SIP-Req-URI modify "Request-URI:(.*)(<sip:)+1(.*@.*>)" "Request-URI: \2\3" 
 response ANY sip-header SIP-Req-URI modify "Request-URI:(.*)(<sip:)+1(.*@.*>)" "Request-URI: \2\3"

Then you tie that to your dial peers where you want this to be in effect with this command.

voice-class sip profiles 1

It's also possible to make this a global enabled modification. For that I recommend you to have a look at the previous referenced document as I don't have the command at hand at the moment.

Please rate all useful posts