Error while creating external media

I have defined a hello-world in extension.conf. I am listening to the socket ‘ws://xx.xxx.xx.xx:8088/ari/events?api_key=asterisk
&app=hello-world’ with a Python code, and when a message arrives, I take the channelid value and make a request to the service to create external media. However, when I make a POST request to create external media, I get the error -An internal error prevented this request from being handled-.What is the reason for the error when creating external media, as no details are provided? I couldn’t make progress.

Is this also the correct way to send and receive audio with an external socket?

You need to show the actual HTTP request and response.

Of course. The example request is made like this: http://XXXX:8088/ari/channels/externalMedia?app=hello-world&external_host=XXXX:10000&format=ulaw&channelId=1722351029.22. The socket application for the external media is also on the same machine. That means the IPs specified as XXXX are the same for both

Is there no one with an idea?

What are you passing for a channel ID? Is chan_rtp loaded?

1 Like

Great, the issue is resolved. As you mentioned, chan_rtp was not installed on the system. I installed it.

I was getting the channel ID from the call event at ‘ws://xx.xx.xx.xx:8088/ari/events?api_key=xx
&app=hello-world’, but I made a logical error. I couldn’t create a channel with that ID because there was already a channel with that value. Now, I’m leaving the channel ID blank when creating external media, so the system assigns its own value.

I’m not receiving data on the socket I created for external media, but I’ll work on it for 1-2 more days. If it doesn’t work, I’ll open a new post. Thanks for the information.

Also, is there a way to identify missing modules in case of errors like this? Is there a method to do this?

There isn’t some kind of built in method, no. Lack of a module can manifest itself in different ways.

1 Like

When I post the channel ID value obtained this way to the external media service, the error persists. What could be the reason for this? chan_rtp is installed. However, when I write a random value for the channel ID, no error occurs. But no data is received at the socket listening on port 5004 for external media.

A channel ID is unique for each channel at a given time. Two channels can’t have the same channel id at the same time.

An external media channel does nothing until you do something with it. It’s just a way to get media into and out of Asterisk. It’s not automatically snooping on channels or doing other things. It’s up to YOU to do that. If you want to listen to another channel for example, then you have to create a snoop channel on the channel you want to listen to and then bridge both the snoop channel and external media channel together.

1 Like

Now I understand. So, setting up this bridging structure would fully address this scenario, right? For example, a call starts. I receive the caller’s voice, process it, and then send a different voice back to the caller. And I will make this interactive as if two people are having a conversation. I’m asking to make sure I’m not going down the wrong path

Yes.

1 Like

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