mgw: generalize f_dlcx versions, avoiding copy+paste
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 9a2f754..df07bd0 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -368,15 +368,15 @@
return '00000000'H;
}
- /* Send DLCX and expect OK response */
- function f_dlcx_ok(MgcpEndpoint ep, template MgcpCallId call_id := omit,
- template MgcpConnectionId conn_id := omit) runs on dummy_CT {
+ function f_dlcx(MgcpEndpoint ep, template MgcpResponseCode ret_code, template charstring ret_val,
+ template MgcpCallId call_id := omit,
+ template MgcpConnectionId conn_id := omit) runs on dummy_CT {
var template MgcpCommand cmd;
var MgcpResponse resp;
var template MgcpResponse rtmpl := {
line := {
- code := "200",
- string := "OK"
+ code := ret_code,
+ string := ret_val
},
params := *,
sdp := *
@@ -385,21 +385,16 @@
resp := mgcp_transceive_mgw(cmd, rtmpl);
}
+ /* Send DLCX and expect OK response */
+ function f_dlcx_ok(MgcpEndpoint ep, template MgcpCallId call_id := omit,
+ template MgcpConnectionId conn_id := omit) runs on dummy_CT {
+ f_dlcx(ep, "200", "OK", call_id, conn_id);
+ }
+
/* Send DLCX and accept any response */
function f_dlcx_ignore(MgcpEndpoint ep, template MgcpCallId call_id := omit,
template MgcpConnectionId conn_id := omit) runs on dummy_CT {
- var template MgcpCommand cmd;
- var MgcpResponse resp;
- var template MgcpResponse rtmpl := {
- line := {
- code := ?,
- string := ?
- },
- params := *,
- sdp := *
- };
- cmd := ts_DLCX(get_next_trans_id(), ep, call_id, conn_id);
- resp := mgcp_transceive_mgw(cmd, rtmpl);
+ f_dlcx(ep, ?, *, call_id, conn_id);
}
/* test valid CRCX without SDP */