Passing extra arguments to external media server to identify which calls audio is coming

I am using asterisk 20.6.0 created an external media upon call answering, The audio is coming to the external media, but How can I identify which calls audio packet is being received in external host. How can I pass extra data so that it reaches to the external host. I see that I could add variables to the channels but can I access channel from UDP server. ? Please help.

External media is generally made to identify based on local listening ports, with each session having its own port. This mirrors how RTP generally works.

1 Like

So each call has one port assigned to it. and I keep a mapping to callId to one port, up on ending the call I free that port to use for another call.
I couldn’t follow you on “This mirrors how RTP generally works”. Thanks in advance
.

Yes. That is what you would do.

Regarding RTP, when you have multiple calls to a phone each is using their own port for audio so the phone can also do the same mapping.

1 Like

I got these two values from UDP server when listening to rtp packets.

UNICASTRTP_LOCAL_ADDRESS and UNICASTRTP_LOCAL_PORT

In documentation it says .

The chan_rtp channel driver sets the UNICASTRTP_LOCAL_ADDRESS and UNICASTRTP_LOCAL_PORT channel variables with the local IP address and port that media can be sent to. If you want to use this to inject media into the bridge the Extecrnal Media channel is a member of you can retrieve these channel variables using the normal ARI mechanism to get their values.

So can I retrieve channel variables with this data, if so how. @jcolp
NB: I am using ARI-PROXY

That’s where media would be coming from, you are certainly free to use that instead of your own local ports for mapping. The variables would be in the channel variables that are returned in the response to the externalMedia creation request.

I have no experience with ARI-PROXY and can’t comment on its usage.

1 Like

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