ASR and asynchronous transmission

Hi guys!

I would like to integrate my freePBX with external ASR (bot). Now i send to them “chunk” wav using Record aplication in my dialplan, and receive transcript. Transcript (answer) is played as speech using TTS. Everythink works fine, but i would like to have opportunity to get into a answer. So that the TTS stops speakind when the caller starts talking and immediately listens. I have no experience with webRTC and MRCP, but I will gladly get it :slight_smile: I will be grateful for any examples and guidance :slight_smile:

Asterisk 13 Function_TALK_DETECT - Asterisk Project - Asterisk Project Wiki

Keep in mind that TALK_DETECT only looks for audio coming from the device side of the channel, i.e., the read side. Thus, if we want to raise events for both channels, we need to apply it to each channel. As an example, the following would apply talk detection to both channels by using a pre-dial handler on the outbound channel:

[default]

exten => 100,1,Answer()
 same => n,Set(TALK_DETECT(set)=)
 same => n,Monitor()
 same => n,Dial(SIP/client1,15,b(default^apply_talk_detect^1)) 
 same => n,Hangup()

exten => apply_talk_detect,1,NoOp()
 same => n,Set(TALK_DETECT(set)=)
 same => n,Return()

The question suggest there isn’t both an A and a B side to this call, and therefore isn’t a Dial().

More generally, this processing is going to be done outside of FreePBX, so quite a deep; knowledge of Asterisk itself will be needed, Other factors may mean that FreePBX is helpful, but I suspect that FreePBX will get in the way if this is the core application, as you may have to account for how FreePBX works, as well as how Asterisk works.

You may want to consider the impact of echoes, which might cause false detections, and echo suppression, in particular anti-vox, that might result in genuine speech being suppressed. I’m not sure how significant these risks are, but you should probably do experiments to confirm they are not problems.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.