SDP in reINVITE OK ignored when using direct media

I have observed the following behavior when direct media is enabled:

  1. An INVITE comes in with SDP that points to caller’s IP and port
  2. Asterisk sends an INVITE to the callee with SDP that points to Asterisk’s IP and port
  3. The callee responds OK to Asterisk with its SDP
  4. Asterisk responds OK to the caller with SDP that points to Asterisk’s IP and port
  5. Asterisk sends a reINVITE to the callee, changing the SDP to point to the caller’s IP and port
  6. Asterisk sends a reINVITE to the caller, changing the SDP to point to the callee’s IP and port
  7. The callee responds OK with same SDP it originally sent
  8. The caller responds OK, but the SDP now points to a different port from its original response
  9. Asterisk does not send a second reINVITE to the callee to correct the port
  10. The caller does not receive audio

Direct media works fine if the caller does not change the port on reINVITE, but breaks if it does.

I have tried setting direct_media_glare_mitigation to none and accept_multiple_sdp_answers to yes, but neither setting had any affect.

You’ll need to provide a SIP trace and debug log[1].

[1] Collecting Debug Information - Asterisk Documentation

@jcolp See attached logs.

This is with the following set on the receiving endpoint:

direct_media=yes
direct_media_glare_mitigation=none
accept_multiple_sdp_answers=yes
  • 10.3.101.190 is the asterisk server
  • 10.3.101.196 is the calling device
  • 172.30.253.177 is the receiving device

50132 is the original RTP port declared by 10.3.101.196 and 50174 is the updated port that 10.3.101.196 declares in response to the reINVITE, which asterisk does not pass on to 172.30.253.177.

@jcolp The UI won’t let me attach the file because I’m a new user. Do you want me to post it inline?

I have raised your trust level, and “accept_multiple_sdp_answers” must also be enabled at the system section as well. Did you do that? If not, then it would do nothing.

asterisk-debug.txt (114.0 KB)

Yes, I have the following in pjsip.conf

[system]
type=system
accept_multiple_sdp_answers=yes

You’ll need to file an issue[1], there is no guarantee or timeline on when it would get looked into.

[1] GitHub · Where software is built

Of course. Will do. Thank you