10-12-2017 02:11 AM - edited 03-17-2019 11:21 AM
I'm trying to copy a SIP header and pass its value into a new SIP header. In CUBE I have:
voice class sip-profiles 2
request INVITE sip-header From copy "<sip:(.*)>" u01
request INVITE sip-header P-Asserted-Identity add "P-Asserted-Identity: <sip:\u01>"
But when the look at the debugs, the "\u01" isn't being replaced with the earlier value and the header looks like:
P-Asserted-Identity: <sip:\u01>
What am I doing wrong?
Thanks,
Gordon
10-12-2017 04:24 AM
First of all, I see that you're trying to accomplish what you've asked about in your other post. So over there I gave you a solution based on a LUA script on the CUCM itself.
But here, why aren't you using the "modify" instead of "add"?
Because the PAI header already exists in the SIP, so I don't think it is allowing you the add another one, therefore you see the PAI header not changed. So maybe try to delete it first after you copying it's value.
You can try something like:
voice class sip-profiles 2 request INVITE sip-header From copy "<sip:(.*)>" u01 request INVITE sip-header P-Asserted-Identity remove request INVITE sip-header P-Asserted-Identity add "P-Asserted-Identity: <sip:\u01>"
I didn't tested the above, but I think it may work.
10-12-2017 04:27 AM
But here, why aren't you using the "modify" instead of "add"?
Because, for some unknown reason, CUBE is removing the P-Asserted-Identity header. I see it in the inbound call leg, but on the INVITE to the SP, it's removed. Hence why I'm doing it as an add. But as I said, the add is working, it's just not replacing the u01 variable.
10-12-2017 04:34 AM
10-12-2017 04:42 AM
Verify that your CUBE configurations has "header-passing" under:
voice service voip
sip
Also, found another interesting article about allowing specific headers with CUBE. Take a look:
Search for: sip-hdr-passthrulist (cli command).
10-12-2017 04:49 AM
cube-dev-1(config-class)#passthru-hdr P-Asserted-Identity
Cannot add P-Asserted-Identity, It is mandatory/Invalid
10-12-2017 06:15 AM
You're right. But it makes me wondering, what's the point of sending the PAI to the ITSP?
I checked on my CUBEs and the behaviour is the same, means that's it meant to be.
The ITSP doesn't need your PAI information, so why are you trying to send it anyway?
10-12-2017 06:17 AM
My Telco is saying they need that header in there with just the DN, no name.
Gordon
10-14-2018 11:40 PM
Have you solve this issue?
11-01-2018 08:46 AM
Hi,
maybe you already solved but like I didn't see the answer, so I going to share what I found.
I don't know why when you "add", the copied variable doesnt work so I made that:
First I add P-Asserted-Identiy with any data (only to copy then) and then modify with the variable, like this:
voice class sip-profiles 2
request INVITE sip-header From copy "<sip:(.*)>" u01
request INVITE sip-header P-Asserted-Identity remove
request INVITE sip-header P-Asserted-Identity add "P-Asserted-Identity: 1234"
request INVITE sip-header P-Asserted-Identity modify "P-Asserted-Identity: 1234" "P-Asserted-Identity: <sip:\u01>"
You can use this tool to test it
https://cway.cisco.com/tools/SipProfileTest/
Regards
Pablo
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