Skip to content

Fix SDP extraction from multipart/mixed SIP message bodies#862

Merged
lemenkov merged 2 commits intoSIPp:masterfrom
nvwx:fix/multipart-sdp-parsing
Apr 27, 2026
Merged

Fix SDP extraction from multipart/mixed SIP message bodies#862
lemenkov merged 2 commits intoSIPp:masterfrom
nvwx:fix/multipart-sdp-parsing

Conversation

@nvwx
Copy link
Copy Markdown

@nvwx nvwx commented Mar 29, 2026

Summary

The Content-Type check in process_incoming() (call.cpp:4575) only matched application/sdp exactly, causing SIPp to skip SDP media extraction entirely when the body was multipart/mixed. This meant rtp_stream, PCAP play, and SRTP parameter extraction never ran for multipart messages.

Problem

SIP messages carrying both SDP and PIDF-LO geolocation data (per RFC 5621 / RFC 5765) use Content-Type: multipart/mixed with the SDP in one MIME part. This is standard for E911 call flows. When SIPp received such an INVITE as a UAS, it never extracted the remote media address, so rtp_stream had no destination and sent zero RTP packets.

Fix

Extend the Content-Type check to also match multipart/* bodies that contain an application/sdp part. The existing find_in_sdp() and extract_rtp_remote_addr() functions already search raw message text and work correctly with multipart content — they just were never called.

Test plan

  • SIPp UAS scenario receiving an INVITE with Content-Type: multipart/mixed containing SDP + PIDF-LO
  • Verify rtp_stream sends audio (previously sent 0 packets)
  • Verify plain application/sdp INVITEs still work as before

The Content-Type check in process_incoming() only matched
"application/sdp" exactly, causing SIPp to skip SDP media
extraction entirely when the body was multipart/mixed (e.g.
SIP messages carrying both SDP and PIDF-LO geolocation per
RFC 5765). This meant rtp_stream, PCAP play, and SRTP
parameter extraction never ran for multipart messages.

The fix extends the check to also match multipart/* bodies
that contain an application/sdp part. The existing find_in_sdp()
and extract_rtp_remote_addr() functions already search raw
message text and work correctly with multipart content — they
just were never called.

Fixes UAS scenarios where the incoming INVITE carries geolocation
data alongside SDP in a multipart/mixed body, resulting in zero
outbound RTP despite rtp_stream being configured.
@orgads
Copy link
Copy Markdown
Contributor

orgads commented Mar 30, 2026

Thank you! Can you please add a unit test for this?

@nvwx
Copy link
Copy Markdown
Author

nvwx commented Apr 10, 2026

Thank you! Can you please add a unit test for this?

You bet and sorry for the delay, I'll hopefully get some time to get this in this weekend.

@lemenkov
Copy link
Copy Markdown
Member

LGTM

@lemenkov lemenkov merged commit f7a06a0 into SIPp:master Apr 27, 2026
9 checks passed
@nvwx nvwx deleted the fix/multipart-sdp-parsing branch April 27, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants