Can twilio Programmable voice be integrated with Google's DialogFlow? - twilio

Is there a way to route a voice call to google Dialogflow (or Amazon Lex) ?
sequence:
Call comes into to a number
Twilio sends the voice input to endpoint (DialogFlow)
Text response is received from DialogFlow
Twilio streams voice (text to speech) back to caller
Note: This can be achieved using Google telephony. However, I would like to know if this is possible by using the twilio at the call handling layer ?

Twilio developer evangelist here.
You could do this using <Gather> with input="speech" to transcribe the caller's speech to text. When the live transcription is complete, Twilio makes a webhook request to the action attribute for the <Gather> with the SpeechResult as one of the parameters.
You can then send that text to the service you want to use (Dialogflow/Lex), which will respond with the response which you can then put into a <Say> element and respond to the webhook to speak the response.
If you're interested in building automated response bots like this, you might want to look into Twilio Autopilot which has the speech to text and NLP built in for phone calls and can also be used across messaging platforms and Alexa too.

Related

Get Whatsapp Number of user in Twilio autopilot

I am trying to create a chatbot using Twilio Autopilot which integrated with WhatsApp. So my flow is like, if user messages on registerd number, Twilio WhatsApp senders webhook will get trigger and it will call Autopilot chatbot task. Task will process the data and it will send reply.
In all above flow I want to capture the WhatsApp number of the user who is asking the question. that number I want in autopilot, so Autopilot will send that number to Twilio function and I want to save that number in my Database using external API's call from Twilio function.
How I will get WhatsApp number inside Twilio Autopilot chatbot for user who is asking questions?
Thanks in Advance
Autopilot can respond using static actions defined within the task, but it can also send a webhook request to fetch Actions JSON from your server. That webhook request contains details about the user you are talking with, including the parameter UserIdentifier which, in a WhatsApp chat, will be the user's WhatsApp number.
If you are currently responding to tasks from Actions JSON defined in the Twilio console, you can add a webhook by using a "redirect" action at the end of a set of actions to a URL you control and then responding to that with a "listen" action to wait for the next task. Alternatively, you could just set a URL for the webhook and respond with your Actions JSON from your own app.

Twilio > Google Ads Conversion tracking

Anyone here have experience in setting up Google Ads Conversion Tracking with Twilio.
Our Google technical support rep advised that we need to first add Google Dynamic Number Insertion on our landing pages and have that forward to our dedicated Twilio #.
I am just not sure if that would even work because Google Conversion tracking works off of the Click ID. I am confused as to whether or not Twilio captures the click id.
Wondering if anyone has set up conversion tracking with Google Ads and Twilio. And if so what process you would recommend to do this. TIA.
There is a blog on using Google Analytics with Twilio. For the voice channel, you will need to embed the URL query parameters into the Twilio phone number webhook associated with the Twilio phone number in your add.
You can use Twilio API's (IncomingPhoneNumber resource to do this).
When someone calls that phone number, Twilio will pass the parameters to you application.
Think as Twilio being the web client passing the Google Analytics parameters to your web server.
How to Capture Call Tracking Metrics in Google Analytics with Twilio Programmable Voice

HTTP GET request for user's phone number in fulfillment editor

We are setting up a chat bot through Dialogflow. A user will receive a weblink to the bot in a call or SMS sent through twilio. I'm wondering if it is possible for us to set up an HTTP get request to twilio in fulfillment so that we can set a context parameter to the user's phone number in the fulfillment inline editor in Dialogflow.
I took a look at twilio's api docs but could only find information on HTTP requests regarding numbers purchased or available for purchase through twilio.
So to clarify: in Dialogflow's fulfillment inline editor, we want to set a context parameter equal to the user's phone number that twilio called or sent the SMS to with a weblink to our chat bot.
Thanks!
Twilio developer evangelist here.
If I'm understanding right, you want to send a URL to a user via SMS (or over the phone?) which will link them to a web based chat with your bot. And you want to be able to link that chat back to the original phone number?
If that is the case, then the first thing that comes to mind for me would be to create a unique URL for each phone number you send this message to. If you store a link between the URL and the number it is sent to in a database somewhere, then when th euser clicks through to it you can recover the phone number and apply it to your Dialogflow context.
I don't believe you need to make any requests to the Twilio API for this aside from sending the initial SMS.
I hope this helps.

twilio rest API for event registration and listening

I'm using twilio rest API to implement a chat iOS app in objective-c. Though twilio has iOS SDK, I'm required to use rest API only. My question is does anyone know how to use twilio rest API for event registration and listening, such as message sending?
Twilio developer evangelist here.
The Twilio Programmable Chat API uses webhooks to notify your application of incoming messages. Note though that webhooks are not fired for events that are initiated from the REST API. Since you are in control of sending messages via the REST API you should be able to notify other parts of your application when you do so too.

change the voice for twilio number incoming call

We have a twilio number.
When ever any one call on that twilio number then there is an automated voice of twilio play. Can we customize this to a new message?
Thanks,
Rajendra
Twilio developer evangelist here.
You can customise Twilio calls as much as you want! I recommend you take a look through this QuickStart for handling incoming phone calls with Twilio which should get you up and running.
To quickly describe it though, you have a Twilio number and that number has a Voice Request URL configured in the number's settings. When you make a call to that Twilio number, Twilio makes an HTTP request to the URL. That URL needs to return TwiML (a set of instructions to Twilio in XML) which tells Twilio what to do with the call.
If you update the URL to something you control and then return different TwiML, then you can change the message and do a whole lot of other stuff with your Twilio number.

Resources