msc: split off f_mgcp_find_param_entry()
Split f_mgcp_find_param_entry() out of f_mgcp_find_param() to be able to act on
an MgcpParameterList without an enclosing MgcpMessage.
Will be used by upcoming I8b82476f55a98f7a94d5c4f1cd80eac427b2d20f
Change-Id: I90f213d2a1be979afa024e0faa25d532f9858636
diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn
index dae379e..e03fd8e 100644
--- a/library/MGCP_Templates.ttcn
+++ b/library/MGCP_Templates.ttcn
@@ -453,6 +453,17 @@
sdp := *
}
+ function f_mgcp_find_param_entry(MgcpParameterList pars, MgcpInfoCode code, out charstring ret)
+ return boolean {
+ for (var integer i := 0; i < sizeof(pars); i := i+1) {
+ if (pars[i].code == code) {
+ ret := pars[i].val;
+ return true;
+ }
+ }
+ return false;
+ }
+
function f_mgcp_find_param(MgcpMessage msg, MgcpInfoCode code, out charstring ret)
return boolean {
var MgcpParameterList pars;
@@ -461,13 +472,7 @@
} else {
pars := msg.response.params;
}
- for (var integer i := 0; i < sizeof(pars); i := i+1) {
- if (pars[i].code == code) {
- ret := pars[i].val;
- return true;
- }
- }
- return false;
+ return f_mgcp_find_param_entry(pars, code, ret);
}
/* template to determine if a MGCP endpoint is a wildcard endpoint */