The GotoNode variable is a local variable used to route the call to different Nodes in the Call Tree. Disconnect a call by setting GotoNode to a blank at any Node.
When possible, the GotoNode variable is set prior to the Macro's execution by matching to responses that are available on the Responses tab. For more information on how the GotoNode variable is set before the macro executes, refer to Components of a Node and How They are Processed.
The VBScript Macro allows the GotoNode variable to be set, overriding the value that may have been set before the macro executes.
Use the GotoNode variable by setting its value to the name of the Node that should be executed next in the Call Tree. For example, the following piece of code from the Quick-Start Tutorial causes the call to return to the Answer_Phone Node if an invalid response was given:
' Did the caller press something besides 1 or 2?
If Answer_Phone <> "1" and Answer_Phone <> "2" Then
' Yes, this is a mistake. Let the user know!
Speak1 = "Your response was not understood."
' Send the caller back to the start node.
GotoNode = "Answer_Phone"
End If
Notice how the GotoNode variable is set to "Answer_Phone" to return the caller to the Answer_Phone Node. Changing the second to last line of the example to read:
GotoNode = ""
will cause the call to terminate after that Node has finished processing.
The GotoNode variable is always processed after the macro has finished executing: therefore, only the last value of the GotoNode variable is important. For example, the following piece of code does not result in the call being successively routed to two separate branches:
GotoNode = "First_Node"
GotoNode = "Second_Node"
In this case, since the last value of GotoNode is "Second_Node", the call will be routed to "Second_Node" and never to "First_Node".