Twilio number to another twilio number call, gathered text truncated - twilio-api

We want to build two application using two twilio numbers communicating each other.
Background: one is a chatbot test framework, other is a IVR mock, to help developing the chatbot test framework.
We want to build such a simple call:
Number 1 calls Number 2, Number1 waits for answer.
Number 2 sends some greetings, and waits for answer
Number 1 gots answer, responds, and waits
Number 2 gots answer, responds, and waits
...
We have made the applications, they are working wonderful if they are communicating with human. But not with each other.
What we see:
Number 1 calls Number 2, Number1 waits for answer.
Number 2 sends some greetings, and waits for answer
Number 1 gots answer _BUT_TRUNCATED_, responds, and waits
Number 2 does not got the answer, twilio sends a call_ended event
We have simplified the situation, reproduced it using two twiml's created by Twilio console:
Number 1 calls Number 2, Number1 waits for answer with a simple gather:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather input="speech"/>
</Response>
Number 2 sends Welcome, and waits for answer
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Welcome</Say>
</Response>
Number 2 gots just "Well"
It is not a Text to Speech, or Speech to Text problem, always the end is truncated (I suppose the gather is not working well, gathers truncates, and TTS gots the truncated voice)
We already tried twilio support, but they are not able to help

Twilio supports just human to twilio conversation. (not twilio to twilio, or machine-voice to twilio conversation)
verb does not work for twilio to twilio conversation
verb does not work with verb in twilio to twilio conversation (Say started earlier somehow as Gather. Adding 1s silence at the start of the say may do the trick)
verb does not work in twilio to machine-voice conversation. (Reason, workaround not known)
And there can be other problems too. Twilio is planned to Twilio-to-Human conversations.

Related

Is is possible to create a custom messenger bot on Facebook?

I would like to know that we are having a lead generation campaign running on Facebook but few of the times our staff isn't available to answer the query on Facebook messenger, so based on that short-coming I am thinking to devise a mechanism that "If within 1 hour of user's message no one replies to him then an automated BOT message should get sent to him."
Please don't deprecate this question as it is based entirely on knowledge. And if perhaps someone has hints or links on how to achieve this thing then I will really appreciate it.
Thanks.
Some options:
You can query your /conversations edge every X minutes to detect when there is a message from a user which has not been replied to, then you would send the automated message using Send API.
https://developers.facebook.com/docs/graph-api/reference/v10.0/conversation
https://developers.facebook.com/docs/messenger-platform/reference/send-api/
You can use webhook data for incoming messages to create a task that will run at received_time + 60 minutes, find the thread in your conversations edge based on PSID and then check if there has been a reply
Alternatively you can check out Handover Protocol which allows a Page to simultaneously use a Messenger Bot and Live chat agent to handle messaging
https://developers.facebook.com/docs/messenger-platform/handover-protocol/

Hangouts Chat bot to post timed message

I can see from this, that a bot can send a message in chat, and if supplied a thread ID that does not exist, will start a new thread and post there. I am wondering if there is a way, given the current REST API or any other compatible with Hangouts, to send a message to a room at a given time of day, rather than when the bot is called or interacted with.
I am working in NodeJS, deploying my project in the GCP.
My apologies for the ambiguity of my question, I am trying to wrap my mind around the GCP environment.
In the bots documentation there are described the three ways in which a bot can send a message to a room. Those are:
Every time the bot is mentioned.
When the bot enters a room for the first time.
When the bot is taken out of the room.
Unfortunately, none of them is a daily message at a given time. If you still have questions, please ask them freely.
We have a working bot (NodeJS based) which sends messages freely. Just use this endpoint https://developers.google.com/hangouts/chat/reference/rest/v1/spaces.messages/create .
Your bot must be invited to the particular space/room for this. You can create threads as well with new and subsequent messages.
We also have bots written in Google Apps Script and there it is also possible.

Google Assistant ends conversation

We're currently testing our chatbot project for Google Assistant/Google Home.
In the middle of the conversation, when our bot still has "things to say" (our chatbot flows are based on several steps and not just one question and one short answer), Google Assistant throws you out of the chatbot and goes back to the generic Google Assistant. Does anyone know if this is a feature of the testing version or if this is caused by the way Google Assistant works?
there is a 5 second timeout on Dialogflow fulfillment responses so if it takes your chatbot more than 5 seconds to respond, it will show the response that is defined in Dialogflow
There are 3 things that are most probably causing your app to exit in the middle of the conversation.
You webhook/fulfillment is encountering an error that is not handled.
The response that you are returning is exceeding the max limit of characters that Google supports.
A timeout is happening for your webhook because DialogFlow will wait for 10 seconds for your fulfillment to return a response or else it will end the conversation on its own.
Hope this helps.

In which format I should send http POST to Bot Builder?

I was trying to built a bot which interacts with multiple users.
The Microsoft Bot Builder seems nice to me.
I followed their examples and tried them out.
Bot Builder Restify and so on
There are few things which are not clear to me.
How can I post a message to bot rest endpoint?
The emulator seems to have been taking care of such details. But in a real application, in which format i should sent a message?
How does the bot interacts with multiple users? In the emulator, there is only one user, what happens if there are several persons talk to the bot at the same time in a real application?
I think "chatconnector" somehow doing the job, but I am not sure.
I hope someone could point out examples or give answers below to clarify these to me.
Thanks in advance!
1) Messages are sent using industry-standard REST and JSON over HTTPS. Although you can call the bot's endpoint directly, this would bypass channels and security. In the Microsoft Bot Framework architecture, clients communicate with a channel connector and the channel connector calls the bot. When the bot responds, it sends a message to the channel connector and the connector calls the client. The channel connectors transform messages from the channel's specific schema to the Bot Framework's generic activity schema and back. They also verify that callers are authorized using JWT tokens.
This documentation on Authentication might help clear things up some: https://learn.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-connector-authentication
2) Group conversations are handled differently, depending on the channel. This sample demonstrates some of the group conversation features in the Bot Builder Node sdk: https://github.com/Microsoft/BotBuilder-Samples/tree/master/Node/core-GetConversationMembers

SMS Facebook like count when reaching a threshold

I am looking for a way to automatically send SMS updates when a Facebook page is reaching a certain like count. I want to know when https://www.facebook.com/Foodler?ref=stream&fref=nf is nearing 100,000 likes automatically via SMS. Is this possible?
Ok, you have to break down your tasks. These are 2 separate concerns.
1 Track Facebook page constantly for likes
You can get this information by using Facebook's Graph API as a JSON record. A simple call (without requiring any API key will do the job)
http://graph.facebook.com/Foodler/
Right now, the "likes" key has value 97542
You can possibly run a cron-job or Scheduled Task (depending on your server type/configuration) to run a script (PHP/ASP/.NET, etc.) which further runs this API call every "X" minutes (or hours or days, whatever you wish) and parses the "likes" returned. Once they are >= 100,000, you can now send SMS using this script.
Your script can do so by now calling the SMS Gateway's API.
2 Sending SMS
You need an SMS Gateway (preferably a simple API?) for doing that. Just a simple google search for "sms gateway" returns many leading ones.