No data is reaching the proxy server when using /channels/externalMedia

Hi, I am new to Asterisk and ARI.
I have the following Dial plan for extension 4444:

[from-internal]
exten => 4444,1,NoOp()
same => n,Stasis(myApp)
same => n,Hangup()

myApp waits for the event StasisStart and when this event is recorded then:

  1. Audio is played using “/channels/<CHANNEL_ID>/play?media=sound:<AUDIO_NAME>”
  2. An external media channel is created with “/channels/externalMedia?app=myApp&external_host=<EXTERNAL_SERVER_DEST>:6000&format=ulaw&connection_type=client&direction=both”
  3. A bridge is created with “/bridges?type=mixing”
  4. Both, the originating channel and the external media channel are added to that created bridge.

For all these REST requests I get successful responses (2XX). I try the whole thing by calling 4444 from a Soft-Phone (4333) and can at least hear the played audio.

The “proxy service” at EXTERNAL_SERVER_DEST is a python program that creates a UDP socket on port 6000 and waits for any packet to be received.
The problem is that nothing is reaching that service and I am not sure how to further debug.

First, I tried to run the proxy service in the same machine where myApp was located, but I didn’t get any packets.
Then to exclude any problems with firewall or network restrictions I placed the proxy service in the same server in which Asterisk is running, but still nothing is received.
I am also using tcpdump to sniff any packets going to the proxy service and port, but I get nothing.

I am certainly not sure whether my python code works as expected, but at least I should see anything trying to reach it. Any hints would be appreciated.

The messages I am getting in myApp are:

