Creating SIP Header Manipulation Rulesets
To configure the SIP header manipulation ruleset:
-
In Superuser mode, type
configure terminal and press Enter.
ORACLE# configure terminal
-
Type
session-router and press Enter to access the session-router path.
ORACLE(configure)# session-router
-
Type
sip-manipulation and press Enter. The system prompt changes to let you know that you can begin configuring individual parameters.
ORACLE(session-router)# sip-manipulation ORACLE(sip-manipulation)#
- name—Enter the name you want to use for this ruleset.
-
header-rules—Define the header manipulation rules you want to include in this ruleset.
Type header-rules and press Enter.
ORACLE(sip-manipulation)# header-rules ORACLE(sip-header-rules)#
name—Enter the name of the header to which this rule applies. (The name you enter here must match a header name.)
This is a case-insensitive string that is compared to the header name for matching. You need to create a rule using the long form of the header name and a rule using the compact form of the header name.
Note:
The Request-URI header is identified as request-uri.action—Enter the action you want applied to the header specified in the name parameter. The default value is none. Valid options are:
-
add—Add a new header, if that header does not already exist.
-
delete—Delete the header, if it exists.
-
manipulate—Elements of this header will be manipulated according to the element rules configured.
-
store—Store the header.
-
none—No action to be taken.
match-value—Enter the value to be matched (only an exact match is supported) with a header value. The action you specify is only performed if the header value matches.
msg-type—Enter the message type to which this header rule applies. The default value is any. Valid options are:
-
any—Both Requests and Reply messages
-
request—Request messages only
-
reply—Reply messages only
Type show to display the header rule configuration values.
-
-
element-rules—Define the element rules you want to use to be performed on the elements of the header specified by the header rule.
Type element-rules and press Enter.
ORACLE(sip-header-rules)# element-rules ORACLE(sip-element-rules)#
name—Enter the name of the element to which this rule applies.
Note:
The name parameter usage depends on the element type you enter in step 6. For uri-param, uri-user-param, and header-param it is the parameter name to be added, replaced, or deleted. For all other types, it serves to identify the element rule and any name can be used.type—Enter the type of element on which to perform the action. The default value is none. Valid options are:
-
header-value—Enter value of the header.
-
header-param-name—Header parameter name.
-
header-param—Parameter portion of the header.
-
uri-display—Display of the SIP URI.
-
uri-user—User portion of the SIP URI.
-
uri-host—Host portion of the SIP URI.
-
uri-port—Port number portion of the SIP URI.
-
uri-param-name—Name of the SIP URI param.
-
uri-param—Parameter included in the SIP URI.
-
uri-header-name—SIP URI header name
-
uri-header—Header included in a request constructed from the URI.
-
uri-user-param—User parameter of the SIP URI.
action—Enter the action you want applied to the element specified in the name parameter, if there is a match value. The default value is none. Valid options are:
-
none—No action is taken.
-
add—Add a new element, if it does not already exist.
-
replace—Replace the elements.
-
delete-element—Delete the specified element if it exists. Based on the match value if entered in step 6f.
-
delete-header—Delete the specified header, if it exists.
-
store—Store the elements.
match-val-type—Enter the type of value that needs to be matched to the match-field entry for the action to be performed. The default value is ANY. Valid options are:
-
IP—Element value in the SIP message must be a valid IP address to be compared to the match-value field entry. If the match-value field is empty, any valid IP address is considered a match. If the element value is not a valid IP address, it is not considered a match.
-
FQDN—Element value in the SIP message must be a valid FQDN to be compared to the match-value field entry. If the match-value field is empty, any valid FQDN is considered a match. If the element value is not a valid FQDN, it is not considered a match.
-
ANY—Element value in the SIP message is compared with the match-value field entry. If the match-value field is empty, all values are considered a match.
match-value-—Enter the value you want to match against the element value for an action to be performed.
new-value-—Enter the value for a new element or to replace a value for an existing element. You can enter an expression that includes a combination of absolute values, pre-defined parameters, and operators.
-
Absolute values, with which you can use double quotes for clarity. You must escape all double quotes and back slashes that are part of an absolute value, and enclose the absolute value in double quotes.
For example:
sip:”+$TRUNK_GROUP+”.$TRUNK_GROUP_CONTEXT
-
Pre-defined parameters always start with a $. Valid pre-defined parameters are:
Parameter Description $ORIGINAL Original value of the element is used. $LOCAL_IP IP address of the SIP interface on which the message was received for inbound manipulation; or sent on for outbound manipulation. $REMOTE_IP IP address the message was received from for inbound manipulation; or being sent to for outbound manipulation. $REMOTE_VIA_HOST Host from the top Via header of the message is used. $TRUNK_GROUP Trunk group is used. $TRUNK_GROUP_CONTEXT Trunk group context is used. -
Operators are:
Operator Description + Append the value to the end. For example: acme”+”packet
generates acmepacket
+^ Prepends the value. For example: acme”+^”packet
generates packetacme
- Subtract at the end. For example: 112311”-”11
generates 1123
-^ Subtract at the beginning. For example: 112311”-^”11
generates 2311
Examples of entries for the new-value field.
$ORIGINAL+acme $ORIGINAL+”my name is john” $ORIGINAL+”my name is \”john\”” $ORIGINAL-^781+^617
Type show to display the element rule configuration values.
Type done to save them.
Repeat steps 6b through 6j to create additional rules.
Type exit to return to the header-rules parameters.
-
-
methods-—Enter the SIP method names to which you want to apply this header rule. If entering multiple method names, separate them with commas. For example:
INVITE,ACK,BYE
This field is empty by default. If you leave the method field empty, the header-rule is applied to all methods.
- Type exit to return to the sip-manipulation level.
- Save your work using the ACLI done command.
- If you want to save this configuration, exit out of configuration mode and type save-config.