cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1326
Views
5
Helpful
3
Replies

CUBE SIP Header - Changing value in the FROM field

pematthe
Level 1
Level 1

Our SIP ITSP is moving to a new platform and the SIP format they are asking for is different to their current platform. It looks like I need to so some modifications to the SIP information using profiles.  I understand the principle but I'm no good with REGEX so cannot get the right combination to make the change.

 

The ISTP wants a text string in the FROM field instead of the IP address within in the INVITE request.  Using profile and CUBE references, it looks like I need to do something like the following:

 

voice class sip-profiles 230
request INVITE sip-header from MODIFY "<sip:.*@1.1.1.1>" "<sip:.*@TEXTWITHTRUNK.INFO>

As I don't know what I am doing with REGEX and substitution, I receive the error:

Error: Invalid Pattern-quote is not escaped

 The IP address is always the same, the text is always the same.  This is for a specific dial-peer. 

Any help appreciated.

 

SIP Debug capture (edited)

Sent:
ACK sip:555101010@2.2.2.2:5060 SIP/2.0
Via: SIP/2.0/TCP 1.1.1.1:5060;branch=z9hG4bKca7b322a6b8a
From: "Our Co ID" <sip:555.2222222@1.1.1.1>;tag=2217584

needs to be....

From: "Our Co ID" <sip:555.2222222@TEXTWITHTRUNK.INFO>;tag=2217584
1 Accepted Solution

Accepted Solutions

Hi

 

Please try the below 

voice class sip-profile 230 

rule 1 request INVITE sip-header From modify "@.*" "@TEXTWITHTRUNK.INFO"

rule 2 response INVITE sip-header From modify "@.*" "@TEXTWITHTRUNK.INFO"

 

If your IP is static, then you can replace .* with 1.1.1.1

voice class sip-profile 230 

rule 1 request INVITE sip-header From modify "@1.1.1.1" "@TEXTWITHTRUNK.INFO"

rule 2 response INVITE sip-header From modify "@1.1.1.1" "@TEXTWITHTRUNK.INFO"

 

you can use the following tool to test your sip rule : https://cway.cisco.com/tools/SipProfileTest/ 

Regards, 

Shalid

View solution in original post

3 Replies 3

Hi

 

Please try the below 

voice class sip-profile 230 

rule 1 request INVITE sip-header From modify "@.*" "@TEXTWITHTRUNK.INFO"

rule 2 response INVITE sip-header From modify "@.*" "@TEXTWITHTRUNK.INFO"

 

If your IP is static, then you can replace .* with 1.1.1.1

voice class sip-profile 230 

rule 1 request INVITE sip-header From modify "@1.1.1.1" "@TEXTWITHTRUNK.INFO"

rule 2 response INVITE sip-header From modify "@1.1.1.1" "@TEXTWITHTRUNK.INFO"

 

you can use the following tool to test your sip rule : https://cway.cisco.com/tools/SipProfileTest/ 

Regards, 

Shalid

Thank you Shalid. 

The profile setting you suggested cures the outgoing blocking by the ITSP but it uncovered a new set of issues. 

 

I can now make a call as the IP address is changed to the text string.  Unfortunately I am unable to control the call at all as CANCEL, BYE messages are ignored or are not sent.  I suspect this is the CUBE not seeing the profile in both directions so cannot reconcile outgoing messages with INCOMING responses.

I am going to keep looking into this problem but I will mark your answer as 'resolved' as the question I asked was answered.

Your line 

voice class sip-profiles 230
request INVITE sip-header from MODIFY "<sip:.*@1.1.1.1>" "<sip:.*@TEXTWITHTRUNK.INFO>

It is missing a “ at the end of the line, that is why you get the error message.



Response Signature


Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: