Can outbound calls be made through Twilio TaskRouter - twilio

Currently we have a call center application that is built on Twilio Client for JavaScript (for the WebRTC call handling capabilities) and we have started to use Twilio TaskRouter for managing the workflows of incoming calls. We have incoming calls properly being routed to our TaskRouter Workers using the Twilio Client WebRTC client. We previously had outbound calling working through the Twilio Client library in our JavaScript client and this worked well. Now that Twilio TaskRouter has been added to the mix and there's the concept of current Worker activity, our outbound calls never actually dial out to an external phone number.
The TaskRouter documentation for assignment callbacks seems to suggest that outbound calling is quite doable using Twilio TaskRouter, but the documentation seems to frame the use cases to outbound calls from one WebRTC client to another WebRTC client using Twilio Client. We want to create an outbound call from a Twilio Client WebRTC worker to an external phone line (e.g. calling back a customer). I'm pretty sure this use case is supported within the realm of Twilio TaskRouter, but I was hoping others have definitive documentation to support how to perform that scenario.

Twilio developer evangelist here.
You're right, the documentation does show an outbound call being made from client to client, however calls to an external phone are certainly possible.
I believe you are referring to this "call" JSON response from the docs:
{
"instruction": "call",
"to": "client:jenny",
"from": "+15558675309",
"url": "http://example.com/agent_answer",
"status_callback_url":
"http://example.com/agent_answer_status_callback"
}
All you would need to do to change that to call a number is replace "client:jenny" with the number you wish to call.
{
"instruction": "call",
"to": "+15551234567",
"from": "+15558675309",
"url": "http://example.com/agent_answer",
"status_callback_url":
"http://example.com/agent_answer_status_callback"
}
Let me know if that helps.

Related

How to check status of a Twilio client before connecting call

I am using Twilio client to call my customer or receive the call from customers.
I want to play a busy voice message to customer if the Twilio client is engaged and talking to any other customer. how can I achieve that.
Twilio developer evangelist here.
You can’t tell the status of a Twilio Client from outside the page it is live on. Instead it is best to manage the availability of your agents via TaskRouter. With TaskRouter incoming calls can be queued until there is an available agent to answer. Those calls can also timeout, be assigned to other queues or be redirected to leave messages as in a voicemail system.
I recommend you look into TaskRouter.

Can I return a SIP 302 (Redirect) as a response to an incoming call to my Twilio app?

I would like my Twilio app to be able to redirect the inbound SIP INVITE to a different telephony system in some cases. We are not using Twilio's carrier but using our own (thinQ) for origination and termination via SIP.
I do not want to forward the call via the Dial command as it would keep the Twilio app in the loop during call setup.
Is is possible to do this?
Twilio developer evangelist here.
Twilio does not support returning a 302 redirect when receiving SIP as you describe.
When you set up to receive SIP and channel it through Twilio you need to respond to those incoming calls using TwiML and not SIP commands. Like you suggested, you could use a <Dial> which would direct the call elsewhere (including to other SIP addresses if you use <Sip>) but you cannot just respond with SIP instructions or a redirect.
If you do not want these calls to be handled by Twilio, then you will need to adjust your call routing before the SIP is sent to Twilio.

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.

Route Incoming Twilio Call to another Browser Client

An agent needs to route the active call to another agent.
I got one article to do with Node.js here. But, not sure what to do with Javascript client.
Can I modify an existing connection? Following is my code for accepting incoming calls.
Twilio.Device.setup(window.twilioToken);
// Handle incoming calls from Twilio
Twilio.Device.incoming(function (conn) {
conn.accept();
});
Now, one call is active on the browser. Is there any method to update the client based on Client SID?
Twilio developer evangelist here.
If you have multiple agents that you need to answer incoming calls using Twilio Client then you might want to take a look at Twilio TaskRouter.
TaskRouter is perfect for distributing calls to call center agents. It allows you to setup workers and workflows and turn incoming calls into tasks that are delivered to available workers. Check out the quickstart guide to TaskRouter and how to build a multi-channel support desk using TaskRouter.

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