Hi I'm having trouble trying to control an outgoing call that dials an extension before executing a few NCCO objects. Basically the use case is the following...
The issue that I am seeing is that I can successfully hear the dtmf tones playing, but it appears to be occurring at the same time as my NCCO objects returned from the answer_url. Basically step2 and step3 are occurring at the the same time. Is there anyway I can force the dtmfAnswer to play followed by the content from my configured answer_url?
Thank you!
Creating Outbound call
body = {
"to": [{"type":"phone", "number": "xxx", "dtmfAnswer": "ppp123ppp"}],
"from": {"type":"phone", "number": "xxx"},
"answer_url": ["testing-123-ngrok.io/answer"],
"answer_method": "POST",
"event_url": ["testing-123-ngrok.io/event"],
"event_method": "POST"
}
Sample NCCO returned from answer_url
NCCO = [{
"action": "talk",
"text": "Welcome to a Voice API I V R.",
"voiceName": "Amy",
"bargeIn": False,
},
{
"action": "talk",
"text": "Press 1, for maybe, and 2, for not sure, followed by the hash key.",
"voiceName": "Amy",
"bargeIn": True,
},
{
"action": "input",
"submitOnHash": True,
"eventUrl": [const.PUBLIC_HOST + "/answerbla"]
}]
I just wanted to update this comment as I got a workaround from talking with some implementation folks. It looks like there isn't a direct NCCO that you can create to delay the beginning of the answer_url content. However, there is an SSML element you can add to your leading talk NCCO since Nexmo supports SSML.
NCCOS = [
{
"action": "talk",
"text": "<speak><lang xml:lang='es-ES'><break time='10s'/>Hola</lang></speak>"
},
]
This will wait for 10 seconds before the Nexmo TTS starts saying "Hola". The duration you put in the time attribute can be pretty accurately be calculated via the length of the DTMF tones.