Twilio - Messaging Service Inbound Setting to Twilio Function instead of Webhook - twilio

I have a phone number that I configured the inbound messaging to run a Twilio function sends the message to the AWS SQS service.
But due to outbound traffic and other limitations, I setup a Messaging Service and I'm using the Passthrough API for bulk outbound. But for the inbound configurations for the Messaging Service, we are only limited to dumping the message, executing a webhook, or starting a conversation. I don't have the ability to run a Twilio function.
If I go back to the phone number configuration I can't have it both ways... it's either the Function or the Messaging Service.
Is there a way I can run a Twilio function on inbound messages to the Messaging Service or do I need to do this all in the webhook?

Twilio developer evangelist here.
When you choose Function in the inbound configuration for a number, it is just setting up the number to point to the Function's webhook URL.
So, you can enter the Function URL as the webhook URL for your messaging service and you shouldn't need to change anything else.

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.

Twilio Flex dashboard, trigger webhook when sending sms

When sending sms message from twilio flex dashboard directly, there is no webhook triggered , just wondering if there is a way to force webhook trigger for outgoing sms messages from twilio flex dashboard?
Twilio developer evangelist here.
I believe (Flex isn't my specialty, I'm afraid) that Flex uses Proxy to send messages. You could look into hooking into the Proxy service webhooks.
Alternatively, you could create a Flex plugin that triggers an HTTP request when a user sends an outbound message.

Twilio Flex, Intercept Incoming Messages in order to send Slack Notifications

I currently have Twilio Flex set up but need to intercept all incoming messages in order to send slack notifications to reps, if they're offline and need to respond.
Is there a way to intercept (using a webhook) only Incoming messages so that I can send those slack notifications.
Twilio developer evangelist here.
If you go into your Flex project to the Studio dashboard you will find three flows, including the Messaging Flow. Incoming messages are directed to this Flow.
If you open the Messaging Flow you will see that by default it sends the message straight to Flex.
You can add a widget in here to invoke a Twilio Function before sending the message onto Flex. Twilio Functions allow you to write Node.js to perform custom tasks, like sending a Slack notification.

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