summaryrefslogtreecommitdiffstats
path: root/library/MGCP_Templates.ttcn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-01-26 19:16:05 +0100
committerHarald Welte <laforge@gnumonks.org>2018-01-26 22:53:57 +0100
commitb71901a52f0901d5ec3b5e0a2ebaab4aef20ff26 (patch)
treeda5c98afef8c3586baa96f45517f645ca866f11c /library/MGCP_Templates.ttcn
parent9601c8106afdd43e1b2b2e5c154ac49062d39cfa (diff)
msc: Rewrite TC_lu_and_mo_call() to be more modular
All relevant parameters are passed in in form of a CallParameters record, and the bulk of the work has been moved to BSC_ConnectionHandler. Change-Id: I932c6c9f7a48b6a1f1ec399e8bba6a413c8bc69e
Diffstat (limited to 'library/MGCP_Templates.ttcn')
-rw-r--r--library/MGCP_Templates.ttcn50
1 files changed, 41 insertions, 9 deletions
diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn
index c0c827f..182868e 100644
--- a/library/MGCP_Templates.ttcn
+++ b/library/MGCP_Templates.ttcn
@@ -137,8 +137,8 @@ module MGCP_Templates {
return cmd;
}
- template MgcpCommand tr_DLCX := {
- line := t_MgcpCmdLine("DLCX", ?, ?),
+ template MgcpCommand tr_DLCX(template MgcpEndpoint ep := ?) := {
+ line := t_MgcpCmdLine("DLCX", ?, ep),
params := *,
sdp := *
}
@@ -153,6 +153,18 @@ module MGCP_Templates {
sdp := *
}
+ template MgcpResponse ts_DLCX_ACK2(MgcpTransId trans_id) := {
+ line := {
+ code := "250",
+ trans_id := trans_id,
+ string := "OK"
+ },
+ params:= { /* list of ConnectionIDs */ },
+ sdp := omit
+ }
+
+
+
template MgcpResponse ts_DLCX_ACK(MgcpTransId trans_id, MgcpConnectionId conn_id, template SDP_Message sdp := omit) := ts_CRCX_ACK(trans_id, conn_id, sdp);
template MgcpCommand tr_RSIP := {
@@ -244,16 +256,35 @@ module MGCP_Templates {
}
}
- function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId {
- var integer i;
- for (i := 0; i < lengthof(resp.params); i := i + 1) {
- var MgcpParameter par := resp.params[i];
- if (par.code == "I") {
- return str2hex(par.val);
+ function f_mgcp_extract_par(MgcpMessage msg, MgcpInfoCode code) return charstring {
+ var MgcpParameterList pars;
+ if (ischosen(msg.command)) {
+ pars := msg.command.params;
+ } else {
+ pars := msg.response.params;
+ }
+ for (var integer i := 0; i < lengthof(pars); i := i + 1) {
+ var MgcpParameter par := pars[i];
+ if (par.code == code) {
+ return par.val;
}
}
setverdict(fail);
- return '00000000'H;
+ return "";
+ }
+
+ function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId {
+ var MgcpMessage msg := {
+ response := resp
+ }
+ return str2hex(f_mgcp_extract_par(msg, "I"));
+ }
+
+ function f_MgcpCmd_extract_call_id(MgcpCommand cmd) return MgcpCallId {
+ var MgcpMessage msg := {
+ command := cmd
+ }
+ return str2hex(f_mgcp_extract_par(msg, "C"));
}
function f_mgcp_alloc_tid() return MgcpTransId {
@@ -282,4 +313,5 @@ module MGCP_Templates {
sdp := *
}
+
}