Can't use audio stream due to impossibility to configure External Media module

I’ve spent over a week trying to set up an application that would connect my sip trunk configured in asterisk to an external websocket server (which is connected to a voice agent that supports audio streaming over websocket) using External Media Channel. But how many times I have not installed reinstalled and tried to configure this module, it does not succeed… I already doubt its existence…
Please help me to realize the transfer of audio stream from asterisk to websocket and vice versa.

There is no support for sending audio over a Websocket yet. It sends to an outside ARI application using RTP over UDP, or Audiosocket.

thanks for your reply and I apologize if I’m not expressing myself correctly, I’m new to working with asterisk.

As I understand ARI application with RTP uses externalMedia channels, but I can’t install this module, as soon as I tried to install it, it is always not in menuselect and nowhere else… as if it doesn’t exist in asterisk at all.

The module is built and installed by default.

I tried on ubuntu, debian, 16/18/22 versions.
every time:
module show like res_external_media - no module
module load res_external_media.so - error no module
load => res_external_media.so in modules.conf - nothing
all dependencies are installed

everytime no chan_external_media.so, no res_external_media.so or any other like external media in all “menuselect”..

I’m confused. It’s the first time I’ve ever been in this situation.

There is no such module. Why do you think it should exist?

The underlying modules are chan_rtp and res_ari_channels.

2 Likes


The ari modules comes as default make of asterisk, you can check:

asterisk -rvvvvvv
module show like ari

If you are looking for some ideas, here are multiple tests using ari external media channels:

Regards.

2 Likes

I have to develop with copilot, and all my attempts with different approaches always lead to the fact that aserisk must have an external_media module (chan_external_media), but it is not there and cannot be loaded.

thanks for the code, I will try to figure it out, because my self-esteem is hurt =)

As with many LLMs, it lies.

2 Likes

Thanks again for providing the solution
I tried to run it on aws server, configured everything I could, configured port access, but for some reason I can’t get rtp. always “N/A | 2025-05-15T11:06:34.049Z [ERROR] Cannot initialize StreamHandler: No RTP source for channel 1747307193.3”.

have you encountered this problem?


Hello, this version of the ARI app doesn’t support remote extensions (cloud instances). For proper testing, create a local LAN virtual machine with a bridged network card and test the ARI app with a softphone and headset. Regards.

2 Likes

I want to sincerely thank you for providing such a smooth repo for integrating real-time voice ai capabilities with Asterisk. It was exactly the baby step I need without requiring any external lib, and it worked beautifully. With some adjustments, I was able to adapt it into our own setup, which includes the added complexity of Asterisk Realtime Architecture and AGI-based control. But OpenAI’s API costs for real-time usage added up pretty fast. Thank you once again.

2 Likes

I’m happy to help!
I’ll soon be creating new versions of the ARI app to use other, more cost-effective real-time models like X.AI’s Grok 3.

2 Likes

As for me, I’m trying to set it up to interact with elevenlabs voice agent and so far have only been able to intermittently hear the agent, but he can’t hear me…

Good to know, I was able to ue the gemini live also m not performant like oai though

issue may be how the app is procesing the audios.

1 Like