summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-09-10 18:03:08 +0200
committerpespin <pespin@sysmocom.de>2020-09-16 10:36:44 +0000
commit956bfd247df997a0cbd7cc1669d1bb92af8db24b (patch)
tree84885c1f85cf022382070a6fa2e53fdc0c8d8d5b
parent563b3d013b166115a4f9e526d5e21df36f3bd399 (diff)
msc: Validate RTP addr+port passed from MNCC to MGCP MDCX
-rw-r--r--msc/BSC_ConnectionHandler.ttcn28
1 files changed, 21 insertions, 7 deletions
diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 9218c76..6ea4f86 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -1022,14 +1022,28 @@ runs on BSC_ConnHdlr {
/* MDCX setting up the CN side remote RTP address received from MNCC CONNECT */
[] MGCP.receive(tr_MDCX) -> value mgcp_cmd {
+ var SDP_Message sdp;
log("f_mt_call_complete 9");
- var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_conn_2.mgw_rtp_ip, cpars.mgw_conn_2.mgw_rtp_ip,
- hex2str(cpars.mgcp_call_id), "42",
- cpars.mgw_conn_2.mgw_rtp_port,
- { int2str(cpars.rtp_payload_type) },
- { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type,
- cpars.rtp_sdp_format)),
- valueof(ts_SDP_ptime(20)) }));
+
+ if (isvalue(mgcp_cmd.sdp)) {
+ sdp := mgcp_cmd.sdp;
+ if (sdp.media_list[0].media_field.ports.port_number != cpars.mncc_rtp_port) {
+ setverdict(fail, "Wrong MDCX Connection port received, expected ", cpars.mncc_rtp_port, " and received ", sdp.media_list[0].media_field.ports.port_number)
+ mtc.stop;
+ }
+ if (sdp.connection.conn_addr.addr != cpars.mncc_rtp_ip) {
+ setverdict(fail, "Wrong MDCX Connection address received, expected ", cpars.mncc_rtp_ip, " and received ", sdp.connection.conn_addr.addr)
+ mtc.stop;
+ }
+ }
+
+ sdp := valueof(ts_SDP(cpars.mgw_conn_2.mgw_rtp_ip, cpars.mgw_conn_2.mgw_rtp_ip,
+ hex2str(cpars.mgcp_call_id), "42",
+ cpars.mgw_conn_2.mgw_rtp_port,
+ { int2str(cpars.rtp_payload_type) },
+ { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type,
+ cpars.rtp_sdp_format)),
+ valueof(ts_SDP_ptime(20)) }));
MGCP.send(ts_MDCX_ACK(mgcp_cmd.line.trans_id, cpars.mgw_conn_2.mgcp_connection_id, sdp));
}