Don't hear audio streamed back to external media channel

Using an ARI client (AsterNET.ARI) we are able to:

1- Initiate a call
2- Create an External Media Channel
3- Create Bridge type “mixing”
4- Bridge both channels

…and expose the audio stream to an RTP server we built listening on all IPs in port 7777

For the moment, we are trying to send back the stream to the channel (like an echo), however we are not hearing the response, even though it looks like the RTP is sent back to asterisk.

External Media Channel: {"UNICASTRTP_LOCAL_PORT":"15672","UNICASTRTP_LOCAL_ADDRESS":"172.18.33.220"}

RTP server:
... Received: 118 From: 172.18.33.220:15672 Sending: 118 To: 172.18.33.220:15672 Received: 118 From: 172.18.33.220:15672 Sending: 118 To: 172.18.33.220:15672 ....

Asterisk:

Got RTP packet from 10.114.0.234:55874 (type 111, seq 031742, ts 3934092822, len 000069)
Sent RTP packet to 172.18.33.220:7777 (type 118, seq 029097, ts 1090576, len 000640)
Got RTP packet from 10.114.0.234:55874 (type 111, seq 031743, ts 3934093782, len 000071)
Sent RTP packet to 172.18.33.220:7777 (type 118, seq 029098, ts 1090896, len 000640)
Got RTP packet from 10.114.0.234:55874 (type 111, seq 031744, ts 3934094742, len 000073)

To start this process we initiate a call with a softphone (JsSIP, opus codec) to :

`
exten => 111,1,NoOp(Testing External Media)

same => n,Answer()

same => n,Stasis(voicebot)

same => n,Hangup()

`

Any idea why I am not hearing the audio back?

Dynamic payloads, such as those used by opus, are not currently supported. Only statically defined payloads (such as ulaw, alaw, g722) are supported.

I just tested with another endpoint (MicroSIP) with codec ‘alaw’ and on External Media used format alaw but still no audio.

Previously I was using ‘slin16’ as format for External Media

Something I’ve noticed during test is that when there is real speech I receive in asterisk the following error:

res_rtp_asterisk.c:3134 __rtp_recvfrom: Received SSL traffic on RTP instance '0x7f3604007ca0' without an SSL session

Are you for sure sending actual RTP packets, and not some with the RTP header stripped off? What does a packet capture show?

I am trying to just send back what I am receiving without any manipulation as you can see below:

public class UDPListener
{
    private const int ListenPort = 7777;

    public static void StartListener()
    {
        UdpClient server = new UdpClient(ListenPort);
        IPEndPoint groupEP = new IPEndPoint(IPAddress.Any, ListenPort);
        try
        {
            Console.WriteLine("Listening to: " + ListenPort);
            while (true)
            {
                Console.WriteLine($"Received From: {groupEP.Address}:{groupEP.Port}");      
                byte[] bytes = server.Receive(ref groupEP);

                // PRINTS THE BYTE CODES
                // Console.WriteLine($" {Encoding.ASCII.GetString(bytes, 0, bytes.Length)}");

                Console.WriteLine($"Sending To: {groupEP.Address}:{groupEP.Port}");      
                server.Send(bytes, bytes.Length, groupEP);
            }
        }
    }

And what does a packet capture show?

The issue was the codec. After sending alaw on external media and allowing only alaw on the endpoint, I can hear the stream. alaw was enabled as a codec even on the test that I was doing before, but since we are playing directly with the media and no SDP are involved there is no negotiation.

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