Stash
Definition
Stores the varname and value for this call on the CallFire interface (in the Call Details Report). NOTE: the <stash> tag stores the contents of the variable in the Call Detail Report -- it does not make the contents available for later reference. To create a variable for later reference, see the <setvar> tag.
Value
The data string associated with this varname once the call has ended. The value may be a specific string or a reference to a CallFire system variable such as ${call.lastinput} or ${myrecording}. The tag also supports basic math and Boolean expressions in JavaScript.
Attributes
Attribute | Required | Values | Description |
---|---|---|---|
name | N | any text | A unique name for the tag |
varname | Y | any text | The name assigned to the variable |
Examples
The following example shows a menu where a user presses 1 and the system stashes a 1 into the variable "question1."
<dialplan name="Root">
<menu maxDigits="1" timeout="5500" name="my_menu">
<play type="tts" voice="female2" name="intro">Press one to save one. Any other key will repeat this menu...</play>
<keypress pressed="1">
<stash varname="question1">1</stash>
<play type="tts" voice="female2">You pressed one!</play>
</keypress>
<keypress pressed="default">
<play type="tts" voice="female2">You did not press one. Try again!</play>
<goto>my_menu</goto>
</keypress>
</menu>
</dialplan>
The following is a dynamic example. The menu asks for an input and the system will store whatever the user enters into the "question2" variable. The variable is then used in a get node to report back to their server.
<dialplan name="Root">
<menu maxDigits="1" timeout="5500" name="my_menu">
<play type="tts" voice="female2" name="intro">Press any key to send that value to the server. It could be a pin number for example</play>
<keypress pressed="1">
<stash varname="question2">${call.lastinput}</stash>
<get varname="getData">https://myurl.com?keypressvalue=${question2}</get>
</keypress>
</menu>
</dialplan>
Comments
0 comments
Please sign in to leave a comment.