From 3ca29b82341e5be95a3534776d21282772f5c8a4 Mon Sep 17 00:00:00 2001 From: Mark T Date: Sun, 29 Mar 2026 12:45:05 -0500 Subject: [PATCH 1/2] Fix SDP extraction from multipart/mixed SIP message bodies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/call.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/call.cpp b/src/call.cpp index 50ea683e..da80d5c0 100644 --- a/src/call.cpp +++ b/src/call.cpp @@ -4571,8 +4571,13 @@ bool call::process_incoming(const char* msg, const struct sockaddr_storage* src) } } - /* Check if message has a SDP in it; and extract media information. */ - if (!strcmp(get_header_content(msg, "Content-Type:"), "application/sdp") && + /* Check if message has a SDP in it; and extract media information. + * Also handle multipart/mixed bodies that contain an application/sdp part + * (e.g. SIP messages carrying both SDP and PIDF-LO geolocation). */ + const char* ct_hdr = get_header_content(msg, "Content-Type:"); + bool has_sdp_content = !strcmp(ct_hdr, "application/sdp") || + (strstr(ct_hdr, "multipart/") && strstr(msg, "application/sdp")); + if (has_sdp_content && (hasMedia == 1) && (!curmsg->ignoresdp)) { From c0bde314902c180a3579682f71b5cb3db216b9bd Mon Sep 17 00:00:00 2001 From: Mark T Date: Mon, 27 Apr 2026 09:54:32 -0500 Subject: [PATCH 2/2] regress: add multipart SDP + PIDF-LO test for #862 --- regress/github-#0862/run | 24 ++++++++++ regress/github-#0862/uac.xml | 93 ++++++++++++++++++++++++++++++++++++ regress/github-#0862/uas.xml | 77 +++++++++++++++++++++++++++++ 3 files changed, 194 insertions(+) create mode 100644 regress/github-#0862/run create mode 100644 regress/github-#0862/uac.xml create mode 100644 regress/github-#0862/uas.xml diff --git a/regress/github-#0862/run b/regress/github-#0862/run new file mode 100644 index 00000000..52b35ae6 --- /dev/null +++ b/regress/github-#0862/run @@ -0,0 +1,24 @@ +#!/bin/sh +# This regression test is a part of SIPp. +# Validate RTP extraction when INVITE body is multipart/mixed with SDP + PIDF-LO. +. "`dirname "$0"`/../functions"; init + +uac_media_port=5072 + +udplisten $uac_media_port >udplisten.log & +udplisten_job=$! +trap "kill -9 $udplisten_job 2>/dev/null" EXIT + +sippbg -sf uas.xml -i 127.0.0.1 -p 5070 -m 1 +sippfg -m 1 -sf uac.xml 127.0.0.1:5070 -i 127.0.0.1 \ + -trace_msg -message_file tmp.log -timeout 6 -timeout_error >/dev/null 2>&1 +status=$? + +test $status -ne 0 && fail "SIPp UAC job failed" + +port=`sed -e '/^Connectionless from/!d;s/.*://' udplisten.log` +if test -n "$port"; then + ok +else + fail "got no RTP at all" +fi diff --git a/regress/github-#0862/uac.xml b/regress/github-#0862/uac.xml new file mode 100644 index 00000000..c524a0cc --- /dev/null +++ b/regress/github-#0862/uac.xml @@ -0,0 +1,93 @@ + + + + + + + + + open + + + + + 37.7749 -122.4194 + + + + + + --boundary42-- + + ]]> + + + + + + + + + + + + + + + + + + diff --git a/regress/github-#0862/uas.xml b/regress/github-#0862/uas.xml new file mode 100644 index 00000000..a9ad602a --- /dev/null +++ b/regress/github-#0862/uas.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +