summaryrefslogtreecommitdiffstats
path: root/library/MGCP_Templates.ttcn
diff options
context:
space:
mode:
Diffstat (limited to 'library/MGCP_Templates.ttcn')
-rw-r--r--library/MGCP_Templates.ttcn23
1 files changed, 23 insertions, 0 deletions
diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn
index f720553..506100f 100644
--- a/library/MGCP_Templates.ttcn
+++ b/library/MGCP_Templates.ttcn
@@ -286,6 +286,22 @@ module MGCP_Templates {
}
}
+ function f_mgcp_contains_par(MgcpMessage msg, MgcpInfoCode code) return boolean {
+ 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 true;
+ }
+ }
+ return false;
+ }
+
function f_mgcp_extract_par(MgcpMessage msg, MgcpInfoCode code) return charstring {
var MgcpParameterList pars;
if (ischosen(msg.command)) {
@@ -317,6 +333,13 @@ module MGCP_Templates {
return f_mgcp_extract_par(msg, code);
}
+ function f_MgcpCmd_contains_par(MgcpCommand cmd, MgcpInfoCode code) return boolean {
+ var MgcpMessage msg := {
+ command := cmd
+ }
+ return f_mgcp_contains_par(msg, code);
+ }
+
function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId {
return str2hex(f_MgcpResp_extract_par(resp, "I"));
}