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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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)) {