Expandable Macro Variables

In some of the Transformations fields, we can use expandable macro variables. The system uses these variables to parse and process phone call information and replaces (expands) the variables in double brackets with actual values taken from the exact call.

Predefined expandable macro variables

Expandable Variable Value It Is Replaced with
{{src}} Calling phone number.
{{dst}} Called phone number.
{{RANDOM:min:max}} A function that returns a random integer value within the min:max range.
{{caller-rn}} The routing phone number for the source number.
{{rn}} The routing phone number for the destination number.
{{isup-oli}} The isup-oli param from the calling party.
{{cnam}} The source number CNAM.
{{cnam_to}} The destination number CNAM.
{{cic}} The Carrier Identification Code for calls to toll-free numbers.
{{orig_codec_src}} The list of codecs in the initial offer from legA. Contains only the codecs allowed based on trunk settings (this list can be filtered on the trunk using the codec attribute).
{{codec_src}} The list of acceptable codecs when negotiating with legA. By default, this list contains all the codecs from {{orig_codec_src}}, which are supported, and may also be optimized based on legB settings to reduce unnecessary transcoding.
{{codec_dst}} The list of codecs that will be offered to legB.

An example of a transformation with expandable macro variables:
set_header X-NewHeader {{src}}_{{SipHeader_X-OrigHeader}}

This would store the following into a new customer header named X-NewHeader: the original calling number, then the literal _, and then the value of the custom header X-OrigHeader.

Headers Access

Sip headers content can be parsed using the expandable macro variables.

Let’s review the following header as an example:

Contact: "John Smith" <sip:10289.1809@19.72.1.107:36007;transport=UDP>;mode=1

Therefore, the following variables can additionally be used with those headers:

Optional transformation-specified expandable macro variables

In the scope of the stir_validate transformation the call validation output is stored into the following 3 variables:

Expandable Variable Value It Is Replaced with
{{stir_attest}} The attestation level used for the call.
{{stir_verstat}} The ID of the call originator
{{stir_origid}} The TN validation result (available values include TN-Validation-Passed, TN-Validation-Failed, and No-TN-Validation).