cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2675
Views
0
Helpful
3
Replies

Mapping SIP Diversion Header into SIP To: field

mspool
Level 4
Level 4

Does anyone know how to use SIP Profiles on a CUBE to map the SIP Diversion Header into the SIP To: field?

3 Replies 3

It looks like, according to the below note from the "Additional Configuration Notes" section in that doc, that this is not possible on the CUBE:

"Regular expression variables can be used to extract and store parameters from an existing header, but the values stored in variables in one rule can be used ONLY in the replace-pattern of the same rule; it can NOT be used by any other rules, which means you cannot insert the values extracted by one rule into another rule. "  (third bullet in http://www.cisco.com/en/US/products/sw/voicesw/ps5640/products_configuration_example09186a0080982499.shtml#notes)

Sounds like I can extract the number in the Diversion header in one rule but I cannot then use it to modify the To header in another rule.

Can anyone confirm this?

Correct.  You'd need a custom TCL to get a variable to store from one line to the next.

I have an idea, though.  I think you can get the regular expression for the diversion header to match the entire line.  If you craft the match string so that you group the number, but the whole string is matched for a replacement, I think you can use the modify function of the diversion header to rewrite the diversion: prefix as a to: prefix.  Then, simply use another statement to remove the original to: line.

It's crude, but it's worth a shot.