09-20-2021 02:23 AM
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
Solved! Go to Solution.
09-20-2021 03:33 AM - edited 09-20-2021 03:35 AM
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
09-20-2021 03:33 AM - edited 09-20-2021 03:35 AM
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
09-20-2021 05:15 AM
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.
09-20-2021 09:13 AM - edited 09-20-2021 09:14 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide