ARI to snoop on call

We’re using the GitHub - asterisk/asterisk-external-media project as a basis for doing real-time call transcription.

It works fine if the dialstring goes to a context which does ChanSpy on the call to be transcribed. This is a bit messy though, and we would like to use ARI to snoopChannel on the call to be transcribed instead.

Presumably the following part of lib/ari-controller.js from that project needs to change, but I’m not sure how it should be changed to use snoopChannel. Can anyone point me in the right direction? Thank you very much in advance.

            // Call the phone or confbridge specified in dialstring
            try {
                    await this.localChannel.originate({
                            endpoint: this.options.dialstring, formats: this.options.format, app: "externalMedia",
                    });
            } catch (error) {
                    this.close();
            }

@jcolp Are you able to confirm that replacing this originate with the snoopChannel is at least conceptually the right thing to do? We can then try to work out the javacript to make it happen. Thank you!

I can say that replacing it with a snoop channel would result in a channel that is snooping on another channel… sure.

I would suggest experimenting with it to understand things.

Thanks @jcolp , that does sound like a bit of a truism doesn’t it.

Are you able to confirm whether snoopChannel can snoop on a channel that isn’t using ARI/stasis? (it’s using plain dialplan and perl AGI)

Yes, it can.

Thank you @jcolp !