aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2022-09-07 21:03:22 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2022-11-02 10:47:00 +0100
commit5438628f481b8fc1cbef3a8a75b5a3fbd034e7c8 (patch)
tree265f15db1a663369c00c62bd3646409d980597c4
parenta1c55f2356c90dbd60861e33270f875b24734346 (diff)
WIP RFC: disable handling SDP RTP if Osmux is announced in MGCP bodypespin/osmux-wip
"X-Osmux: (*|<cid>)" is an Osmocom extension to MGCP which allows to signal request and acceptance of use of Osmux framing instead of RTP. It usually comes together with a regular SDP section which defines the AMR data to be transported (in Osmux frames rather than RTP packets). Hence, if Osmux is signalled, we want to avoid telling the RTP subsystem to decode the recorded packets as RTP, which would then override the default Osmux dissector. TODO: find way to mark a packet_info as being "osmux" in packet-mgcp.c, and use that information in packet-sdp.c to avoid adding the stream to the RTP dissector.
-rw-r--r--epan/dissectors/packet-mgcp.c31
-rw-r--r--epan/dissectors/packet-sdp.c4
2 files changed, 32 insertions, 3 deletions
diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c
index f8de090a45..ba350d2e3f 100644
--- a/epan/dissectors/packet-mgcp.c
+++ b/epan/dissectors/packet-mgcp.c
@@ -157,6 +157,7 @@ static int hf_mgcp_req_dup = -1;
static int hf_mgcp_req_dup_frame = -1;
static int hf_mgcp_rsp_dup = -1;
static int hf_mgcp_rsp_dup_frame = -1;
+static int hf_mgcp_param_x_osmux = -1;
static int hf_mgcp_unknown_parameter = -1;
static int hf_mgcp_malformed_parameter = -1;
@@ -882,25 +883,34 @@ static gint tvb_parse_param(tvbuff_t* tvb, gint offset, gint len, int** hf, mgcp
tvb_current_offset++;
/* Keep going, through possible vendor param name */
+ char ext_buf[256];
+ ext_buf[0] = '\0';
for (counter = 1;
((len > (counter + tvb_current_offset-offset)) &&
(g_ascii_isalpha(tempchar = tvb_get_guint8(tvb, tvb_current_offset+counter)) ||
g_ascii_isdigit(tempchar))) ;
- counter++);
+ counter++) ext_buf[counter - 1] = g_ascii_toupper(tempchar);
if (tempchar == ':')
{
/* Looks like a valid vendor param name */
- tvb_current_offset += counter;
+ ext_buf[counter - 1] = '\0';
+ fprintf(stderr, "MGCP Extension: %s\n", ext_buf);
switch (plus_minus)
{
case '+':
*hf = &hf_mgcp_param_extension_critical;
break;
case '-':
- *hf = &hf_mgcp_param_extension;
+ if (strcmp(ext_buf, "OSMUX") == 0) {
+ fprintf(stderr, "MGCP Extension: is Osmux!!\n");
+ *hf = &hf_mgcp_param_x_osmux;
+ } else {
+ *hf = &hf_mgcp_param_extension;
+ }
break;
}
+ tvb_current_offset += counter;
}
}
break;
@@ -1554,6 +1564,18 @@ static void dissect_mgcp_params(tvbuff_t *tvb, proto_tree *tree, mgcp_info_t* mi
dissect_mgcp_remotevoicemetrics(mgcp_param_tree, tvb, tvb_linebegin,
tvb_tokenbegin - tvb_linebegin, tokenlen);
}
+ /*
+ else
+ if (*my_param == hf_mgcp_param_x_osmux)
+ {
+ tokenlen = tvb_find_line_end(tvb, tvb_tokenbegin, -1, &tvb_lineend, FALSE);
+ proto_tree_add_string(mgcp_param_tree, *my_param, tvb,
+ tvb_linebegin, linelen,
+ tvb_format_text(wmem_packet_scope(), tvb, tvb_tokenbegin, tokenlen));
+
+ TODO: mark somewhere that Osmux is used, so that packet-sdp.c doesn't call srtp_add_address().
+ }
+ */
else
{
tokenlen = tvb_find_line_end(tvb, tvb_tokenbegin, -1, &tvb_lineend, FALSE);
@@ -2664,6 +2686,9 @@ void proto_register_mgcp(void)
{ &hf_mgcp_rsp_dup_frame,
{ "Original Response Frame", "mgcp.rsp.dup.frame", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"Frame containing original response", HFILL }},
+ { &hf_mgcp_param_x_osmux,
+ { "Osmux", "mgcp.param.x_osmux", FT_STRING, BASE_NONE, NULL, 0x0,
+ "Osmux CID", HFILL }},
{ &hf_mgcp_unknown_parameter,
{ "Unknown parameter", "mgcp.unknown_parameter", FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
diff --git a/epan/dissectors/packet-sdp.c b/epan/dissectors/packet-sdp.c
index 165b4a4b52..8b361e8178 100644
--- a/epan/dissectors/packet-sdp.c
+++ b/epan/dissectors/packet-sdp.c
@@ -2348,9 +2348,11 @@ apply_sdp_transport(packet_info *pinfo, transport_info_t *transport_info, int re
DPRINT(("calling rtp_add_address, channel=%d, media_port=%d",
i, media_desc->media_port));
DINDENT();
+ /* TODO: Here only call this if !osmux:
srtp_add_address(pinfo, PT_UDP, &media_desc->conn_addr, media_desc->media_port, 0, "SDP", establish_frame,
media_desc->media_types,
media_desc->media.rtp_dyn_payload, NULL, setup_info);
+ */
DENDENT();
}
/* SPRT might use the same port... */
@@ -2367,7 +2369,9 @@ apply_sdp_transport(packet_info *pinfo, transport_info_t *transport_info, int re
DPRINT(("calling rtcp_add_address, channel=%d, control_port=%d",
i, media_desc->control_port));
DINDENT();
+ /* TODO: Here only call this if !osmux:
rtcp_add_address(pinfo, &media_desc->conn_addr, media_desc->control_port, 0, "SDP", establish_frame);
+ */
DENDENT();
}
}