5.5. Binding Rules together with Call VariablesΒΆ

Call Variables are a very powerful tool in the ABC SBC, because they can bind together different rules or rule sets. Call Variables can be set by rules to any value using the Set Call Variable action. This variable will the persist during the lifetime of the call. They can be set to a different value by a subsequent rule, again with the Set Call Variable action.

_images/10000000000003C500000059F8BD729C.png

Figure 1: Setting Call Variables

Values of Call variables can be tested with the Call Variable condition using several operators: ==, !=, “RegExp”, “does not match RegExp”, “begins with” and “doesn’t begin with”. Operands may be literal strings, regular expression if the “Regexp” operators are used, and they may contain Replacements (see Section Using Replacements in Rules).

An additional condition, “Call Variable Existence”, allows to test if a variable exists and accurately discriminate it from the case when it is empty-valued. This may be particularly handy when table lookups are used as described later in Section Provisioned Tables. Otherwise reference to undefined variables always returns empty string.

_images/10000000000003C5000000333F5BB435.png

Figure 2: Testing Call Variables

They can also be used in other actions using the replacement expression $V(gui.***varname*), ** where varname refers to the name of the variable, e.g. $V(gui.caller_group).

_images/10000000000003C700000052278DF5C6.png

Figure 3: Using Call Variables

The following example shows how a variable is assigned a value using the “Set Call Variable” action (see Figure Example for using Call Variables), tested for a specific value “restricted” (see Figure Testing Call Variables) and referred to from an action for adding a new Reason Header field using the $V replacement (see Figure Using Call Variables).

_images/10000000000003BF00000322740EB1E0.png

Figure 4: Example for using Call Variables

Previous topic

5.4. Using Regular Expression Backreferences in Rules

Next topic

5.6. SIP Routing

This Page