<Set>
The <Set>
verb allows the developer to set variables. The variable is scoped to the call dialog, meaning once set it is available in subsequent XML and conditionals. Furthermore, any variables set using the <Set>
verb are provided on future webhooks via the Vars
field. The Vars
field is also populated in the call detail record (CDR).
Only string values are supported.
<Set>
Attributes
<Set>
supports the following attributes that change its behavior:
Attribute | Allowed Values | Default Value |
---|---|---|
history | disable , compact , full | disable |
output | string (maximum 50 characters) | none |
history
The history
attribute determines if the <Set>
verb should be logged in the history
array of the CDR. The default is to not log.
For <Set>
, both compact
and full
have the same effect of logging the following payload to the history
array.
{
"payload": {
"output": "position",
"value": "support"
}
}
output
The output
attribute represents the variable's name.
<Set>
Nouns
The variable's value is provided as plain text in <Set>
and has a maximum length of 50 characters.
<Set>
Examples
Simple Usage
Set a position
variable to mark that the caller has reached support then redirect to the transferToSupport
URL.
<Response>
<Set output="position">support</Set>
<Redirect>/transferToSupport</Redirect>
</Response>