we are using Twilio Voice and Google Dialogflow and their NodeJS SDk.
Once the default fallback intent has been triggered in Dialogflow, we are executing the Webhook to our Server - this should connect the caller with a real human.
- Webhook is not a problem
- How can we redirect/connect the current call with a number, specified by us?
I have read the documentation but I was not able to find a solution.
This is something we have tried so far:
twilioClient.calls
.create({
url: 'https://ourdomain.de/redirect-xyz.xml', instructions
to: numbertoCall,
from: '+ourPhone'
})
.then(call => console.log(call.sid))
.catch(error => console.log(error));
The xml file simply contains
<Response>
<Dial>
<Number>+NumberWeWantToCall</Number>
</Dial>
</Response>
I only get "An application error has occured. Am i missing something? Can someone help me with a solution?
I highly appreciate it, thank you!