Intelligent Management: SIP operands
We can use the SIP operands and their associated protocols in the subexpression utility builder, an optional tool that helps you build complex rule conditions from subexpressions by using AND, OR, NOT and parenthetical grouping.
Use the following subtopic links to find specific information:
Each work class contains an optional ordered list of rules that are evaluated for a particular request to determine the policy for that request. Each rule consists of a Boolean expression and a policy value. If the expression evaluates to true for a particular request, the policy associated with that rule is used.
The syntax and semantics of a Boolean expression for a rule are similar to the WHERE clause of a Structured Query Language (SQL) expression. More precisely, the syntax of an expression is defined by the Java Message Service (JMS) 1.1 specification. For more information about syntax and semantics of expressions, read about rule-based request classification.
In the JMS specification, identifiers refer to various attributes that can be associated with a request, for example, a specific query parameter, cookie, or HTTP header. A JMS identifier can be thought of as a request variable, or operand. These operands can be specific to a protocol. For example, the SOAP service name is an operand that is valid only in a SOAP work class.
Because the SOAP is over HTTP, the HTTP operands are also valid in a SOAP request. JMS specification uses literals to specify a specific value to use in a comparison to a request variable. For example, in the expression:
clienthost LIKE '%.ibm.com'
'%.ibm.com' is a literal used to compare to the client host name for a request. This expression is true for all requests that originate from a computer in the ibm.com domain. Enclose string literals by single quotes. Do not enclose numeric literals in single quotes. Parentheses together with the AND, OR, and NOT operators can also be used to form compound Boolean expressions. See the JMS 1.1 specification for a detailed description.
Operand Syntax Description
clienthost The fully-qualified client host name. This is the value of the internet protocol (IP) command host name. This operand does not support numeric operators such as >, >=, <, <=.
clientipv4 The IP address of the client using the Internet Protocol version 4 (IPv4) dotted quad address type n.n.n.n.
clientipv6 The Internet Protocol version 6 (IPv6) 128-bit address type of x:x:x:x:x:x:x:x following Request for Comments 1924 (RFC 1924) of the client computer.
The Contact header field.
The URI of the Contact header field.
The From header field.
From header display name
The display name in the From header field.
The URI of the From header field.
From URI host
The host in the From header field.
From URI port
The port in the URI of the From header field.
From URI user
The user in the From header field.
header $name A header name and value.
For example, the expression header$Host='localhost' tests a request to see if it contains an HTTP host header with a value of localhost. To test for presence or absence of the host header, use one of the following expressions:
header$Host IS NOT NULL header$Host IS NULL
percentage$val The percentage operand evaluates to true, a fixed percentage of the time.
For example, percentage$50 evaluates to true on average 50% of the time.
port The listening port on which the request was received.
The rampup operand evaluates to true a variable percentage of the time. It always evaluates to false before startTime and to true after completionTime. As time progresses from startTime to completionTime, it evaluates to true, a linearly increasing percentage.
The format of startTime and completionTime is day/month/year::hour:min:sec. where day is the day of the month, month is one of the twelve months: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec, year is the 4 digit year, hour is the 2 digit hour of the 24 hour clock, and min and sec are 2 digit values for minute and second, respectively.
For example, rampup$01/Jan/2007::08:00:00$01/Jan/2007::17:00:00 begins to occasionally evaluate to true at 8 AM on Jan 1, 2007 and always evaluates to true by ramp up completion time at 5 PM of the same day.
The transport of the request.
The request URI.
Request URI host
The host in the request URI.
Request URI port
The port in the request URI.
Request URI user
The user in the request URI.
Scheme of From header
The scheme of the From header field.
Scheme of To header
The scheme of the To header field.
Scheme of URI
The scheme of the URI.
serverhost The fully-qualified host name of the server. This operand does not support numeric operators such as >, >=, <, <=.
serveripv4 The IP address of the server computer using the IPv4 dotted quad address type n.n.n.n.
serveripv6 The IPv6 128-bit address type of x:x:x:x:x:x:x:x following RFC 1924 of the server computer.
The SIP method for the request. Possible values are INVITE, TRYING, RINGING, ACK, OK, and BYE. If the message is not a request, this operand returns null.
SIP response code
The response code of the response. If the message is not a response, this operand returns -1.
To client host
The client host in the To header field.
The To header field.
To header display name
The display name in the To header field.
The URI of the To header field.
To URI host
The port in the URI of the To header field.
To URI user
The user in the To header field.
Intelligent Management supports the operators in the following table in the rules expressions. These operators are also referred to as predicates in SQL terminology because they appear inside of a WHERE or HAVING clause. Operators are case insensitive.
Operator Description OR The logical OR operator. AND The logical AND operator. NOT The negation operator. IN Expresses an operand with multiple values in a single expression. Its meaning is consistent with the SQL standard meaning of the operator.
For example, to express that the port value could be any or all of the values such as 9080, 9090, 9091, use the expression fragment:
port IN (9080,9090,9091)
In SQL, how the values inside the parenthesis are expressed depends on the data type of port. If the port is an integer, the values without the single quotation marks are syntactically correct. If the port is a string, the correct expression is:
port IN ('9080','9090','9091')
Expresses pattern matching for string operand values. The value must contain the wildcard character (%) in the position where the pattern matching is expected to start.
For example, the expression:
host LIKE %blanca
matches the word blanca and any other word that ends in blanca, while the expression:
host LIKE blanca%
matches the word blanca and any other word that starts with blanca. The expression:
host LIKE %blanca%
matches the word blanca and any word that has the token blanca imbedded in it.
The java.util.regex.Pattern class is used.
= The equality operator expresses a match in case-sensitive match. > Greater-than operator for use with numeric operands. >= Greater-than or equal operator for use with numeric operands. < Less-than operator for use with numeric operands. <= Less-than or equal operator for use with numeric operands. < > Not-equal operator. BETWEEN Used with AND to select a range of values inclusive of the first (low) value and the last (high) value. Together, they operate on numbers and dates values. IS NULL Tests for an operand having a NULL value. IS NOT NULL Tests for an operand having a value other than NULL.
Rule-based request classification
Define a service policy Set maintenance mode Activating concurrent application editions Validating an edition
Intelligent Management: rules for ODR routing policy administrative tasks Intelligent Management: rules for ODR service policy administrative tasks