04-07-2023 03:37 AM
Hi
We have a CUBE that connects to a provider. The From field (INVITE) has the following format when send to provider:
From: "<name as configured on IP phone>" <sip:extension@provider>
What provider wants now is: From: "<extension>" <sip:main-number@provider>
The sip part is fixed for each call, only the extension is of course different each time. This can be done with profiles on the CUBE, but I can't get it to work 100%. Any idea?
Thanks!
JH
04-07-2023 04:18 AM
Create a SIP profile with () around the extension part on the match side and then on the replacement side put that in as \1. I’m writing this on a mobile, so I can’t easily get you a complete suggestion. Have a look at this document on how SIP profiles work. SIP Profiles on CUBE Enterprise Common Use Cases
Also it could be useful to try your SIP profile on this tool before you put it into your gateway. https://cway.cisco.com/tools/SipProfileTest/
04-07-2023 04:54 AM
This document also have a great section on SIP profiles. In Depth Explanation of Cisco IOS and IOS-XE Call Routing
04-07-2023 06:07 AM - edited 04-07-2023 06:11 AM
Something like this should work.
rule 10 request INVITE sip-header From modify "From: ".*" <sip:(.*)@.*" "From: "\1" <sip:main-number@provider>"
04-09-2023 02:15 AM
Hello Roger
Thank you for your input.
I tried your solution but get an "% Invalid input detected at '^' marker." error. The error points to ".*" (right behind the first "From:) Looks like a missing " somewhere?
You know?
Thank you for your help
JH
04-09-2023 03:13 AM
Try with this.
rule 10 request INVITE sip-header From modify ".*<sip:(.*)@.*" ""\1" <sip:main-number@provider>"
04-09-2023 11:44 PM
Hello Roger
I applied the last suggestion from you, but now I have: Error: Invalid Pattern-quote is not escaped
I shall check the documentation, but maybve you see what is wrong
Thank you very much!
JH
04-09-2023 11:59 PM
I didn’t know, but there is this nice thing called Google. I took your error message and searched for it and the first hit was this post. https://community.cisco.com/t5/unified-communications-infrastructure/cube-sip-profile-to-change-from-clid-error-invalid-pattern-quote/td-p/3863309
As you have " as part of the result in the replacement part you’d need to escape them. Try with this.
rule 10 request INVITE sip-header From modify ".*<sip:(.*)@.*" "\"\1\" <sip:main-number@provider>"
04-10-2023 12:06 AM
Hello Roger
OK, now I don't have an error, I shall check if it works, and thank you for the other links, I just must learn the syntax of these profiles.
Thank you!
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