diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-11-18 19:40:31 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-11-18 19:40:31 +0100 |
commit | 10889c1d1394773c32ac662375c482150a2e8ab4 (patch) | |
tree | 559b280666aed6ddcc4fa37ea47f361c108709f3 /mgw/MGCP_Test.ttcn | |
parent | 79181ffc8be089ebc5484333956f30e844554277 (diff) |
mgw: generalize f_dlcx versions, avoiding copy+paste
Diffstat (limited to 'mgw/MGCP_Test.ttcn')
-rw-r--r-- | mgw/MGCP_Test.ttcn | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index 9a2f7547..df07bd0a 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -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 */ |