Problem
Incoming SIP video calls fail or are immediately terminated when the remote side offers H264 using a dynamic RTP payload type other than 96.
The stack appears to hardcode H264 RTP payload type 96 in the SDP answer instead of using the payload type negotiated in the remote offer.
This causes interoperability issues with Asterisk/Wazo/SIP.js.
Expected Behavior
If the remote SDP offer contains:
m=video 11692 RTP/AVP 108 100 99
a=rtpmap:99 H264/90000
then the SDP answer should reuse payload type 99:
m=video 21679 RTP/AVP 99
a=rtpmap:99 H264/90000
The RTP sender should also transmit H264 packets using payload type 99.
Actual Behavior
The implementation always answers with payload type 96:
m=video 21679 RTP/AVP 96
a=rtpmap:96 H264/90000
even though the remote side offered H264 as payload type 99.
After ACK, Asterisk immediately sends BYE and terminates the call.
Logs
Remote Offer
m=video 11692 RTP/AVP 108 100 99
a=rtpmap:108 VP9/90000
a=rtpmap:100 VP8/90000
a=rtpmap:99 H264/90000
a=fmtp:99 packetization-mode=1;level-asymmetry-allowed=1;profile-level-id=42001F
ESP32 SDP Answer
m=video 21679 RTP/AVP 96
a=rtpmap:96 H264/90000
Call Teardown
Immediately after ACK:
BYE sip:110@192.168.8.103:11162;transport=UDP SIP/2.0
Reason: Q.850;cause=16
Notes
Audio negotiation succeeds correctly.
This issue only affects video negotiation due to incorrect dynamic RTP payload mapping.
The implementation should:
- Parse offered payload IDs
- Select matching codec
- Reuse the offered dynamic payload type in SDP answer
- Use the negotiated payload type during RTP transmission
Hardcoding payload type 96 breaks interoperability with many SIP/WebRTC/Asterisk endpoints.
Problem
Incoming SIP video calls fail or are immediately terminated when the remote side offers H264 using a dynamic RTP payload type other than 96.
The stack appears to hardcode H264 RTP payload type
96in the SDP answer instead of using the payload type negotiated in the remote offer.This causes interoperability issues with Asterisk/Wazo/SIP.js.
Expected Behavior
If the remote SDP offer contains:
then the SDP answer should reuse payload type
99:The RTP sender should also transmit H264 packets using payload type
99.Actual Behavior
The implementation always answers with payload type
96:even though the remote side offered H264 as payload type
99.After ACK, Asterisk immediately sends BYE and terminates the call.
Logs
Remote Offer
ESP32 SDP Answer
Call Teardown
Immediately after ACK:
Notes
Audio negotiation succeeds correctly.
This issue only affects video negotiation due to incorrect dynamic RTP payload mapping.
The implementation should:
Hardcoding payload type 96 breaks interoperability with many SIP/WebRTC/Asterisk endpoints.