aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sip.c
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2014-03-06 17:20:48 -0500
committerEvan Huus <eapache@gmail.com>2014-03-12 17:59:51 +0000
commitc4c83502849ec2e0a2544e494647641d6c16dc4f (patch)
treea2b0dc165f37afcf6f7c8361b5bdbac903b4fc65 /epan/dissectors/packet-sip.c
parent70ff7be1e6735cd9b00bfeb1c23bf19cf1250c01 (diff)
Fix bug 9021: 'RTP not decoded inside the conversation in v.1.10.1'
The behavior for SIP/SDP handling of RTP conversation tracking changed in v1.10, with some unintended consequences. The bugs did not show up at the time because wireshark makes 2 passes of the packet list, and so the problems auto-corrected themselves in most cases. Unfortunately, a change in r53641 modified how UDP behaves, making it always create conversations for UDP packets, and that exposed the bugs inherent in the SIP/SDP code changes. This commit reverts the behavior of SIP/SDP to its pre-1.10 model, but creates a new preference setting for "Delay SDP changes for tracking media", which if enabled, will turn on the new (but buggy) model introduced in 1.10. This preference is *disabled* by default, since for a majority of cases the new behavior is worse than the previous behavior. The preference, and this commit's fix, is not intended to last long. I intend to re-write the SIP/SDP/RTP interaction model for release 1.11 - I think it's too big a change for 1.10, however, which is why I submitted this commit. Change-Id: Ic5601749d6c2344e952ced8206dd9296bfdc4b90 Reviewed-on: https://code.wireshark.org/review/543 Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-sip.c')
-rw-r--r--epan/dissectors/packet-sip.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c
index 7072d76d40..09bec53be8 100644
--- a/epan/dissectors/packet-sip.c
+++ b/epan/dissectors/packet-sip.c
@@ -57,7 +57,6 @@
#include "packet-sdp.h" /* SDP needs a transport layer to determine request/response */
-
#define TCP_PORT_SIP 5060
#define UDP_PORT_SIP 5060
#define TLS_PORT_SIP 5061
@@ -811,6 +810,9 @@ static gboolean sip_desegment_body = TRUE;
*/
static gboolean sip_retrans_the_same_sport = TRUE;
+/* whether we hold off tracking RTP conversations until an SDP answer is received */
+static gboolean sip_delay_sdp_changes = FALSE;
+
/* Extension header subdissectors */
static dissector_table_t ext_hdr_subdissector_table;
@@ -3506,15 +3508,15 @@ dissect_sip_common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr
/* Resends don't count */
if (resend_for_packet == 0) {
if (line_type == REQUEST_LINE) {
- setup_sdp_transport(next_tvb, pinfo, SDP_EXCHANGE_OFFER, pinfo->fd->num);
+ setup_sdp_transport(next_tvb, pinfo, SDP_EXCHANGE_OFFER, pinfo->fd->num, sip_delay_sdp_changes);
} else if (line_type == STATUS_LINE) {
if (stat_info->response_code >= 400) {
/* SIP client request failed, so SDP offer should fail */
- setup_sdp_transport(next_tvb, pinfo, SDP_EXCHANGE_ANSWER_REJECT, request_for_response);
+ setup_sdp_transport(next_tvb, pinfo, SDP_EXCHANGE_ANSWER_REJECT, request_for_response, sip_delay_sdp_changes);
}
else if ((stat_info->response_code >= 200) && (stat_info->response_code <= 299)) {
/* SIP success request, so SDP offer should be accepted */
- setup_sdp_transport(next_tvb, pinfo, SDP_EXCHANGE_ANSWER_ACCEPT, request_for_response);
+ setup_sdp_transport(next_tvb, pinfo, SDP_EXCHANGE_ANSWER_ACCEPT, request_for_response, sip_delay_sdp_changes);
}
}
} else {
@@ -5576,6 +5578,13 @@ void proto_register_sip(void)
"Retransmissions always use the same source port",
"Whether retransmissions are detected coming from the same source port only.",
&sip_retrans_the_same_sport);
+ prefs_register_bool_preference(sip_module, "delay_sdp_changes",
+ "Delay SDP changes for tracking media",
+ "Whether SIP should delay tracking the media (e.g., RTP/RTCP) until an SDP offer "
+ "is answered. If enabled, mid-dialog changes to SDP and media state only take "
+ "effect if and when an SDP offer is successfully answered; however enabling this "
+ "prevents tracking media in early-media call scenarios",
+ &sip_delay_sdp_changes);
prefs_register_obsolete_preference(sip_module, "tcp.port");