Change in osmo-ttcn3-hacks[master]: library/MGCP_Templates: Apply MGCP AddressType based on provided address

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/.

pespin gerrit-no-reply at lists.osmocom.org
Thu Sep 3 15:45:39 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19973 )


Change subject: library/MGCP_Templates: Apply MGCP AddressType based on provided address
......................................................................

library/MGCP_Templates: Apply MGCP AddressType based on provided address

Change-Id: I1212abd31f6a4758105675908a1b7cb841caa3dd
---
M library/MGCP_Templates.ttcn
1 file changed, 11 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/73/19973/1

diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn
index e03fd8e..79d9670 100644
--- a/library/MGCP_Templates.ttcn
+++ b/library/MGCP_Templates.ttcn
@@ -310,13 +310,13 @@
 				    integer rtp_port, SDP_fmt_list fmts,
 				    SDP_attribute_list attributes) := {
 		protocol_version := 0,
-		origin := ts_SDP_origin(local_addr, session_id, session_version),
+		origin := ts_SDP_origin(local_addr, session_id, session_version, f_mgcp_addr2addrtype(local_addr)),
 		session_name := "-",
 		information := omit,
 		uri := omit,
 		emails := omit,
 		phone_numbers := omit,
-		connection := ts_SDP_connection_IP(remote_addr),
+		connection := ts_SDP_connection_IP(remote_addr, f_mgcp_addr2addrtype(remote_addr)),
 		bandwidth := omit,
 		times := { ts_SDP_time("0","0") },
 		timezone_adjustments := omit,
@@ -341,6 +341,15 @@
 		}
 	}
 
+	function f_mgcp_addr2addrtype(charstring addr) return charstring {
+		for (var integer i := 0; i < lengthof(addr); i := i + 1) {
+			if (addr[i] == ":") {
+				return "IP6";
+			}
+		}
+		return "IP4";
+	}
+
 	/* -1 is wildcard, positive is translated as string */
 	function f_mgcp_osmux_cid_encode(MgcpOsmuxCID osmux_cid) return charstring {
 		if (osmux_cid == -1) {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19973
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I1212abd31f6a4758105675908a1b7cb841caa3dd
Gerrit-Change-Number: 19973
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200903/396ae9b2/attachment.htm>


More information about the gerrit-log mailing list