Harald Welte has submitted this change and it was merged. Change subject: MSC_Tests: Support wildcarded endpoints (follow up) ......................................................................
MSC_Tests: Support wildcarded endpoints (follow up) The following tests still lack support for wildcarded endpoints: MSC_Tests.TC_lu_and_mo_call MSC_Tests.TC_emerg_call_imsi MSC_Tests.TC_mo_crcx_ran_reject MSC_Tests.TC_mt_crcx_ran_reject - Also add support for wildcarded endpoints for those tests. This is a follow up patch for: Change-Id I0efeae0f8a6e98deb843e79648f84a262f1d98f8 Change-Id: I16cb2582b9d1764d7cb7e4b787368a4dd5ddf69c Related: OS#2710 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 46 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 48da793..561cf19 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -563,8 +563,14 @@ /* First MGCP CRCX (for BSS/RAN side) */ [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); - /* TODO: dynamic EP allocation case */ - cpars.mgcp_ep := mgcp_cmd.line.ep; + + /* When the endpoint contains a wildcard we keep the endpoint + * identifier we have set up in cpars. Otherwise we use the + * endpoint name that the call agent has supplied */ + if (match(mgcp_cmd.line.ep, t_MGCP_EP_wildcard) == false) { + cpars.mgcp_ep := mgcp_cmd.line.ep; + } + var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_bss, cpars.mgw_rtp_ip_bss, hex2str(cpars.mgcp_call_id), "42", cpars.mgw_rtp_port_bss, @@ -572,7 +578,11 @@ { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, cpars.rtp_sdp_format)), valueof(ts_SDP_ptime(20)) })); - MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_bss, sdp)); + + var template MgcpResponse mgcp_resp; + mgcp_resp := ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_bss, sdp); + f_mgcp_par_append(mgcp_resp.params, ts_MgcpParSpecEP(cpars.mgcp_ep)); + MGCP.send(mgcp_resp); } } /* Second MGCP CRCX (this time for MSS/CN side) */ diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index e7ee9e7..485fd37 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -556,6 +556,7 @@ cpars.bss_rtp_port := 1110; cpars.mgcp_connection_id_bss := '22222'H; cpars.mgcp_connection_id_mss := '33333'H; + cpars.mgcp_ep := "rtpbridge/1@mgw"; f_perform_lu(); f_mo_call(cpars); @@ -848,6 +849,7 @@ private function f_emerg_call(MobileIdentityLV mi) runs on BSC_ConnHdlr { var CallParameters cpars := valueof(t_CallParams('112'H, 0)); cpars.emergency := true; + cpars.mgcp_ep := "rtpbridge/1@mgw"; f_mo_call(cpars); } @@ -1196,8 +1198,18 @@ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); MGCP.receive(tr_CRCX) -> value mgcp_cmd; + + /* Detect if the received CRCX is a wildcarded CRCX request. If yes, + * set an endpoint name that fits the pattern. If not, just use the + * endpoint name from the request */ + if (match(mgcp_cmd.line.ep, t_MGCP_EP_wildcard)) { + cpars.mgcp_ep := "rtpbridge/1@mgw"; + } else { + cpars.mgcp_ep := mgcp_cmd.line.ep; + } + cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); - cpars.mgcp_ep := mgcp_cmd.line.ep; + /* Respond to CRCX with error */ var MgcpResponse mgcp_rsp := { line := { @@ -1205,9 +1217,13 @@ trans_id := mgcp_cmd.line.trans_id, string := "FORCED_FAIL" }, - params := omit, sdp := omit } + var MgcpParameter mgcp_rsp_param := { + code := "Z", + val := cpars.mgcp_ep + }; + mgcp_rsp.params[0] := mgcp_rsp_param; MGCP.send(mgcp_rsp); timer T := 30.0; @@ -1291,7 +1307,16 @@ MGCP.receive(tr_CRCX) -> value mgcp_cmd; cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); - cpars.mgcp_ep := mgcp_cmd.line.ep; + + /* Detect if the received CRCX is a wildcarded CRCX request. If yes, + * set an endpoint name that fits the pattern. If not, just use the + * endpoint name from the request */ + if (match(mgcp_cmd.line.ep, t_MGCP_EP_wildcard)) { + cpars.mgcp_ep := "rtpbridge/1@mgw"; + } else { + cpars.mgcp_ep := mgcp_cmd.line.ep; + } + /* Respond to CRCX with error */ var MgcpResponse mgcp_rsp := { line := { @@ -1299,9 +1324,13 @@ trans_id := mgcp_cmd.line.trans_id, string := "FORCED_FAIL" }, - params := omit, sdp := omit } + var MgcpParameter mgcp_rsp_param := { + code := "Z", + val := cpars.mgcp_ep + }; + mgcp_rsp.params[0] := mgcp_rsp_param; MGCP.send(mgcp_rsp); timer T := 30.0; -- To view, visit https://gerrit.osmocom.org/7305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I16cb2582b9d1764d7cb7e4b787368a4dd5ddf69c Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: dexter <pma...@sysmocom.de> Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org> Gerrit-Reviewer: Jenkins Builder