Integrating rasa bot with twilio voice - twilio

I am trying to build a telephony voicebot using Rasa,I’m just getting started with Rasa, and wondering whether it is possible to integrate rasa bot with twilio voice ,sms is working fine on Programmable SMS .Can anyone please help me how to do this?

We have used 2 different ways to achieve this. As this is for my company, I do not have the right to publish any source code, but this should help you find the way:
1-via Twilio studio, you can just use a block to call a Twilio function and there use "got" npm module (to be addded in Twilio function management tab) to launch a rest API call to you RASA NLU server (or RASA core if you need more than just NLU) and get back the intent(+other info if you want).
2-if you have the possibility to host a backend server (a "middelman"), then you can follow the tutorial at Twilio and expose 4 routes for call controle. In your backend, you will recuperate the utterance(speech) of the gather() function and you can make an API call to your RASA server with it as argument. The backend should contain the logic to react on the intent detected by RASA.
Example (for both solutions) : detected intent is "talk to a manager", then the Twilio command should be a transfer of the call to number xxx. If the detected intent is "talk to accounting department", then you should transfer to number yyy. (jut an example but you see the point).
Twilio has a good tutorial to start with (and a github repo you can clone) .
You can start by having a look at https://www.twilio.com/docs/voice/tutorials/how-to-respond-to-incoming-phone-calls-node-js (sorry I link everyting to nodeJS without knowing what you use, but some other languages are also available).
For me solution 1 is faster and allowed us to start quickly.
Solution 2 is more professional because :
-it gives you more controle (possibility to integrate with DB server, action server, CRM, ...)
-make security people happy by hosting business data inside your own infra (instead of Twilio studio and/or Twilio function.
For info : Twilio has a SOC compliance report - a banking-level security program / if you really need to (and you are ready to pay for it)
-it makes you free and you can replace Twilio, RASA or both when you want.
Nb : Twilio does not really help you a lot in the tutorials as they have their own fully integrated solution (Twilio Autopilot) to integrate NLU and voice call.

Related

Using Services to create a Speech to Text Function with Vosk?

wanted to get some additional opinions on a project.
I'm attempting to create a system which will gather the dialog from a call commenced by Twilio Studio and transcribe it. I then intend to push the now transcribed dialog to my CRM.
I found a helpful article on speech to text with the use of Vosk; https://www.twilio.com/blog/transcribe-phone-calls-text-real-time-twilio-vosk - however, I think the article assumes that this will be done with the use of an external application. So, my question is; could this be possibly developed with the use of Twilio Services and leveraged within Studio?
If not, I could develop a web app to connect everything together, but would rather everything be housed within Twilio as I'm a novice developer and developing this app externally sounds like a rather over complex solution to this project.
Thanks in advance for your feedback!
Nothing attempted yet, still in the early research stage of this project.
As of now, Twilio does not offer its own Speech-to-Text engine. However, you can use media streams to forward the audio track to any engine out there on the internet.
This blog post uses Google's engine, for example.
The advantage of such a hosted service is that you neither need to worry about the model nor manage the server. If you want to do 100% serverless, then you could run the entire thing on Twilio Serverless.

How to get the info about the incoming call when the calling party starts

We need to get the info about the incoming call when the calling party starts to hear the welcome message from IVR. Could you please advise how can we achieve that.
Since you tagged that question with [jtapi] I assume you would like to use it.
You didn't mention where you would like to receive or how to use that information so I can give you only a brief overview.
If you need it in the IVR and it is a Avaya Experience Portal then you just add the CTI integration to your project and use the CTI Call Info node to have access to call data.
Or you can develop custom application in Java with JTAPI. You start monitoring IVR incoming extensions and when a new call is answered you store call data and the IVR script can get this data via web service calls for example.

Twilio Use Case

I am considering using Twillio as an extension in an existing application.
My use-case is this:
User clicks button in application
Using Twilio API, the application calls the user.
The user answers their phone
Twilio connects user to some phone number. (fetched from db)
It's a bit strange, but it is exactly my customer's request. Before I spend too much time in the rabbit hole, I thought I would ask the community, can I do this with Twilio APIs?
Twilio developer here!
This is definitely a common use case for Twilio. In fact, it's so common that we wrote up an in-depth tutorial showing you how to build an app like the one you described.
We've got it in PHP, Node, Python, and Ruby - here's the PHP version:
https://www.twilio.com/docs/howto/walkthrough/click-to-call/php/laravel
If you prefer to just reference the code, you can find it on GitHub too: https://github.com/TwilioDevEd/clicktocall-laravel
Yes. That's actually very simple in Twilio:
https://www.twilio.com/docs/api/rest/making-calls

How to intercept sent / consumed RabbitMQ messages

I am developing RabbitMQ token auth plugin, where the token needs to be included in AMQP header so it can be validated upon every sent / consumed message.
I am wondering how can I achieve it? So far I am only familiar with RabbitMQ auth plugins and do not know much about other plugin mechanisms. After quick research I have found rabbit_channel_interceptor behavior which sounds like it could do the job.
I have read rabbitmq's source code about auth. In the source code tree, please pay attention to the files named as "rabbit_auth_machanism.erl", "rabbit_auth_backend", "rabbit_auth_backend_internal". In addition, there is another plugin named "xxx ldap".
After reading carefully and know how to integrate and build the rabbitmq project groups, you can start programming.

What to consider first when designing a meta-search engine using Erlang, Mnesia and Yaws?

Can someone explain to me what to consider first when designing a meta-search engine using Erlang, Mnesia and the Yaws web server? This engine should have SMS capability but I am still wondering how I am going to incorporate this feature...
The meta search engine, you need REST or Ajax APIs from Google, Yahoo and Bing. Below am providing you with examples which you may use within your back end HTTP capable Library or your front end JavaScript. I personally use mochiweb and yaws Appmods.
For example: Google has an Ajax search API which works like this:
http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=computers
Hitting that URL will give you a JSON Object which contains several search responses. In this case, the search term is "computers"
Yahoo has what it calls Boss APIs. An example of Yahoo Rest search API using Boss is here below:
For an XML result:
http://boss.yahooapis.com/ysearch/web/v1/animals?appid=APPID&format=xml&start=1&count=3
For a Json result:
http://boss.yahooapis.com/ysearch/web/v1/animals?appid=APPID&format=json&start=1&count=3
Analyse the whole HTTP GET query very well, you notice something they call an APPID. This you will get when you register with them here. I cannot give to you my APPID, you will have to get yours,then paste it in there and you will be good to go. Yahoo has something more powerful called
YQL. In the above query, the search term is: "animals"
Bing as well has got an API for you, but you will need an APPID:
http://api.bing.net/json.aspx?AppId=APPID&Query=love&Sources=Web&Version=2.0&Market=en-us&Web.Count=10
Above, the search term is: "love"
About the Meta Search Engine
You have a web page, people enter search queries in this page. You use your javaScript (JSONP). JSONP could be implemented in any one of your favorite JavaScript Framework you use e.g.
JQUERY,Ext JS,Dojo, Prototype e.t.c
Then you would have to parse the XML or JSON response from the three sources (Google, Yahoo and Bing),and make an appropriate display for your users to navigate the results.
About the SMS part
SMS capability is attained using SMS Gateway. There are several open and close source SMS Gateways. the most powerful of them all is the one built in Erlang/OTP technology called: OSERL, but to test it, you need direct connection with an SMSC in anyone of your local service provider.You need a Port on their SMSC, a user name and a password.There is another one which is better for development reasons called: NowSMS because it has capabilities for USSD, Modem Internet Communication, SMSC service connectivity, HTTP 1.1 and HTTP 1.0, configuration of two-way SMS messaging e.t.c from a Web App to-and -from the SMS Gateway. Go to their site, grab the trial version, follow the documentation and then configure two-way from your web app to the gateway and vice versa. Since NowSMS is not free, you can try: Kannel, it is open source but you will need help from the community to set it up on your Unix or Linux box.
More on incorporating SMS capability in Web Applications can be found:
Here
I also asked once a Question related to development of a powerful search engine using Erlang, Mnesia & YAWS webserver on Stackoverflow. I got plenty of good answers and responses.
Please CLICK ME!
Hope this may help. As I am not sure about SMS thing.

Resources