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
{{SipHeader_XXX}}
gives access to the full data of theXXX
SIP header.
For example,
{{SipHeader_Contact}}
will get the fullContact
header:<sip:10289.1809@19.72.1.107:36007;transport=UDP>;mode=1
.
The {{SipHeader_XXX}}
variable can be used for any type of headers. However, the following headers can be parsed automatically to get additional data, i.e. the user/host/cnam part of the URI.
From
To
Diversion
Remote-Party-id
P-Asserted-Identity
Contact
P-Charge-Info
Therefore, the following variables can additionally be used with those headers:
SipHeader_XXX_uri_user
{{SipHeader_XXX_uri_user}}
will get the user
parameter of the XXX
SIP header.
{{SipHeader_Contact_uri_user}}
will get the user
part of the URI, i.e. 10289.1809
.
SipHeader_XXX_uri_host
{{SipHeader_XXX_uri_host}}
will get the host
parameter of the XXX
SIP header.
{{SipHeader_Contact_uri_host}}
will get the host
part of the URI, i.e. 19.72.1.107:36007
.
SipHeader_XXX_uri_name
{{SipHeader_XXX_uri_name}}
will get the user-name parameter of the XXX
SIP header.
{{SipHeader_Contact_uri_name}}
will get John Smith
.
SipHeader_XXX_uri_p_YYY
{{SipHeader_XXX_uri_p_YYY}}
will get the YYY
URI-parameter of the XXX
SIP header.
{{SipHeader_Contact_uri_p_transport}}
will get UDP
.
SipHeader_XXX_h_p_YYY
{{SipHeader_XXX_h_p_YYY}}
will get the YYY
parameter of the XXX
SIP header.
{{SipHeader_Contact_h_p_mode}}
will get 1
.
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 ). |