Res_rtp_asterisk does not transmit music on hold


I have migrated from Asterisk 1.4 to Asterisk 11 (11.6-cert13).

This is the problematic scenario:

  • A call enters from a SIP client (through Kamailio Proxy) to Asterisk extension.
  • The dialplan executes and the call is answered and redirected to the queue application.
  • The caller receives the correct RTP packets for the “ring” sound of the queue.
  • The call is assigned to an agent and the agent answers.
  • SIP call is re-invited for directmedia.
  • The caller receives the correct RTP packets from the agent.
  • The agent sets the call to hold (SDP: sendonly).
  • In Asterisk verbose you can see: “Started music on hold, class ‘default’, on SIP/(…)”
  • The caller does not receive any RTP packets from Asterisk. So there is no music on hold playing.
  • In Debug log I can see the following traces repeating until I exit the “hold” of the agent:
    DEBUG[20474][C-00000005] res_rtp_asterisk.c: Remote address is null, most likely RTP has been stopped

This worked before in version 1.4. But neither Asterisk 1.8 nor Asterisk 11 transmit the music correctly.

I suspect some error in my configuration. Where can I begin?


Actually the problem we find in cases like that is that both Asterisk and the upstream source send MoH direct to the destination and the destination gets confused. That’s because a=sendonly doubles as hold without media as well as a strict send only mode.

Thank you david551! But the problem is that while the agent is on hold the destination does not receive any RTP traffic. And at least there should be the music from Asterisk.
Maybe I am missing a module for playing the music?

Asterisk doesn’t, or at least didn’t, re-INVITE back for the MoH, so the agent may be ignoring the media, because the source is invalid.

Recent versions will reinvite back. I’d suggest providing the complete console output with SIP traffic so we can see what is going on.

Thank you. Finally the problem was that I was not loading all modules. After enabling “autoload” the music works correctly.

Now I am missing the RTCP packets, but that’s another thread.