Twilio Task Router , Reservation Changing Status - twilio

Following the tutorials to creation of a task router (Workspace,queue,worker,task) and task creation via a Phone Call.
I am able to successfully land the call and create the task via my node.js app.
After adding the Agent UI via tutorial #
Agent UI Add Project
Here is the application flow:
Customer calls Twilio number
Twilio Voice Posts to a Node.js Rest API
Twilio Voice Posts to a Node.js Rest API
Twiml generated and user gets Prompts
User chooses an option
Response is Posted to a Node.js API and task is created
The above steps are success
On the client
Agent launches the node.js app with taskrouter.min.js and agent.js as provided in the sample above.
Customer gets the default hold noise, on the agent browser a series of events "reservation created, update and reservation cancels" are observed. Posting the console logs towards the end.
Observation 1, customer gets the default Hold noise confirms that Task is created successfully via the App. Task also seen on the Twilio Admin GUI
Observation 2, Getting a sequence of Reservation,Update,Cancel events multiple times.Also Observed that the dateCreated, dateUpdated and dateStatusChangedare year1970 , 1970-01-17T17:52:39.413Z.
Any pointers would be greatly appreciated.
[Edit:]
I do see similar issues with the PHP Sample code as well. Found that the Date is not an issue.
[Edit:]
Reached out to Twilio Support, hoping to hear from them, no luck so far
[RESOLVED]
Heard back from twilio support, thanks twilio. Issue was with the Assignment Callback URL on the Workflow. My API was /Get. Changed it from Get to Post, to make it work. As the assignment URL was not reachable (via POST), task router was trying to cancel the reservation.

Twilio employee here.
This is result of TaskRouter being able to hit your AssignmentCallbackUrl with an HTTP POST request. We've noticed that on your Account there's this notification message:
Cannot POST /assignment
Please enable POST for your AssignmentCallback endpoint.
TaskRouter will actively cancel the reservation if it cannot hit your AssignmentCallbackUrl or there is an error when issuing an Assignment Instruction.
The several updates in the console are due to the fact that TaskRouter cancels the reservation due to not hitting the AssignmentCallbackUrl, moving the Worker back to the previous state (Available), and then trying to assign the Task again, and thus generating another Reservation for the Worker for the same Task (repeat 15x until the Max Task Assignment is hit).

Heard back from twilio support, thanks twilio. Issue was with the Assignment Callback URL on the Workflow. My API was /Get. Changed it from Get to Post, to make it work. As the assignment URL was not reachable (via POST), task router was trying to cancel the reservation.

Related

Twilio: Webhook not calling specified URL on phone number

Setting up to respond to SMS replies. I've gone to my Active Numbers page, selected the number (I only have one), gone to the Messaging Service section (again only one service) and in "A message comes in", I've specified the URL of one of our HTTP Handlers. It's a .Net Core handler that we use all the time. It will try to process anything sent to its URL:
https://ourserver/lmw/core/filemanager?SC=SMS
I send an SMS message to my personal number, reply "Help", and send that. Nothing hits that URL. I have it in the debugger and it catches anything I send it. It just doesn't get hit by the reply to the SMS message.
What am I doing wrong?.. or did I misunderstand how this works?
EDIT:
I found an "Integration" section in the Messaging Service. It was set to "Defer to sender’s webhook"... which sounds right but I changed it to "Send a webhook -- Invoke an HTTP webhook for all incoming messages"... which sounds like the same thing. Anyway, it didn't change a thing. I'm still not receiving a post on the http handler.
Please note that "Help" is a special keyword when using messaging services.
According to the Twilio Help Center:
Twilio does not forward HELP/INFO messages to your incoming message webhook by default. However, if you use Advanced Opt-Out for Messaging Services, Twilio does forward HELP/INFO requests to your inbound webhook.
This is not a good answer but I wanted to close this out. I started over and released my phone number and bought a new one. I went to Active Numbers and selected the new phone. In "A message comes in", I put my webhook url in both primary and primary fails and saved that.
I then went to Messaging, Services, and selected my service. In Integration, I clicked "Defer to sender's webhook" and then put the handler url in "Callback URL" and saved that.
I went to compliance and the first two were done but 3. Campaign Use Case was incomplete. I completed that.
In Opt-out management, I edited that and put in some of my own text.
After doing all this, I replied to the message and got a response in the handler. Not sure which one of these was the problem but doing it all over seemed to work. Sorry I can't provide a better insight.

botbuilder-timeout for Typescript Virtual assistant

