In the twilio web interface, when I look at a specific call, I can see all the associated requests under the request inspector. Is there any way to retrieve this data via the REST API?
Specifically, I'm trying to retrieve the 'Digits' parameter to see what a caller dialed in response to a <gather>
Twilio evangelist here.
There is currently no way to download the entire HTTP request/response using the API. This is something you would have to log yourself as the call is occuring. If you save the call sid at the same time as the Digits, that would allow you to tie those digits back to a specific call.
Hope that helps.
Related
I'm using the Twilio C# SDK to initiate an outbound call from Twilio, during which user's DTMF input needs to be gathered (Press 1 to be transferred to sales, 2 for support...), and the subsequent action is to forward the call to a designated E164 number that matches the key.
So the VoiceResponse.Gather() method takes this action parameter that is a webhook Uri to which the user input will be posted and we can surely forward the call from there.
var twiml = new VoiceResponse();
twiml.Say("...");
twiml.Gather(numDigits: 1, action: webhookUri);
But is there a way to achieve this simple forward instruction within the current twiml object without involving an external webhook? Basically something that gathers the user input digit, correlates to a E164 number(using a predefined dictionary), then Dial directly.
Twilio developer evangelist here.
No, there is not a way to achieve the instruction after the <Gather> without another webhook. You must pass a URL as the action parameter and respond to the webhook with the next set of TwiML to direct the call onward.
If you do not want to host the application that responds to this webhook yourself, you could achieve this flow using Twilio Studio, which is a drag and drop editor for communications flows, or using Twilio Functions, which is a serverless environment where you can respond to incoming HTTP requests with JavaScript functions.
When i make a call as voice content to that call, can i send a dynamically generated twiml message rather pointing to a URI that contains twiml message ?
If not is there a a workaround to accomplish this , cause I see DIAL and SAY APIs which get used during call response, so would it be possible to make use of those when creating a new call and passing twiml messages using these APIs ?
https://www.twilio.com/docs/api/twiml/dial
https://www.twilio.com/docs/api/twiml/say
Twilio evangelist here.
Its not possible to send TwiML to the REST API. If you don't want to host the TwiML on your own URL there are a few options:
Use TwiML Bins which lets you host relatively static (there is some templating support) TwiML on Twilios servers.
Use Twilio Functions which let you write, store and execute Node on Twilios servers
Use Twilio Studio to define your call flow. A flow in studio can be triggered via an HTTP request to it, so you can take the flows URL and pass it to the REST API when you start your outbound call.
Hope that helps.
Need some Twilio help. I am a novice and I'm kinda lost. This may seem overly simplistic BUT I have a CRM client that will track calls as long as the inbound calls ping the URL - x2vps.com/index.php/api/voip/data/{caller id goes here}
Note: The CRM will automatically track all registered phone numbers that ping this URL.
I have the call routing piece figured out. I can't figure out how to code twilio's API to append the inbound caller ID's to the CRM's URL and ping it. I want to log all calls regardless of the status.
If you could point me in the right direction I would be truly appreciative.
Thank you!
Twilio developer evangelist here.
Twilio does not append the caller ID to the webhook URL that you set. In order to do something like this, you'd need to provide some sort of server in the middle that can transform the Twilio request into the format you need.
You'd do this by creating a web application that would be able to receive the webhook from Twilio. It would then need to get the incoming Caller ID from the Twilio request, this is the From parameter. With the Caller ID, your application would then construct your CRM endpoint URL and make the HTTP request itself. You'd need to decide whether you need to include all the original parameters, if the CRM system can use them.
Let me know if this helps.
It's not listed anywhere if Answering machine detection will send parameter "AnsweredBy" in request when a number is dialed from within a connected call with 'Number' node.
I think it doesn't send any such parameter because i'm getting nullpointer exception when i do request.getParameter("AnsweredBy") number dialled by 'number' node inside 'dial' node.
Is it that twilio hasn't implemented Answering machine detection fully? or is there any way i can make it work
Twilio Evangelist here. I'm afraid that currently the AnsweredBy parameter is only available when making an outbound call with the Twilio REST API. If you make the outbound call using TwiML's <Dial> then you will not get this parameter.
Depending on your application, if you can use the the REST API instead of TwiML to initiate the call, then you should be able to get this work as you need. But I would need a little more information on what your call flow is to provide any help.
I have a scenario to make a call through twilio. When I call the twilio, it gives me multiple options to connect just like a conventional IVR. Then I select a specific contact to through my call, Twilio makes me connected to the selected contact successfully. When I fetch the call duration, it returns me the whole time span, from IVR start to call ending.
Is there any option to fetch the call duration of the call with selected person.
Please reply soon.
Twilio evangelist here.
Sure. It sounds like your probably using the <Dial> verb to dial a number number from your IVR. In that case you can use the action parameter of that verb.
The URL set in the action parameter will be requested when the person you <Dial>ed ends the call. In that request, Twilio includes a few extra parameters, including one called DialCallDuration:
http://www.twilio.com/docs/api/twiml/dial#attributes-action-parameters
Hope that helps.