For Voice Use-cases, it's important to understand the behavior of the conversation is different to chat based conversations. Unlike most chat channels, there is a distinctive event that occurs when a conversation ends - the disconnection of the call!
This event can be triggered by either the bot or the user. If the bot disconnects the call, it is because the conversation reached a point in its design where the it was intentional for the call to end: e.g.
"I'm glad I could solve your problem today. Thanks for calling." <Call ends>.
However, on the contrary, the caller can end the call at any time during the conversation without warning. This means our flows need to be aware of when the event occurs as a best practice so we can track the event as part of the chatbot analytics and view it in the Cognigy Insights Step Explorer or record it as goal.
The event received when a caller disconnects the call is sent to the flow as a data message. The data format is the following:
This data is received by the flow under the input data object available in cognigyscript as:
The intent rule contains the following expression:
input.data.request.name == "disconnect"
You can also create a "Hangup" intent rule with the following expression:
input.data.request.name == "hangup"
By using the "helper flow" approach, your analytics data will be much tidier from the perspective that each time this intent is triggered you can end the call with the associated intent step and if necessary, perform a flow execution to overwrite odata analytics records with other conversation parameters.
Warning: The data object must be undefined in an Audiocodes Transformer for the Intent Rules to function.