How to check status of a Twilio client before connecting call - twilio

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.

Related

How to initiate a 2 way SMS conversation between to validated phone numbers

We have the need to open an SMS conversion between clients and service providers. The thought is to send an initial request to the provider with a message from the client and then have the provider reply (and converse) directly with the client.
I've looked in the quick starts and the API docs but I don't see any clear pathway.
Am I missing some thing?
You can use a product like Twilio Conversations for that purpose. You add both as participants into a conversation. They communicate to each other via their assigned Twilio Proxy numbers.
Introducing Twilio Conversations: Now, every message becomes an invitation for a conversation
Using Twilio Conversations (Using Conversation You Tube Video - Signal 2019)

twilio stop receiving messages

We are using twilio service to send messages to our customers. We want to provide STOP receiving messages option to our customers.
So when a customer replies STOP, he/she should stop receiving messages. I think twilio has a blacklist to stop sending messages to a customer if the customers chooses to.
However, as an organization, we also want to know if a customer opted out of receiving messages.
How will twilio tell us that a customer opted out of receiving messages? How can we add a web hook such as a rest endpoint in twilio? Is this usecase possible in twilio?
Twilio evangelist here.
This article explains our default keyword handling: https://support.twilio.com/hc/en-us/articles/223134027-Twilio-support-for-opt-out-keywords-SMS-STOP-filtering-
tl;dr If someone texts STOP to your Twilio number we add them to our blacklist then pass the message on to you via the normal webhook process.
Hope that helps.

Identify forwarded calls

I'm very new at using Twilio. I just created my first flow using Studio, which forwards SMS and calls to my personal phone. Is there a way to differentiate forwarded inbound calls (business) from regular direct calls (personal)?
Thank you!
Twilio developer evangelist here.
I would edit the caller ID in the Connect Call To widget in Studio to be a different validated outgoing number so you know if it is that number, it is for business, as mentioned in this tutorial on call-forwarding with Studio.
You could also trigger the sending of a SMS message from Studio before forwarding the call or SMS message saying that the incoming message/call is for business.
We also offer the Lookup API in your console to find information like location, caller name, and carrier.
Hope this helps!

Twilio webhook backup solutions

I want to implement a Twilio webhook to receive sms responses for my initial sms message. However, instead of implementing the secondary "failover" webhook URL, is there a way to call a Twilio REST service to find out which webhook callback from Twilio to my service failed so my application can retrieve the failed message from the failed webhook call?
Thanks.
Twilio developer evangelist here.
I definitely recommend implementing a fallback webhook so that you can at least record failures and know whether to call this other service.
However, you can call the Twilio Monitor API to find out about Alerts. This is a service that will give you information on all webhooks and REST API calls that your application has made that failed or produced a warning of some sort.
Let me know if that helps at all.

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.

Resources