Received message: {‘type’: ‘StasisStart’, … ‘channel’: {‘id’: ‘1707063548.0’, ‘name’: ‘PJSIP/4333-00000000’, ‘state’: ‘Ring’, ‘protocol_id’: ‘e1213a32b0a64322b7fe1ffb7c59faa6’, ‘caller’: {‘name’: ‘Test1’, ‘number’: ‘4333’}, '…, ‘dialplan’: {‘context’: ‘from-internal’, ‘exten’: ‘4444’, ‘priority’: 2, ‘app_name’: ‘Stasis’, ‘app_data’: ‘myApp’}…

Received message: {‘type’: ‘Dial’, ‘…’, ‘dialstring’: ‘<EXTERNAL_SERVER_DEST>:6000’, ‘peer’: {‘id’: ‘1707063548.1’, ‘name’: ‘UnicastRTP/<EXTERNAL_SERVER_DEST>:6000-0x7f48bc002400’, ‘state’: ‘Down’ … ‘application’: ‘myApp’}

Received message: {‘type’: ‘ChannelStateChange’, ‘timestamp’: ‘…’, ‘channel’: {‘id’: ‘1707063548.1’, ‘name’: ‘UnicastRTP/<EXTERNAL_SERVER_DEST>:6000-0x7f48bc002400’, ‘state’: ‘Up’, … ‘application’: ‘myApp’}

Received message: {‘type’: ‘Dial’, ‘timestamp’: ‘…’, ‘dialstatus’: ‘ANSWER’, … ‘dialstring’: ‘<EXTERNAL_SERVER_DEST>:6000’, ‘peer’: {‘id’: ‘1707063548.1’, ‘name’: ‘UnicastRTP/<EXTERNAL_SERVER_DEST>:6000-0x7f48bc002400’, ‘state’: ‘Up’, …, ‘application’: ‘myApp’}

Received message: {‘variable’: ‘STASISSTATUS’, ‘value’: ‘’, ‘type’: ‘ChannelVarset’, …, ‘channel’: {‘id’: ‘1707063548.1’, ‘name’: ‘UnicastRTP/<EXTERNAL_SERVER_DEST>:6000-0x7f48bc002400’, ‘state’: ‘Up’, …, …, ‘application’: ‘myApp’}

Received message: {‘type’: ‘StasisStart’, ‘timestamp’: ‘…’, ‘args’: , ‘channel’: {‘id’: ‘1707063548.1’, ‘name’: ‘UnicastRTP/<EXTERNAL_SERVER_DEST>:6000-0x7f48bc002400’, ‘state’: ‘Up’,…, ‘application’: ‘myApp’}

Received message: {‘type’: ‘ChannelEnteredBridge’, … ‘bridge’: {‘id’: ‘04cf717a-5a2e-42c1-8668-2b31653414c1’, ‘technology’: ‘simple_bridge’, ‘bridge_type’: ‘mixing’, ‘bridge_class’: ‘stasis’, ‘creator’: ‘Stasis’, ‘name’: ‘’, ‘channels’: [‘1707063548.0’], … ,‘caller’: {‘name’: ‘Test1’, ‘number’: ‘4333’}, …, ‘dialplan’: {‘context’: ‘from-internal’, ‘exten’: ‘4444’, …, ‘app_data’: ‘myApp’}, … ‘application’: ‘myApp’}

Received message: {‘type’: ‘ChannelEnteredBridge’, …, ‘bridge’: {‘id’: ‘04cf717a-5a2e-42c1-8668-2b31653414c1’, ‘technology’: ‘simple_bridge’, ‘bridge_type’: ‘mixing’, ‘bridge_class’: ‘stasis’, ‘creator’: ‘Stasis’, ‘name’: ‘’, ‘channels’: [‘1707063548.0’, ‘1707063548.1’], …, ‘application’: ‘myApp’}

Received message: {‘variable’: ‘BRIDGEPEER’, ‘value’: ‘UnicastRTP/<EXTERNAL_SERVER_DEST>:6000-0x7f48bc002400’, ‘type’: ‘ChannelVarset’, …, ‘channel’: {‘id’: ‘1707063548.0’, ‘name’: ‘PJSIP/4333-00000000’, ‘state’: ‘Ring’, …, ‘dialplan’: {‘context’: ‘from-internal’, ‘exten’: ‘4444’, …, ‘app_data’: ‘myApp’}, '… ‘application’: ‘myApp’}

Received message: {‘variable’: ‘BRIDGEPEER’, ‘value’: ‘PJSIP/4333-00000000’, ‘type’: ‘ChannelVarset’, …, ‘channel’: {‘id’: ‘1707063548.1’, ‘name’: ‘UnicastRTP/<EXTERNAL_SERVER_DEST>:6000-0x7f48bc002400’, ‘state’: ‘Up’, … ‘application’: ‘myApp’}

Received message: {‘variable’: ‘BRIDGEPVTCALLID’, ‘value’: ‘e1213a32b0a64322b7fe1ffb7c59faa6’, ‘type’: ‘ChannelVarset’, …, ‘channel’: {‘id’: ‘1707063548.1’, ‘name’: ‘UnicastRTP/<EXTERNAL_SERVER_DEST>:6000-0x7f48bc002400’, ‘state’: ‘Up’, …, ‘application’: ‘myApp’}

Received message: {‘type’: ‘ChannelConnectedLine’, … ‘channel’: {‘id’: ‘1707063548.1’, ‘name’: ‘UnicastRTP/<EXTERNAL_SERVER_DEST>:6000-0x7f48bc002400’, ‘state’: ‘Up’, … ‘application’: ‘myApp’}

Received message: {‘cause’: 127, ‘type’: ‘ChannelHangupRequest’, … ‘channel’: {‘id’: ‘1707063548.0’, ‘name’: ‘PJSIP/4333-00000000’, ‘state’: ‘Ring’,…, ‘dialplan’: {‘context’: ‘from-internal’, ‘exten’: ‘4444’, '…, ‘application’: ‘myApp’}

Received message: {‘variable’: ‘BRIDGEPEER’, ‘value’: ‘’, ‘type’: ‘ChannelVarset’, …, ‘channel’: {‘id’: ‘1707063548.0’, ‘name’: ‘PJSIP/4333-00000000’, ‘state’: ‘Ring’,…, ‘caller’: {‘name’: ‘Test1’, ‘number’: ‘4333’}, …, ‘dialplan’: {‘context’: ‘from-internal’, ‘exten’: ‘4444’, …, ‘application’: ‘myApp’}

Received message: {‘type’: ‘ChannelLeftBridge’, ‘timestamp’: ‘…’, ‘bridge’: {‘id’: ‘04cf717a-5a2e-42c1-8668-2b31653414c1’, ‘technology’: ‘simple_bridge’, ‘bridge_type’: ‘mixing’, ‘bridge_class’: ‘stasis’, ‘creator’: ‘Stasis’, ‘name’: ‘’, ‘channels’: [‘1707063548.1’], ‘creationtime’: ‘…’, ‘video_mode’: ‘talker’}, ‘channel’: {‘id’: ‘1707063548.0’, ‘name’: ‘PJSIP/4333-00000000’, ‘state’: ‘Ring’, ‘protocol_id’: ‘e1213a32b0a64322b7fe1ffb7c59faa6’, ‘caller’: {‘name’: ‘Test1’, ‘number’: ‘4333’}, ‘connected’: {‘name’: ‘’, ‘number’: ‘’}, …, ‘dialplan’: {‘context’: ‘from-internal’, ‘exten’: ‘4444’, …}

Thank you in advance

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