We have Microsoft Virtual Assistant built it Typescript and we are planning to add Timeout capability. What this means is VA should end the conversation with its Skill if user is not engaged for certain amount of time.
There is botbuilder-timeout module to do this in V3 SDK which says,
"Module for Microsoft Bot Framework to enable your bot to prompt the user if the bot detects inactivity and ultimately end the conversation if no user activity after a defined period of time."
Is there anything in V4 or Virtual Assistant that offers similar capability ? If yes any ideas/pointers to document is appreciated.
There isn't anything official for V4 bots like this. I don't believe I've seen anything unofficial, either.
That being said, we generally recommend something like:
On each message, start a synchronous timer. You can do this in the bot, but it would be better to do outside of the bot, like with Azure Functions or something. The rest of this answer will assume the timer is outside of the bot. Ensure the timer also keeps track of the conversationReference related to the timer.
Restart the timer each time the user matching that conversationReference sends a message
Once the timer expires, send an event to the bot with the user and conversation information (maybe through ChannelData), letting the bot know the timer has expired. You could also create a separate endpoint and monitor there, so you don't need the activity scheme; instead of /api/messages, you could use something like /api/expiredTimers.
Once the expired timer event is received, send a proactive message to the user to either 1) see if they're still there, or 2) end the conversation.

What can be the reason of “Unable to find subscription with identifier” in Rails ActionCable?

We have the iOS Application in which we are using the action cable to give me fast response as user like something or comment on any post. Few days back everything is working fine. But from last few days action cable is not working. And my iOS application is live on the App Store. When ever my back end developer broadcast from her side. I will not get the response. When I hit the action cable multiple times. Then I get the single response out of 4 of them.
Now if any body help me what can I do right now.
What can be the reason of “Unable to find subscription with identifier” in Rails ActionCable?
[![> Unable to find subscription with identifier:
{"channel":"CommonChannel","auth_token":"zoRGfSZhS3mH6UxENVcJ"}]]1]1
We have a single channel in which we have multiple actions because I cannot subscribe the channel every time and then hit any function it makes me irritate to do every time subscribe the channel and then call the function.
Does any body has the solution for this issue. We have tried the wait loop as well after subscribing any channel.
Please anybody help me.
Thanks in advance.
Might be a race condition, see other question: What can be the reason of "Unable to find subscription with identifier" in Rails ActionCable?
In rails the issue (https://github.com/rails/rails/issues/25381) was supposed to be fixed, but maybe you found another way to trigger it.
Try to add some wait between the initial hello request and the subscription. If you are using graphql subscriptions, try to add a sleep between the actioncable subscription and the graphql subscription

Having a user click a link in a Slack Incoming Webhook Message and getting their response

I'm looking to have a user type something like
/makemeeting today # 4:00pm
this fires a outgoing webhook, which stores the info, then it fires a incoming webhook which would display a message in a channel saying meeting scheduled, and have two links
yes | no
Here's where I'm stuck. I can do everything up till this point. I'd love for any user to be able to click on one of those links and have it perform another outgoing webhook with the proper response.
I know I can just make those links point to a website, but I'd love to keep it all within slack without having to open a browser.
Is this possible? I swear I've seen yes|no, true|false replies before in other commands and bots, but I might be imagining that.
Any help would be appreciated...
thanks
This isn't supported yet but is on Slack's roadmap for the "near term".
https://trello.com/c/DVrJLbxX/12-interactive-messages
A work around is to add reactions to your message. When the user clicks the reaction (to bump up its count), an RTM event will be dispatched for you to handle: https://api.slack.com/events/reaction_added
An live example can be seen with the Meekan calendar app: https://meekan.com/slack/
So you could have two reactions: thumbs up and a thumbs down. And handle which reaction the user clicked.

What if the Twilio Browser Client user is afk? How to change a Ready device to Not Ready?

I must be missing something.
I've successfully set my web page so that the browser is ready to receive incoming calls using the code from the Twilio QuickStart guides, but I wanted to give my user the ability to set their status to "Not Ready to Take Calls" if they're afk for example.
Is there a way to do this?
I've looked at the documentation and the closest thing I can find is:
Twilio.Device.disconnectAll();
But disconnectAll doesn't prevent incoming calls.
I'm wanting something like the ability to set Presence but there's only a method to register a callback when a Client's Presence changes:
Twilio.Device.presence(function(presenceEvent) {...});
And Presence currently only changes when a Client is on another call. I want the Client to be able to set Presence to a state that means incoming calls aren't directed to it.

Resources