Skip to content

SDP Answer Uses Wrong Dynamic Payload Type for H264 and no incoming SIP MESSAGE event callback #1610

@bhupiister

Description

@bhupiister

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:

  1. Parse offered payload IDs
  2. Select matching codec
  3. Reuse the offered dynamic payload type in SDP answer
  4. Use the negotiated payload type during RTP transmission

Hardcoding payload type 96 breaks interoperability with many SIP/WebRTC/Asterisk endpoints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions