mgw: Avoid copy+paste of CRCX_ACK template

This commit is contained in:
Harald Welte 2017-11-18 19:22:00 +01:00
parent edc45c19fd
commit 9988d28228
1 changed files with 12 additions and 27 deletions

View File

@ -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);