Change in osmo-mgw[master]: osmux: Provide correct local port during mgcp resp

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Mon May 13 17:11:03 UTC 2019


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/14032


Change subject: osmux: Provide correct local port during mgcp resp
......................................................................

osmux: Provide correct local port during mgcp resp

Also document some possible future improvements for local addr.

Change-Id: I12c8fcdc8b772b9f92a70774406d4662f44bd9a9
---
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_sdp.c
3 files changed, 10 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/32/14032/1

diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index dbed156..650d4c0 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -86,7 +86,7 @@
 		}
 	}
 
-	/* Select from preconfigured IP-Addresses */
+	/* Select from preconfigured IP-Addresses. We don't have bind_addr for Osmux (yet?). */
 	if (endp->cfg->net_ports.bind_addr) {
 		/* Check there is a bind IP for the RTP traffic configured,
 		 * if so, use that IP-Address */
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 4b0be07..e163b32 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -300,6 +300,9 @@
 					     const char *trans_id,
 					     bool add_conn_params)
 {
+	/* TODO: we may want to define another local_ip_osmux var to us for
+	   OSMUX connections. Perhaps adding a new internal API to get it based
+	   on conn type */
 	const char *addr = endp->cfg->local_ip;
 	struct msgb *sdp;
 	int rc;
diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c
index 6b41f50..99e764b 100644
--- a/src/libosmo-mgcp/mgcp_sdp.c
+++ b/src/libosmo-mgcp/mgcp_sdp.c
@@ -512,6 +512,7 @@
 	struct sdp_fmtp_param fmtp_param;
 	int rc;
 	int payload_types[1];
+	int local_port;
 	struct sdp_fmtp_param fmtp_params[1];
         unsigned int fmtp_params_len = 0;
 
@@ -541,7 +542,11 @@
 	if (payload_type >= 0) {
 
 		payload_types[0] = payload_type;
-		rc = add_audio(sdp, payload_types, 1, conn->end.local_port);
+		if (mgcp_conn_rtp_is_osmux(conn))
+			local_port = endp->cfg->osmux_port;
+		else
+			local_port = conn->end.local_port;
+		rc = add_audio(sdp, payload_types, 1, local_port);
 		if (rc < 0)
 			goto buffer_too_small;
 

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I12c8fcdc8b772b9f92a70774406d4662f44bd9a9
Gerrit-Change-Number: 14032
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190513/05f4d6db/attachment.html>


More information about the gerrit-log mailing list