mgw: generalize f_dlcx versions, avoiding copy+paste

This commit is contained in:
Harald Welte 2017-11-18 19:40:31 +01:00
parent 79181ffc8b
commit 10889c1d13
1 changed files with 12 additions and 17 deletions

View File

@ -368,15 +368,15 @@ module MGCP_Test {
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 @@ module MGCP_Test {
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 */