aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2016-07-12 20:25:34 +0200
committerDaniel Willmann <daniel@totalueberwachung.de>2016-07-12 20:25:34 +0200
commit67ad1a276d038aa32b331b8b3ad52e3d3f74378c (patch)
treea809d801859cde66260a75f221f1c540b36c586c /epan
parent0ac2c285e965d7ae104f857c829c3978cdd7b83c (diff)
packet-rsl: Track rtp pt and codec for rsl
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-rsl.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/epan/dissectors/packet-rsl.c b/epan/dissectors/packet-rsl.c
index 593ea63016..3d7ef34f72 100644
--- a/epan/dissectors/packet-rsl.c
+++ b/epan/dissectors/packet-rsl.c
@@ -37,6 +37,7 @@
#include "lapd_sapi.h"
#include <epan/prefs.h>
#include <epan/expert.h>
+#include <epan/conversation.h>
#include "packet-rtp.h"
#include "packet-rtcp.h"
@@ -3031,13 +3032,22 @@ dissect_rsl_ie_tfo_transp_cont(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
return ie_offset + length;
}
+struct dyn_pl_info_t {
+ guint8 rtp_codec;
+ guint8 rtp_pt;
+};
+
static int
dissct_rsl_ipaccess_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
{
guint8 msg_type;
guint32 local_addr = 0;
guint16 local_port = 0;
+ guint8 rtp_codec = 255, rtp_pt = 0;
address src_addr;
+ rtp_dyn_payload_t *dyn_pl = NULL;
+ struct dyn_pl_info_t *dyn_pl_info;
+ conversation_t *conv;
msg_type = tvb_get_guint8(tvb, offset) & 0x7f;
offset++;
@@ -3115,13 +3125,32 @@ dissct_rsl_ipaccess_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
case RSL_IE_IPAC_SPEECH_MODE:
proto_tree_add_item(ie_tree, hf_rsl_speech_mode_s, tvb,
offset, len, ENC_BIG_ENDIAN);
+ rtp_codec = tvb_get_guint8(tvb, offset) & 0x0f;
+ conv = find_or_create_conversation(pinfo);
+ dyn_pl_info = (struct dyn_pl_info_t *)conversation_get_proto_data(conv, proto_rsl);
+ if (!dyn_pl_info) {
+ dyn_pl_info = (struct dyn_pl_info_t *)wmem_alloc(wmem_file_scope(), sizeof(*dyn_pl_info));
+ conversation_add_proto_data(conv, proto_rsl, (void *)dyn_pl_info);
+ }
+ dyn_pl_info->rtp_codec = rtp_codec;
+
proto_tree_add_item(ie_tree, hf_rsl_speech_mode_m, tvb,
offset, len, ENC_BIG_ENDIAN);
break;
case RSL_IE_IPAC_RTP_PAYLOAD:
case RSL_IE_IPAC_RTP_PAYLOAD2:
+ /* Need to set pl here */
proto_tree_add_item(ie_tree, hf_rsl_rtp_payload, tvb,
offset, len, ENC_BIG_ENDIAN);
+ rtp_pt = tvb_get_guint8(tvb, offset);
+ conv = find_or_create_conversation(pinfo);
+ dyn_pl_info = (struct dyn_pl_info_t *)conversation_get_proto_data(conv, proto_rsl);
+ if (!dyn_pl_info) {
+ dyn_pl_info = (struct dyn_pl_info_t *)wmem_alloc(wmem_file_scope(), sizeof(*dyn_pl_info));
+ conversation_add_proto_data(conv, proto_rsl, (void *)dyn_pl_info);
+ }
+ dyn_pl_info->rtp_pt = rtp_pt;
+
break;
case RSL_IE_IPAC_RTP_CSD_FMT:
proto_tree_add_item(ie_tree, hf_rsl_rtp_csd_fmt_d, tvb,
@@ -3159,10 +3188,19 @@ dissct_rsl_ipaccess_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
src_addr.type = AT_IPv4;
src_addr.len = 4;
src_addr.data = (guint8 *)&local_addr;
+
+ conv = find_or_create_conversation(pinfo);
+ dyn_pl_info = (struct dyn_pl_info_t *)conversation_get_proto_data(conv, proto_rsl);
+ if (dyn_pl_info && (dyn_pl_info->rtp_codec == 2 || dyn_pl_info->rtp_codec == 5)) {
+ dyn_pl = rtp_dyn_payload_new();
+ rtp_dyn_payload_insert(dyn_pl, dyn_pl_info->rtp_pt, "AMR", 8000);
+ conversation_delete_proto_data(conv, proto_rsl);
+ }
rtp_add_address(pinfo, &src_addr, local_port, 0,
- "GSM A-bis/IP", pinfo->num, 0, NULL);
+ "GSM A-bis/IP", pinfo->num, 0, dyn_pl);
rtcp_add_address(pinfo, &src_addr, local_port+1, 0,
"GSM A-bis/IP", pinfo->num);
+
break;
}
return offset;