[MERGED] osmo-ttcn3-hacks[master]: MGCP_Templates: Some more convenience extraction functions

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Jan 29 21:35:14 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: MGCP_Templates: Some more convenience extraction functions
......................................................................


MGCP_Templates: Some more convenience extraction functions

Change-Id: I2fc121b1d90327c879a096773ecc5c04faad07d7
---
M library/MGCP_Templates.ttcn
1 file changed, 17 insertions(+), 4 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn
index 7f10bd2..5a8d9b1 100644
--- a/library/MGCP_Templates.ttcn
+++ b/library/MGCP_Templates.ttcn
@@ -273,20 +273,33 @@
 		return "";
 	}
 
-	function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId {
+	function f_MgcpResp_extract_par(MgcpResponse resp, MgcpInfoCode code) return charstring {
 		var MgcpMessage msg := {
 			response := resp
 		}
-		return str2hex(f_mgcp_extract_par(msg, "I"));
+		return f_mgcp_extract_par(msg, code);
 	}
 
-	function f_MgcpCmd_extract_call_id(MgcpCommand cmd) return MgcpCallId {
+	function f_MgcpCmd_extract_par(MgcpCommand cmd, MgcpInfoCode code) return charstring {
 		var MgcpMessage msg := {
 			command := cmd
 		}
-		return str2hex(f_mgcp_extract_par(msg, "C"));
+		return f_mgcp_extract_par(msg, code);
 	}
 
+	function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId {
+		return str2hex(f_MgcpResp_extract_par(resp, "I"));
+	}
+
+	function f_MgcpCmd_extract_call_id(MgcpCommand cmd) return MgcpCallId {
+		return str2hex(f_MgcpCmd_extract_par(cmd, "C"));
+	}
+
+	function f_MgcpCmd_extract_conn_id(MgcpCommand cmd) return MgcpConnectionId {
+		return str2hex(f_MgcpCmd_extract_par(cmd, "I"));
+	}
+
+
 	function f_mgcp_alloc_tid() return MgcpTransId {
 		return int2str(float2int(rnd()*2147483647.0));
 	}

-- 
To view, visit https://gerrit.osmocom.org/6178
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2fc121b1d90327c879a096773ecc5c04faad07d7
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list