How to combine ARI live transcription (external media) with AGI-controlled call flow in Asterisk?

Hi everyone,
I have a question for those who have worked with live call transcription in Asterisk.

I’d like to use ARI and external media to stream audio to an external transcription service. The problem comes when trying to integrate this with my existing call logic – most of my logic is handled using AGI, which controls the call flow.

When I hand over the call to ARI (via Stasis), ARI takes control of the call and I can no longer use my AGI-based logic. On the other hand, if I create a bridge in ARI, attach external media, and then call continueInDialplan(), I exit ARI and lose the ability to keep streaming audio for transcription.

Has anyone solved a similar problem?
Are there any ready-made solutions or suggestions on how to combine live transcription (external media + ARI) with keeping all the call control logic in AGI?

I’d really appreciate any pointers, sample architectures, or ideas!

A channel can only have one thing in control of it. That’s a fundamental thing of Asterisk. For audio there is a mechanism in ARI to get around this to allow the audio to be copied/forked. You’d use a Snoop channel[1] to passively fork the audio, allowing the original channel to go wherever - including to an AGI. The Snoop channel would receive its audio, and can be bridged to an external media channel to do whatever you may wish.

[1] Channels - Asterisk Documentation

1 Like