Skip to content

pjmedia: Handle zero-port bundle-only offers#5067

Merged
sauwming merged 2 commits into
pjsip:masterfrom
seifzadeh:fix/bundle-only-zero-port
Jul 13, 2026
Merged

pjmedia: Handle zero-port bundle-only offers#5067
sauwming merged 2 commits into
pjsip:masterfrom
seifzadeh:fix/bundle-only-zero-port

Conversation

@seifzadeh

Copy link
Copy Markdown
Contributor

Description

This fixes handling of zero-port a=bundle-only media sections in SDP offers.

The issue was found while working on Asterisk issue asterisk/asterisk#2010, where a WebRTC offer contained multiple media sections in a BUNDLE group.

RFC 9143 allows a bundled media section to use port zero when it contains a=bundle-only. Previously, pjmedia rejected every zero-port media section before codec negotiation.

The fix:

  • detects a=bundle-only,
  • reads the media section a=mid,
  • verifies that the MID belongs to a=group:BUNDLE,
  • and continues normal negotiation only for valid BUNDLE-only sections.

Other zero-port media sections keep the existing rejection behavior.

Testing

  • Built pjproject master successfully.
  • Ran make pjmedia-test.
  • All 5 PJMEDIA test groups passed.
  • Added a regression test for port=0 + bundle-only + MID in group:BUNDLE.
  • Verified the original Asterisk WebRTC scenario.

@CLAassistant

CLAassistant commented Jul 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates PJMEDIA’s SDP negotiation to accept RFC 9143 “bundle-only” offered media sections that use port 0, so they aren’t rejected before codec negotiation when their a=mid is included in the session-level a=group:BUNDLE line.

Changes:

  • Added detection of valid port=0 + a=bundle-only + a=mid in group:BUNDLE offered media sections.
  • Updated offer/answer matching to only deactivate zero-port sections when they are not valid bundle-only offers.
  • Added a regression test covering the bundle-only zero-port offer case.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pjmedia/src/pjmedia/sdp_neg.c Adds bundle-only detection and threads it into match_offer() so valid bundle-only port=0 offers aren’t deactivated.
pjmedia/src/test/sdp_neg_test.c Adds a regression test ensuring negotiation succeeds and the bundle-only media section is not answered with port 0.

Comment thread pjmedia/src/pjmedia/sdp_neg.c Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@sauwming sauwming requested a review from nanangizz July 13, 2026 03:32

@nanangizz nanangizz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign the CLA

@sauwming sauwming merged commit 5866675 into pjsip:master Jul 13, 2026
71 of 72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants