Mapping SIP Diversion Header into SIP To: field

Unanswered Question
Nov 24th, 2009

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

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
mspool Wed, 09/29/2010 - 05:18

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

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?

Steven Holl Thu, 09/30/2010 - 08:50

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.


This Discussion

Related Content