Debugging
Since building a voice bot with multiple stages can be error prone, it is possible to inspect the bot state using the call transcript/chat history as well as the web hook logs.
Inspecting Bot State and Stack
In the call transcript/chat history, the webhook state as well as the stack can be inspected with every conversation turn as shown below:

Furthermore, the state such as paramters passed and returned from function calls can be inspected in the web hook logs as shown below:

Logging Custom Messages
In addition to the inspection of the state and stack, it is also possible to perform custom logging in order to trace back issues. To use message logging, call in any Javascript function the log()
function as shown below:
function myFunc(params) {
log(params);
return ({ "text": "Today is " + new Date().toLocaleString() });
}
The logged message will then appear in the web hook logs for function calls.