My application creates an External Media channel with these parameters:
format: ulaw
encapsulation: rtp
transport: udp
connection_type: client
direction: both
The UDP port (1000) is open and listening on my machine (verified with netstat). Asterisk is running in a Docker container, and the logs show it’s trying to send RTP to the correct IP (172.19.80.1:1000 - my development machine’s IP).
However, my UdpClient.ReceiveAsync() never receives any packets. It just hangs waiting for data.
Environment:
Asterisk running in Docker
C# application running on Windows host
Using ARI for call control
UDP port 1000 open and listening
I use Zoiper 5 utility to simulate the call
Logs in Asterisk:
Activating Stasis app ‘my-websocket-app’
== WebSocket connection from ‘172.17.0.1:39310’ for protocol ‘’ accepted using version ‘13’
– Executing [6001@from-internal:1] Answer(“PJSIP/6001-00000001”, “”) in new stack
> 0x7fb02c0bd1a0 – Strict RTP learning after remote address set to: 127.0.0.1:65008
– Executing [6001@from-internal:2] Stasis(“PJSIP/6001-00000001”, “my-websocket-app”) in new stack
> 0x7fb02c0c71f0 – Strict RTP learning after remote address set to: 172.19.80.1:1000
– Called 172.19.80.1:1000
– UnicastRTP/172.19.80.1:1000-0x7fb02837cb80 answered
> Launching Stasis(my-websocket-app) on UnicastRTP/172.19.80.1:1000-0x7fb02837cb80
– Channel PJSIP/6001-00000001 joined ‘simple_bridge’ stasis-bridge <14eb4fc6-c24d-460a-a477-6598160ae989>
– Channel UnicastRTP/172.19.80.1:1000-0x7fb02837cb80 joined ‘simple_bridge’ stasis-bridge <14eb4fc6-c24d-460a-a477-6598160ae989>
Has anyone encountered similar issues or can point me in the right direction for debugging this?
If you hear the “beeeeep”, you can effectively transmit the RTP stream between Asterisk and your external media. It could also be 127.0.0.1.
The first attempt could be 2 virtual machines, one sends the audio and the other receives and plays it.
Then, you can try sending from VM1 to your RTP server and observe the RTP traffic flowing to your C# application.
Finally, you send from your Docker instance to your C# application and see what happens.
Тhe problem has been resolved…
After moving my code to a properly configured Asterisk server, the RTP packets are now transmitting correctly.
It seems the issue was with my Docker configuration rather than with the code itself.