SIP profiles on Cisco CUBE: modify, add and remove headers

A SIP profile rewrites a message as it leaves or enters a Cisco CUBE. It is the tool for the last interoperability problem on a trunk: the carrier wants a header in a form the call manager does not send.

What a rule looks like

Each rule names the message it applies to, the header or SDP line, an action, and for a change, a pattern and a replacement.

voice class sip-profiles 100
 request INVITE sip-header From modify "@.*>" "@example.com>"
 request INVITE sip-header X-Trunk-Group add "X-Trunk-Group: east"
 request INVITE sip-header Cisco-Guid remove
 response 200 sdp-header Audio-Attribute modify "sendonly" "sendrecv"

Where to apply it

A profile applies to messages the CUBE sends. To change messages it receives, enable inbound profiles under voice service voip, sip and add the inbound keyword where the profile is applied.

Patterns and groups

Patterns are regular expressions in double quotes. Groups use plain parentheses and are reused as \1, \2. This is different from voice translation rules, where the parentheses need a backslash. A double quote inside a pattern is written \".

To carry a value from one header to another, a copy rule stores the matched text in a numbered variable, and a later modify rule writes it into the second header.

Why a rule does nothing

Check the result

Run debug ccsip messages and place one call. The debug shows the message as it was sent, after the profile ran. Compare it with the same message on the other leg to see the change.

Change one thing per rule and test each rule alone. A profile that grew by ten rules in one sitting is hard to trust.

Where Workbench helps

SIP Profile Builder writes the rules from a description of the change. SIP Profile Tester runs a profile against a real message and shows the message before and after, so you can test without placing a call. A profile pushed from Workbench is recorded with a backup and can be rolled back.