aboutsummaryrefslogtreecommitdiffstats
path: root/mgw/MGCP_Test.ttcn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-11-18 19:22:00 +0100
committerHarald Welte <laforge@gnumonks.org>2017-11-18 19:22:00 +0100
commit9988d28228db91116e9df02d4d858c4a97498387 (patch)
treeb4c5445347fe6a3b9bee0519fd712264290bca41 /mgw/MGCP_Test.ttcn
parentedc45c19fdb1fb6f61cf6806885db1311aec47f8 (diff)
mgw: Avoid copy+paste of CRCX_ACK template
Diffstat (limited to 'mgw/MGCP_Test.ttcn')
-rw-r--r--mgw/MGCP_Test.ttcn39
1 files changed, 12 insertions, 27 deletions
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index e6e03505..debe36c6 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);