Using Contact and Request URI Information to Match Incoming SIP Messages to Policies
You can filter incoming SIP messages by using the following methods:
- Using Regular Expressions to Match Incoming SIP Messages to Policies
- Using URI Hiding and Registration State to Select Incoming SIP Messages
Using Regular Expressions to Match Incoming SIP Messages to Policies
You can use regular expressions to match the information in the contact and request URI fields of incoming SIP messages. You configure the regular expressions in the from condition of new call usage policies and new transaction policies.
Table 18 describes the regular expressions supported for policies.
If you use parentheses or spaces in your regular expression, you must enclose the expression in double quotation marks.
Table 18: Regular Expressions Supported for Policies
Operator | Matches |
|---|---|
. | Any single character including a space |
* | 0 or more instances of a character or pattern |
+ | 1 or more instances of a character or pattern |
? | 0 or 1 instances of a character or pattern |
( ) | Group of expressions. |
| | One of the two terms on either side of the pipe |
[start-end] | Range of characters |
[^start-end] | One instance of any character that is not in the range |
[A-Za-z0-9_] | Any alphanumeric character |
Examples of Regular Expressions Used for VoIP Calls
Table 19 provides examples of regular expressions used in the request URI or contact fields of policies.
Table 19: Examples of Regular Expressions Used for VoIP Calls
Type of Information to Match | Example of Traffic to Match | Regular Expression Used |
|---|---|---|
Emergency 911 calls | 911 | “sip:911@.+ | tel:911” |
International calls | 011xxxxxxxx | “+:011[0-9]+@.+ | tel:011[0-9]+” |
Access to outside line | 9 | “sip:9[0-9]+@.+ | tel:9[0-9]+” |
Area code and 1 + dialing | 1 408/506 | “sip:(1(408|506)([0-9]+)@.+) | (tel:1(408|506)([0-9]+))” |
Emergency calls | x11 | “sip:[2-9]11@.+ | tel:[2-9]11” |
Domain name | @juniper.net | .*@juniper.net |
Using URI Hiding and Registration State to Select Incoming SIP Messages
A contact or request URI may or may not be hidden. When the URI contains a remote address, the URI is considered not-hidden. When it contains a local tag provided by the BSG, the URI is considered hidden. You can use either attribute to select incoming SIP messages for a new transaction policy.
You can also use the registration state of the contact or request URI in the from condition of a new transaction policy. This registration state is relative to the BSG. Users are considered registered when the BSG has an address-of-record entry for the user and not registered when the BSG does not have an address-of-record entry. For example, you could configure a policy to reject messages from unregistered users by choosing the registration state or to accept messages only from registered users (users for whom the BSG has an address-of record entry) by choosing the registered registration state.
Hide Navigation Pane
Show Navigation Pane
Download
SHA1