I am successfully able to recive inboud call on my webhook and it works nicely i got the automated voice of below text it is working good. however i am getting "Unexpected content type: text/html; charset=UTF-8" on events.
<cfset ncco = '
{
"action": "talk",
"text": "Press 1, for maybe, and 2, for not sure, followed by the hash key.",
"language": "en-US",
"style": 6,
"bargeIn": true
}'>
<cfhttp method="PUT" url="https://api.nexmo.com/v1/calls/#responsetxt.uuid#/talk" result="httpResponse">
<cfhttpparam type="header" name="Content-Type" value="application/json" />
<cfhttpparam type="header" name="Authorization" value="Bearer #jwtToken#" />
<cfhttpparam type="body" value='#ncco#' />
</cfhttp>
when I got inboud and pass the following ncco it doesnt work and call disconnected. but this works good with outbound call voice recorded and transcripted.
<cfset ncco = [
{
"action": "record",
"eventUrl": ["https://example.com/virrtualcall/input.cfm"],
"transcription":
{
"eventMethod": "POST",
"eventUrl":["https://example.com.com/virrtualcall/input.cfm"],
"language": "en-US",
"sentimentAnalysis": "true"
}
},
{
"action": "talk",
"text": "Please let us know what is your problem",
"language": "en-US",
"style": 6,
"premium": true,
"bargeIn": true
},
{
"action": "input",
"type": [
"dtmf"
],
"dtmf": {
"submitOnHash": true,
"timeOut": 10
}
},
{
"action": "talk",
"text": "Thanks for your response, goodbye.",
"language": "en-US",
"style": 2
}
]>
this is the oubound call works nice with above ncco i want this ncco something like should work with inbound call. Can someone help me out with this.
<cfhttp method="POST" url="https://api.nexmo.com/v1/calls" result="httpResponse">
<cfhttpparam type="header" name="Content-Type" value="application/json" />
<cfhttpparam type="header" name="Authorization" value="Bearer #jwtToken#" />
<cfhttpparam type="body" value='{"to":[{"type":"phone","number":"#toNumber#"}],"from":{"type":"phone","number":"#fromNumber#"},"ncco":#serializeJSON(ncco)#}' />
</cfhttp>
Thanks