Twilio documentation says to set the outbound URL into the "Voice configuration Request URL" but I cannot find this field. Does everyone clueless about this?
(Basically repeating Alan's answer and comment with a bit more newbie angle, but I cannot comment yet as I don't have the required reputation)
The "A Call Comes In" action for your SIP Domain is, as Alan explains in his comment, for the calls originating from the endpoint or UA. Hence, the simple example TwiML routing the call to a e164 works here.
Calls originating in the PSTN are handled by the TwiML (or other action) set to handle calls coming in to your number, ie. in Programmable Voice -> Numbers -> Manage Numbers -> # -> A Call Comes In.
Choose, "A Call Comes In" and set the drop down to Webhook, then paste the URL into that edit box, click Save.
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.
I have some issues trying to pass a custom parameter to TwiML Bin. See attached pictures.
Everything works except the paramter.
Any ideas of what I am doing wrong?
Setup:
Twilio developer evangelist here.
ApplicationSID is from TwiML applications which are containers for a set of URLs and configurations that tell Twilio what to do when one of your Twilio numbers receives a call or SMS message.
If you're using dynamic content from custom HTTP request parameters (ie. name in this case), you should take your TwiML bin's URL and pass it the Name parameter like this in, for example, Python, to generate a call with the custom parameters:
client.calls.create(
url="your-twiml-bin-url?Name=Jeremy",
to="your-phone-number",
from_="your-twilio-phone-number")
We have implemented an IVR system which also redirects calls to a Call Center. The Call Center wants us to send relevant information in the custom SIP Header so that the IVR can pass custom information that will be useful to service the call without requesting the information entered in the IVR again.
I have tried to find documentation which clearly explains what is needed to be done but have had no luck.
Is it as simple a adding custom headers as SipHeader_X-headername=headervalue as part of the Voice response as mentioned in https://www.twilio.com/docs/api/twilio-sip/sip-twiml
or something else is required like the SIP URL as mentioned in https://www.twilio.com/docs/api/twiml/sip
Any direction/help will be really helpful.Thanks in advance.
UPDATE to question :
Configured an URL in Twilio to direct calls.Using Java based Microservice app using Spring Boot to service the URL calls. The below code snippet contains the Dial to the CSR.
String say = null;
Redirect redirect;
VoiceResponse.Builder builder = new VoiceResponse.Builder();
say = messageSource.getMessage("You are connecting to CSR", null,
Locale.ENGLISH);
builder.say(new
Say.Builder(say).voice(Voice.ALICE).language(Language.EN_US).build()).dial(new
Dial.Builder().number(new Number.Builder(number).build()).build());
response.setContentType("application/xml");
response.getWriter().append(builder.build().toXml());
Sounds to me like you are dialing out to a SIP endpoint so your extra parameters should look something like this from the docs you linked to:
$dial->sip('sip:jack#example.com?mycustomheader=foo&myotherheader=bar');
We are currently using Twilio's rest api to initiate calls. We want to use Twilios machine detection but are having issues. We want to fire off to a url no matter what the result and use the AnsweredBy to add some logic to return different twiml depending on whether it was answered by a human or machine.
we developing in C# and have the following code:
var call = CallResource.Create(
to,
from,
url: successfulCallUrl,
record: true,
machineDetection: "Enable"
);
but our url is only triggered if the call is answered by a human and not if it goes to an answer machine. we need it to be triggered no matter what the result of the call to determine what to do with it.
Your URL is requested when an outbound call is answered no matter what, the only difference is that if answering machine detection is on then an extra request parameter is supplied by Twilio. There is no scenario (as far as I'm aware) where Twilio will not request TwiML from your URL when a REST initiated outgoing call is answered.
What shows up as the request parameters in the request inspector for your voice logs? For calls answered by a human does Twilio supply an AnsweredBy parameter?
I just tried using the curl example on the Twilio site and let the call go to voicemail, in my console logs Twilio is posting to my call handling URL to retrieve my twiml with the following parameter, so what you want to do is technically possible.
AnsweredBy machine_start
Perhaps the answering machines you are calling are confusing Twilio and you need to reduce the timeout threshold? Maybe the C# syntax for enabling detection is different to yours? I don't know the answer, but your call logs will certainly yield a clue as to where to start.
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.