cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3119
Views
15
Helpful
6
Replies

CUBE - SIP Profile Diversion Header

Jesse3620
Level 1
Level 1

Hi Everyone, 

 

I want to create a SIP profile that essentially takes the number in the From field of an INVITE and adds a Diversion header with this number for all outbound calls from our CUBE to our ITSP. 

I found this example from a Cisco Doc and a previous forum post: 

request INVITE sip-header From modify “(.*sip:1234@.*)” “\1\x0D\x0ADiversion: <sip:5678@example.com>”

 Using this example, I want '1234' and '5678' to be the same variable. So, we would receive the INVITE w/ the calling number 5551234567 in the From field and then add a diversion header <sip:5551234567@example.com> while the From field remains intact. 

 

Can something like this be done just using a SIP profile? I've been messing around with the SIP-Profile Test Tool today and I can get the static configuration to work; I just cannot get the dynamic portion to work like I want. 

 

Please let me know if I need to clarify any of this. 

 

Thank you, 

2 Accepted Solutions

Accepted Solutions

Rajan
VIP Alumni
VIP Alumni

Hi Jesse,

 

If you see Diversion header already in the Invite, then you can use the below to copy the value from From header and update the same in Diversion header.

 

voice class sip-profiles 1

request INVITE sip-header From copy "<sip:(.*)@.*" u01

request INVITE sip-header Diversion copy ".*<sip:(.*)@.*" u02

request INVITE sip-header Diversion modify "(.*)<sip:.*@(.*)" "\1<sip:\u01@\2"

 

You can refer some sample usage of SIP profiles in the below link and create one based on your requirement:

 

https://www.cisco.com/c/en/us/support/docs/unified-communications/unified-border-element/118825-technote-sip-00.html#anc11 

 

HTH
Rajan
Please rate all useful posts by clicking the star below and mark solutions as accepted wherever applicable

View solution in original post

Adding to your answer, would it not be possible to add this to the SIP profile to add the diversion header if it doesn’t exist?

request INVITE sip-header Diversion add "(.*)<sip:.*@(.*)" "\1<sip:\u01@\2"



Response Signature


View solution in original post

6 Replies 6

Rajan
VIP Alumni
VIP Alumni

Hi Jesse,

 

If you see Diversion header already in the Invite, then you can use the below to copy the value from From header and update the same in Diversion header.

 

voice class sip-profiles 1

request INVITE sip-header From copy "<sip:(.*)@.*" u01

request INVITE sip-header Diversion copy ".*<sip:(.*)@.*" u02

request INVITE sip-header Diversion modify "(.*)<sip:.*@(.*)" "\1<sip:\u01@\2"

 

You can refer some sample usage of SIP profiles in the below link and create one based on your requirement:

 

https://www.cisco.com/c/en/us/support/docs/unified-communications/unified-border-element/118825-technote-sip-00.html#anc11 

 

HTH
Rajan
Please rate all useful posts by clicking the star below and mark solutions as accepted wherever applicable

Adding to your answer, would it not be possible to add this to the SIP profile to add the diversion header if it doesn’t exist?

request INVITE sip-header Diversion add "(.*)<sip:.*@(.*)" "\1<sip:\u01@\2"



Response Signature


Thanks for your responses. I'll try these out when I get the opportunity and report back. 

Jesse3620
Level 1
Level 1

In case anyone comes across this in the future and wants to reference this, I finally found a config that works (for my use case). Essentially, I used both of your replies and created a sip profile paired it with a Sip copylist, where 'x.x.x.x' is the IP address that I'm not explicitly including here:

 

voice class sip-profiles 101 (apply to outgoing Dial peer to ITSP)

 request INVITE peer-header sip From copy "<sip:(.*)@" u01

 request INVITE sip-header Diversion add "Diversion:<sip:\u01@X.X.X.X>"

 request INVITE sip-header Diversion copy ".*<sip:(.*)@.*" u02

 request INVITE sip-header Diversion modify "(.*)<sip:.*@(.*)" "\1<sip:\u01@\2"

 

voice class sip-copylist 101 (apply to incoming Dial peer from CUCM)

 sip-header From

 

Again, thanks for the help Rajan and Roger!

 

 

 

Great to hear that you managed to get it to work and thank you reporting back to the community for the full solution of your inquiry.

Please remember to mark your question as answered so that it’s easier for anyone else to use it as a solution.



Response Signature


Hi Jesse,

 

Glad we are able to help. Thanks for the confirmation.