Change in osmo-ttcn3-hacks[master]: MGCP_Test: allow setting of fmtp parameters

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
Tue Mar 19 13:29:31 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13160 )

Change subject: MGCP_Test: allow setting of fmtp parameters
......................................................................

MGCP_Test: allow setting of fmtp parameters

When creating an RTP flow, there is currently no way to set SDP fmtp
parameters. Lets add a template and a parameter in order to be able to
set those parameters.

Change-Id: Ic1840d5023cb3888a17980f4ed08c19175864896
Related: SYS#4470
---
M library/MGCP_Templates.ttcn
M mgw/MGCP_Test.ttcn
2 files changed, 22 insertions(+), 7 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 afdc33d..f720553 100644
--- a/library/MGCP_Templates.ttcn
+++ b/library/MGCP_Templates.ttcn
@@ -280,6 +280,11 @@
 			attr_value := int2str(p)
 		}
 	}
+	template SDP_attribute ts_SDP_fmtp(integer fmt, charstring val) := {
+		fmtp := {
+			attr_value := int2str(fmt) & " " & val
+		}
+	}
 
 	function f_mgcp_extract_par(MgcpMessage msg, MgcpInfoCode code) return charstring {
 		var MgcpParameterList pars;
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 4969a3f..a0a836b 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -268,7 +268,8 @@
 		uint7_t pt,
 		charstring codec,
 		MgcpConnectionId mgcp_conn_id optional,
-		RtpemConfig rtp_cfg optional
+		RtpemConfig rtp_cfg optional,
+		charstring fmtp optional
 	}
 
 	/* Create an RTP flow (bidirectional, or receive-only) */
@@ -277,6 +278,12 @@
 	runs on dummy_CT {
 		var template MgcpCommand cmd;
 		var MgcpResponse resp;
+		var SDP_attribute_list attributes;
+
+		attributes := { valueof(ts_SDP_rtpmap(flow.pt, flow.codec)), valueof(ts_SDP_ptime(20)) };
+		if (isvalue(flow.fmtp)) {
+			attributes := attributes & { valueof(ts_SDP_fmtp(flow.pt, flow.fmtp)) };
+		}
 
 		/* bind local RTP emulation socket */
 		f_rtpem_bind(pt, flow.em.hostname, flow.em.portnr);
@@ -298,9 +305,8 @@
 
 			cmd := ts_CRCX(get_next_trans_id(), ep, mode, call_id);
 			cmd.sdp := ts_SDP(flow.em.hostname, flow.em.hostname, "23", "42",
-					  flow.em.portnr, { int2str(flow.pt) },
-					  { valueof(ts_SDP_rtpmap(flow.pt, flow.codec)),
-					    valueof(ts_SDP_ptime(20)) });
+					  flow.em.portnr, { int2str(flow.pt) }, attributes);
+
 			resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK);
 			flow.mgcp_conn_id := extract_conn_id(resp);
 			/* extract port number from response */
@@ -329,6 +335,12 @@
 	runs on dummy_CT {
 		var template MgcpCommand cmd;
 		var MgcpResponse resp;
+		var SDP_attribute_list attributes;
+
+		attributes := { valueof(ts_SDP_rtpmap(flow.pt, flow.codec)), valueof(ts_SDP_ptime(20)) };
+		if (isvalue(flow.fmtp)) {
+			attributes := attributes & { valueof(ts_SDP_fmtp(flow.pt, flow.fmtp)) };
+		}
 
 		/* rebind local RTP emulation socket to the new address */
 		f_rtpem_bind(pt, flow.em.hostname, flow.em.portnr);
@@ -345,9 +357,7 @@
 		/* connect MGW side RTP socket to the emulation-side RTP socket using SDP */
 		cmd := ts_MDCX(get_next_trans_id(), ep, mode, call_id, flow.mgcp_conn_id);
 		cmd.sdp := ts_SDP(flow.em.hostname, flow.em.hostname, "23", "42",
-				  flow.em.portnr, { int2str(flow.pt) },
-				  { valueof(ts_SDP_rtpmap(flow.pt, flow.codec)),
-				    valueof(ts_SDP_ptime(20)) });
+				  flow.em.portnr, { int2str(flow.pt) }, attributes);
 		resp := mgcp_transceive_mgw(cmd, tr_MDCX_ACK);
 
 		/* extract MGW-side port number from response. (usually this

-- 
To view, visit https://gerrit.osmocom.org/13160
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic1840d5023cb3888a17980f4ed08c19175864896
Gerrit-Change-Number: 13160
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190319/bc0a8361/attachment.htm>


More information about the gerrit-log mailing list