msc: Validate RTP addr+port passed from MNCC to MGCP MDCX

Change-Id: I0b53643ed3a8f8550b2ea6e8832068d603a676e1
changes/61/20061/3
Pau Espin 2 years ago committed by pespin
parent 563b3d013b
commit 956bfd247d
  1. 28
      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));
}

Loading…
Cancel
Save