I have been working with Twilio Studio trying to build this IVR tree. I need a few requests that will go back to my main platform to check the caller_id of the line calling in and to verify_employee pin etc after the caller_id is verified.
I know there is an HTTP request widget that I can use to hit the endpoints on the main platform. But I am running into the issue where it's validating the number that's inputed. The person calling in will get verified then have to enter the 3 provider pin and 4 employee number. Right now I can input anything and it will go through onto the next option. Anything I can do to validate the numbers against the endpoint? or maybe I am just doing my tree wrong.
Off of the trigger I am using a http request to check the caller id of the person calling in. Then using a gather input widget to gather the pin #'s then using that to call the verify employee http request.
Any thoughts would be appreciated. Thanks!
The Twilio Split Widget based on the http response (and one more
later, based on the user input for their code...) should do the job.
Related
There's a lot going on, but I think I've narrowed it down to something simple. I hope someone can provide any kind of guidance as to what in the world I'm doing wrong.
I've got javascript voice (2.0) working with node.js. I can call inbound and outbound, and I can send a call from a studio flow to a javascript client. This all works. The issue is that when a javascript client user presses "reject" (out of the box example code) or the call isn't answered, it's just dropped. It doesn't return to the studio flow, and I suppose it isn't designed to.
To fix this, I am trying to get the call using the example for client.calls(call sid).update, and I can take the call and issue Say commands and play mp3 files as shown in the example. But when I try to return the call to the studio flow using the webhook url (with or without ?FlowEvent=return appended) it fails. I've tried using the twiml: syntax and providing valid twiml, and I've tried using the url: syntax and providing a url that produces valid redirect twiml (using the echo twimlet).
The URL I'm using is https://webhooks.twilio.com/v1/Accounts/{my_account_sid_here}/Flows/{valid_flow_sid_here}?FlowEvent=return (with and without ?FlowEvent=return at the end)
twiml like this;
<Response><Redirect method="POST">https://webhooks.twilio.com/v1/Accounts/{my_account_sid_here}/Flows/{valid_flow_sid_here}?FlowEvent=return</Redirect></Response> (with and without ?FlowEvent=return at the end)
I'm using the Parent Call Sid (the call sid for the stream never does anything so I assume that isn't the one to use) and the call, when updated, results in a voice message that says "We're sorry, an application error has occurred." I don't know if that is coming from studio or the twilio call processor. If I use the example url with the rick roll mp3 it works.
I've checked the debug messages and they seem to indicate that the flow webhook URL is returning a 400 status code. The documentation says to "To retrieve the Studio Webhook URL in your Studio flow, click the red Trigger widget. The URL starting with https://webhooks.twilio.com/v1/... is the Webhook URL for this Flow" and that's where I got the URL which includes the account sid and flow sid, which I've also checked for correctness.
I'm not sure what to try next.
I'm currently working on a project for a family friend that requires call forwarding in Twilio. I have a page that is linked to a MySQL database. The user will select an on duty team member from a dropdown, then click a forward button which needs to be able to set the on duty team members number as the forwarding number for a singular Twilio number.
This is the first time I've worked with Twilio and frankly I'm struggling with it. I've set up authentication and passed the number in using PHP. In Twilio studio I've attempted to set a variable to a value passed in by a REST API trigger and then have a connect call to that uses the variable, which currently isn't working.
When I set a variable in a flow, is it only set for that flow? Is it simply passing it through but when I dial the Twilio number, it's creating a separate flow that has nothing set in it? Has anyone done anything similar before?
When a customer dials my Twilio number, I need Twilio to first try to call my PBX system. Currently using 3CX. If the call is not answered by a person, I need to find a way to send that call back to Twilio and go to another resource. For my purposes, that resource is Twilio AutoPilot.
Basically, if a human doesn't answer the phone, I want the robot to try and help the customer instead.
The only thing I've been able to come up with so far is to create another Twilio number and have that number be the fallback within the PBX. The problem with that solution is with Twilio, you cannot mask the number to match the CallerID of the customer calling in, and I would really like to be able to know that number. Also you are creating 2 call paths, which could make this an expensive option.
The only other solution I could think of, which would use 3 calls paths, would be to use another provider that does allow me to mask the caller id, and then send that to the Twilio number.
I am not a programmer, I have basic coding knowledge, but just barely.
Any help would be appriciated. Thanks
You can use Programmable Voice with a SIP Dial to initially contact your PBX (it will appear the same way an Elastic SIP Trunk call will appear to your PBX). The easiest way is to use the Connect Call to Widget in Studio. If that call fails, say 3CX returns a 404 - Not Found, Studio can continue to the next Widget via the Connected Call Ended path which can then perform additional steps of your choosing. The CallerID is maintained this way as well.
Elastic SIP Trunking is not designed for this particular call flow but rather a simple conduit from/to the PSTN.
Happy Path
Fallback Path
We are working on a requirement where we are initiating a call from Twilio client SDK [Javascript]. We have an ASP.Net MVC Core application handling incoming Webhook request from Twilio Twiml app. To initiate a call from a client side, we are using Twiml dial verb and providing from and to number. Further our requirement is to send a voice message as soon as an answering machine is detected.
As we have used Dial verb of Twiml, we can't pass detect answering machine and hence can't send voice message. This is by design of Dial verb as it is an attended calling mechanism. After going through a documentation, I have found that, REST API allows to detect and answering machine and also allows sending a voice message. Twilio REST API shall be used for an unattended call initiation and rule based workflow. Twiml Dial verb uses VoiceResponse class to initiate a call whereas Twilio REST API uses CallResource to initiate a call.
I wanted to confirm my understanding before I start working on possible alternatives.
We are thinking of implementing above use case with below steps
Make a Twilio REST API call to initiate an unattnded phone call with answering machine detection option enabled.
If API responds with answered_by value as human or unknown then we will invoke a webhook that shall patch the call using Twiml Dial verb.
If API responds with answered_by value as machine then it shall use a Twiml which contains a voice message that can be sent to callee.
The above is correct. Is there a specific question, however?
Twilio’s Answering Machine Detection Now Generally Available
https://www.twilio.com/blog/answering-machine-detection-generally-available
We have developed an outbound call mechanism using TwiML app and Dial verb using Javascript SDK & ASP.Net Core MVC with Twilio SDK. We came across an issue where we found that answering machine detection and voice message drop is not supported by Dial verb. We are taking a different approach where we will use Twilio REST API to initiate a call. It has a provision to detect an answering machine and respond to an outcome of answering machine detection such as patching an agent or sending a voice message. Further, There are 2 possible configurations and workflows.
MachineDetection:Enable
Possible values for answered_by are machine_start, human, fax or unknown.
1.1 If value is machine_start then we can't send a voice message as it is not waiting for "beep" after which a voice message can be send.
1.2 If value is human then we can invoke a webhook for patching a user into current call.
1.3 If value is fax then we shall not take any action [Out of scope]
1.4 If value is unknown then we may patch a user to take action. This can be a deciding factor for making user productive. More number of requests ending in Unknown shall degrade the desired outcome.
MachineDetection:DetectMessageEnd
Possible values for answered_by are machine_end_beep, machine_end_silence, machine_end_other, human, fax or unknown.
2.1 If value is machine_end_beep then we can use a TwiML url to send a voice message to a callee.
2.2 If value is machine_end_silence then we can use TwiML url to send a voice message to a callee. Such scenarios needs to be handled with this default action and improved over period of time.
2.3 If value is machine_end_other then we can use TwiML url to send a voice message to a callee. Such scenarios needs to be handled with this default action and improved over period of time.
2.4 If value is human then we can invoke a webhook for patching a user into current call.
2.5 If value is fax then we shall not take any action [Out of scope]
2.6 If value is unknown then we may patch a user to take action. This can be a deciding factor for making user productive. More number of requests ending in Unknown shall degrade the desired outcome.
Rerference:
https://www.twilio.com/docs/voice/answering-machine-detection
https://www.twilio.com/docs/voice/answering-machine-detection#webhook-parameters
Based on above workflows we are deciding to use MachineDetection:DetectMessageEnd configuration option. We do have a query regarding point number 2.4. Below is a scenario,
We have made an API request to initiate a call with MachineDetection:DetectMessageEnd configuration. A callee has picked a phone and introduced himself/herself. Twilio has detected a human and set answered_by to human. This has triggered a webhood which as patched a user to current call. It is very much possible that a user who has joined the conference is not aware of who is at other end and can end up asking who is this? This may anoy a callee and affecting overall customer engagement.
This is the scenario shared by our client based on his experience.
I would like to know how fast Twilio can detect "answerd_by"?
Is there a mechanism that can allow a recording of a callee to be played after patching a call so that a user is aware of who is at another end. Is it something Twilio can provide or we need to use the recording feature to do so?
I understand that Twilio has various options to tweak AMD parameters through a Web API however, we may not have enough data to tweak them before the start of the project. We might get there after rolling this feature in production.
Also our client mentioned that sometimes, a voice message is not delivered completely?
Is this something observed by Twilio customers too?
If so what are the best practices to ensure this shouldn't happen?
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.