cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2297
Views
0
Helpful
9
Replies

Copying SIp headers in CUBE

Gordon Ross
Level 9
Level 9

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

Please rate all helpful posts.
9 Replies 9

Slavik Bialik
Level 7
Level 7

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.


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.

 

Please rate all helpful posts.

I understand. Can you please post your CUBE configurations?

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:

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/voice/cube_sip/configuration/xe-3s/cube-sip-xe-3s-book/voi-conf-pass-thro.html

Search for: sip-hdr-passthrulist (cli command).

cube-dev-1(config-class)#passthru-hdr  P-Asserted-Identity
 Cannot add P-Asserted-Identity, It is mandatory/Invalid

Please rate all helpful posts.

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?

My Telco is saying they need that header in there with just the DN, no name.

 

Gordon

Please rate all helpful posts.

Have you solve this issue?

pabarnech
Level 1
Level 1

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