09-19-2024 12:56 AM
Hello,
Our client would like to add new headers to the invite message. They send P-Asserted Identity header as below. They want to parse this header to 3 sections and they would like to give every section a new name. Is this possible with SIP profiles ? If it's possible can you help me with the configuration. Because I tried so many things but couldn't find a solution yet.
P-Asserted-Identity: "05XXXXXXXXX!YYYY!ZZZZZZZZZ " <sip:05XXXXXXXXX!YYYY!ZZZZZZZZZZ@AAA.BBB.CCC.DDD>
They want to add below 3 headers and send them as below
Customer Number: "05XXXXXXXXX"
Customer ID: "YYYY"
Customer Name:"ZZZZZZZZZ"
Thanks,
09-19-2024 03:32 AM - edited 09-19-2024 03:37 AM
Yes. Copy the source into variables that you can then reference in subsequent add/modify lines. You will need to use RegEx to match each piece of the source header. Examples are shown in the CUBE Config Guide - SIP Profile chapter and CUBE Common Use Cases TechNote.
09-19-2024 06:06 AM
Thank you Jonathan,
We configured below sip-profile by following the guides .In our test environment below configuration seems worked but probably we used too many commands. Can you help us to simplify the commands.
voice class sip-profiles 1
rule 1 request INVITE sip-header P-Asserted-Identity copy "<sip:(.*)!.*!.*@.*" u01
rule 2 request INVITE sip-header P-Asserted-Identity copy "<sip:.*!(.*)!.*@.*>" u02
rule 3 request INVITE sip-header P-Asserted-Identity copy "<sip:.*!.*!(.*)@.*>" u03
rule 4 request INVITE sip-header CustomerNumber add "CustomerNumber: TEST"
rule 5 request INVITE sip-header CustomerNumber modify "CustomerNumber: (.*)" "Customer: \u01"
rule 6 request INVITE sip-header CustomerID add "CustomerID: TEST"
rule 7 request INVITE sip-header CustomerID modify "CustomerID: (.*)" "CustomerID: \u02"
rule 8 request INVITE sip-header CustomerName add "CustomerName: TEST"
rule 9 request INVITE sip-header CustomerName modify "CustomerName: (.*)" "CustomerName: \u03"
09-19-2024 06:51 AM
You did not use too many commands and I don't see a way to simplify. What you have written is straightforward and elegant.
Maren
09-20-2024 02:02 AM
I agree with @Maren Mahoney. You're solution is what you'd need to get all the three variables populated and modified as you want it to be. Maybe already known, but if not there is a SIP profile tester at Cisco CSA that you can use to verify your profile prior to putting it to the test in a router. You can find it here Collaboration Solutions Analyzer - SIP profile tester
I ran your profile through it with a made up SIP invite that had the your PAI value from you OP and it came out working and I couldn't find any way to make it neater with fewer lines.
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