Example 2 Stripping an Existing Parameter and Adding a New One
This example explains how to strip the user parameter from the Contact header URI and add the acme parameter with value as LOCAL IP, only for requests. First you create a header manipulation ruleset, in the example it is called param-stripper1. You then configure a list of header rules you need. In this case, you only need one rule named Contact (to match the Contact header name), with action set to manipulate (indicating the elements of this header would be manipulated). Next, you configure a list of element rules for the Contact header rule.
In this case you configure two element rules; one to strip the uri parameter user (the rule name user matches the param name user) and the other to add the uri parameter acme (the rule name acme matches the param name acme).
ORACLE# configure terminal ORACLE(configure)# session-router ORACLE(session-router)# sip-manipulation ORACLE(sip-manipulation)# name param-stripper1 ORACLE(sip-manipulation)# header-rules ORACLE(sip-header-rules)# name Contact ORACLE(sip-header-rules)# action manipulate ORACLE(sip-header-rules)# msg-type request ORACLE(sip-header-rules)# element-rules ORACLE(sip-element-rules)# name user ORACLE(sip-element-rules)# type uri-param ORACLE(sip-element-rules)# action delete-element ORACLE(sip-element-rules)# done element-rule name user type uri-param action delete-element match-val-type any match-value new-value ORACLE(sip-element-rules)# name acme ORACLE(sip-element-rules)# action add ORACLE(sip-element-rules)# type uri-param ORACLE(sip-element-rules)# new-value "$LOCAL_IP" ORACLE(sip-element-rules)# done element-rule name acme type uri-param action add match-val-type any match-value new-value "$LOCAL_IP" ORACLE(sip-element-rules)# ex ORACLE(sip-header-rules)# done header-rule name Contact action manipulate match-value msg-type request element-rule name user type uri-param action delete-element match-val-type any match-value new-value element-rule name acme type uri-param action add match-val-type any match-value new-value "$LOCAL_IP" ORACLE(sip-header-rules)# ex ORACLE(sip-manipulation)# done sip-manipulation name param-stripper1 header-rule name Contact action manipulate match-value msg-type request element-rule name user type uri-param action delete-element match-val-type any match-value new-value element-rule name acme type uri-param action add match-val-type any match-value new-value "$LOCAL_IP"
For example, if the IP address of the SIP interface ($LOCAL_IP) is 10.1.2.3 and the Oracle® Enterprise Session Border Controller receives the following Contact header:
Contact: <sip:1234@10.4.5.6;user=phone>
The header rule is applied to strip the user parameter from the Contact header URI and add the acme parameter with the value 10.1.2.3:
Contact: <sip:1234@10.4.5.6;acme=10.1.2.3>