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.


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.


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).


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).


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