cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
861
Views
4
Helpful
4
Replies

How to add a SIP header to INVITE message on CUBE

CelalCelik
Level 1
Level 1

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,

4 Replies 4

Jonathan Schulenberg
Hall of Fame
Hall of Fame

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.

 

CelalCelik
Level 1
Level 1

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"

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

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.

image.png



Response Signature