how to integrate mobile call to a chatbot using asterisk

0

2

I am developing a voice based chatbot which can call a person and have the conversation. Currently, the chatbot uses my pc mic and speaker for input and output audio. I am trying to integrate this over the mobile network so as to replace my pc mic and speaker with mobile. See block diagram in link for understanding

same block diagram but different cloud

I am taking input from mic and giving it to a speech to text converter(S2TC) and the response given by chatbot giving it to a text to speech (T2S) converter.

import speech_recognition as sr
from speechtotext import convert_speech_to_text

r = sr.Recognizer()

with sr.Microphone() as source:
    # in_audio is the mic input
    in_audio = r.listen(source)

# bot give response based on input audio  
bot_response = chatbot(convert_speech_to_text(in_audio))
out_audio = convert_text_to_speech(bot_response)

Now I am trying to utilize asterisk to connect to the network and integrate mobile and my chatbot. For this, I need whatever spoken in mobile to be received as 'in_audio' and 'out_audio' should be sent over the network.

Here the bot initiates the call, I just got a link to place a call, but how do I receive or capture in_audio over the network to send to my program or to my converters, and send the out_audio to a user. Are there any asterisk functions to do this? If not possible to configure asterisk, is there any way that I can integrate mobile network to voice bots?

I am building the application using python and bing speech to text converter in windows.

Note: I am new to asterisk.

Raady

Posted 2018-05-05T20:28:11.307

Reputation: 103

Answers

1

Asterisk have audiohooks interfaces which can be used for this(c/c++ coding require)

Also there is EAGI interface(sound can be received at file handle number 3).

Main issue with such bot not connection. Telephony services use 8khz voice and that is NOT enought for correct recognition. There is no way change to better voice, all codecs at PSTN/GSM connection at current moment are 8khz codecs.

Also IBM Watson have telephony integration services(costly), which accept call, recognize, send you result via callback. But again, quality of recognition terrible if person language on other side is not perfect.

arheops

Posted 2018-05-05T20:28:11.307

Reputation: 977