Reputation: 173
I am trying to do something that I don't think is a common scenario using Google's DialogFlow api. I am writing an IVR that services inmates in prison.
Dialogueflow appears to assume that the mic is always on when receiving an incoming call. But when a call comes from a person housed in prison, they are using one of the prison system call systems which 'speaks' a pre-recorded message asking the receiver to press an 'accept,' 'reject,' or 'block,' digit before the mic on the caller's phone will be enabled and speech from the caller can occur.
I have set up the parameters for the 'Default Welcome Intent' with a few examples of these pre-recorded messages that are consistent with what the prison phone system will play for the receiver. It looks something like this:
"Hello, you have received a free call from Bob Jones, an inmate at Massachusetts Department of Corrections. You will not be charged for this free call. To accept this free call, press 1. To reject this free call, press 2. To permanently block this number from any future calls, press 3."
What I want the Default Welcome Intent to do is listen to this message, capture the accept digit to press and then 'press' it so that the caller's mic is enabled and then a true dialogue can be presented (main menu for the IVR, response capture etc).
I think that I would deliver back this dtmf tone through a 'custom payload' but the scenario for playing a tone doesn't seem to be an expected/available response.
The payload defines the result to be delivered as a json string and doesn't very much like what I'm defining.
{ "dtmf": {$param.accept-digit}} (syntax error message when this json is defined as the payload)
Does anyone familiar with Dialogueflow know how I might do this?
Upvotes: 0
Views: 590
Reputation: 54
I'm not sure if this is possible with Dialogflow, but you can write a simple app for that using Dasha.
Sample DSL (DashaScript) code:
start node root {
do {
#connectSafe($phone); //accept incoming call
}
transitions {
accept: goto accept on #messageHasIntent(["press_one_to_accept"]); //listen to the message and use conversational AI to understand that it says "To accept this free call, press 1"
}
}
node accept {
do {
#sendDTMF("1"); //make selection by sending DTMF code
}
}
Then you can design the rest of your conversation flow also using Dasha.
If you need any help, feel free to join our dev community or drop me a line at [email protected].
Upvotes: 1