From 9988d28228db91116e9df02d4d858c4a97498387 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 18 Nov 2017 19:22:00 +0100 Subject: [PATCH] mgw: Avoid copy+paste of CRCX_ACK template --- mgw/MGCP_Test.ttcn | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index e6e03505a..debe36c6d 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -128,6 +128,15 @@ module MGCP_Test { sdp := sdp } + template MgcpResponse tr_CRCX_ACK := { + line := { + code := "200", + string := "OK" + }, + params:= { { "I", ? }, *}, + sdp := ? + } + template MgcpCommand ts_MDCX(MgcpTransId trans_id, charstring ep, MgcpConnectionMode mode, MgcpCallId call_id, template SDP_Message sdp := omit) := { line := t_MgcpCmdLine("MDCX", trans_id, ep), params := { @@ -399,20 +408,12 @@ module MGCP_Test { var MgcpResponse resp; var MgcpEndpoint ep := "2@mgw"; var MgcpCallId call_id := '1234'H; - var template MgcpResponse rtmpl := { - line := { - code := "200", - string := "OK" - }, - params := { { "I", ? }, *}, - sdp := ? - }; f_init(ep); /* create the connection on the MGW */ cmd := ts_CRCX(get_next_trans_id(), ep, "recvonly", call_id); - resp := mgcp_transceive_mgw(cmd, rtmpl); + resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK); extract_conn_id(resp); /* clean-up */ @@ -553,14 +554,6 @@ module MGCP_Test { var MgcpResponse resp; var MgcpEndpoint ep := "2@mgw"; var MgcpCallId call_id := '1226'H; - var template MgcpResponse rtmpl := { - line := { - code := "200", - string := "OK" - }, - params := { { "I", ? }, *}, - sdp := ? - }; f_init(ep); @@ -568,7 +561,7 @@ module MGCP_Test { cmd.sdp := ts_SDP("127.0.0.1", "127.0.0.2", "23", "42", 2344, { "98" }, { valueof(ts_SDP_rtpmap(98, "AMR/8000")), valueof(ts_SDP_ptime(20)) }); - resp := mgcp_transceive_mgw(cmd, rtmpl); + resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK); setverdict(pass); } @@ -634,19 +627,11 @@ module MGCP_Test { var MgcpResponse resp; var MgcpEndpoint ep := "5@mgw"; var MgcpCallId call_id := '51234'H; - var template MgcpResponse rtmpl := { - line := { - code := ("200", "250"), - string := "OK" - }, - params:= { { "I", ? }, *}, - sdp := ? - }; f_init(ep); cmd := ts_CRCX(get_next_trans_id(), ep, "recvonly", call_id); - resp := mgcp_transceive_mgw(cmd, rtmpl); + resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK); f_dlcx_ok(ep, call_id);