ExternalMedia RTP issue

I’am using externalmedia. I’am able to receive and send audio using RTP.

One issue I face, when sending a short 10 sec audio from my application I hear it fine the first time. When I send it again I don’t. To resolve this I have to send a long audio file.

After searching for resolution, I guess the issue may be related to buffer on receiver side. Suggestions were to send a BYE RTCP packet at the end of each transmission.

I implemented the same sending to 1 + port number. On setting “rtcp set debug on” I don’t see the receipt of BYE packet.

I’am not sure if sending the BYE Packet is the resolution. Please help in resolving the issue of sending short audio files repeatedly

Forgot to include the bye packet here it is - b’\x81\xcb\x00\x02#\xe2\xc64’

Are you trying to send the entire file at once, or are you properly streaming it out? The support doesn’t do re-timing, meaning media has to be timed as a stream to Asterisk.

I’am sending 160 bytes (alaw) audio every 20ms. I face no issues when the stream is @ 10 sec or more. But when the stream is 3 to 5 sec audio, then this issue is observed.

You’ll need to provide further information - how the external media channel is bridged and used.

I’am using Asterisk 20.9.3. Python library ari-py.

extensions.config:
exten => 6030,1,NoOp()
same => n,Stasis(channel-state)
same => n,Hangup()

  1. On StasisStart a new mixing bridge is created. Calling channel is added to this bridge
  2. An external media channel is created with format alaw and also added to this bridge

10SCXRCLI>
[Oct 8 06:57:59] WARNING[14417]: res_pjsip_pubsub.c:3396 pubsub_on_rx_publish_request: No registered publish handler for event presence from 6001
[Oct 8 06:57:59] WARNING[14417]: res_pjsip_pubsub.c:3396 pubsub_on_rx_publish_request: No registered publish handler for event presence from 6001
– Executing [6030@internal:1] NoOp(“PJSIP/6001-00000005”, “”) in new stack
– Executing [6030@internal:2] Stasis(“PJSIP/6001-00000005”, “channel-state”) in new stack
– Channel PJSIP/6001-00000005 joined ‘simple_bridge’ stasis-bridge
– Called 192.168.1.20:12222/c(alaw)
– UnicastRTP/192.168.1.20:12222-0x7f128c005120 answered
> Launching Stasis(channel-state) on UnicastRTP/192.168.1.20:12222-0x7f128c005120
– Channel UnicastRTP/192.168.1.20:12222-0x7f128c005120 joined ‘simple_bridge’ stasis-bridge
SD-GF75-Thin-10SCXR
CLI>

  1. I’am able to receive audio via rtp and record it to wave file for testing. Audio is ok.

  2. To send audio, 160 bytes of chunk is sent every 20ms. Sequence number is incremented by one and timestamp by 160 for every chunk

Request input on my last update please.

This is a community forum, noone is obligated to respond to you. I don’t have anything additional to add/ask as of this time.

Thanks for pointing this out. I understand. If you have any input in future, which may help resolve this issue, it would be a great help. Meanwhile if I make any progress I’ll update here. Thanks again.

Tried to futher explore this issue but still not able to resolve, but I have an update on the issue observed as follows:-

  1. When I send a 5 sec audio, it is received and is audiable to the called party.
  2. If I send the 5 sec audio again, now there is no audio.
  3. I can repeat sending the 5 sec audio any number of times, there is no audio.
  4. Now if I send a different 10 sec audio. The first 5 sec of this 10 sec audio is not received (there is silence) and the remaining 5 sec of this 10 sec audio is received and is audiable.
  5. If I send the 10 sec audio again the full 10 sec is audiable to the called party. Now I can repeat sending the 10 sec audio is always fully received.
  6. If I start with point 1 again, identical issue is observed.

Request any one to point me in the right direction to help resolve this issue.

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