Change in osmo-mgw[master]: osmux: Handle Osmux MGCP extension in MDCX messages

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


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


Change subject: osmux: Handle Osmux MGCP extension in MDCX messages
......................................................................

osmux: Handle Osmux MGCP extension in MDCX messages

Change-Id: I65e53bd5dd08b58c253e03d2f358f3be523a2688
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 30 insertions(+), 0 deletions(-)



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

diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index e1bf12b..35141f8 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -1048,6 +1048,7 @@
 	const char *mode = NULL;
 	struct mgcp_conn_rtp *conn = NULL;
         const char *conn_id = NULL;
+	int osmux_cid = -2;
 	int rc;
 
 	LOGPENDP(endp, DLMGCP, LOGL_NOTICE, "MDCX: modifying existing connection ...\n");
@@ -1095,6 +1096,16 @@
 		case 'Z':
 			silent = strcmp("noanswer", line + 3) == 0;
 			break;
+		case 'X':
+			if (strncmp("Osmux: ", line + 2, strlen("Osmux: ")) == 0) {
+				/* If osmux is disabled, just skip setting it up */
+				if (!p->endp->cfg->osmux)
+					break;
+				osmux_cid = mgcp_osmux_setup(endp, line);
+				break;
+			}
+			/* Ignore unknown X-headers */
+			break;
 		case '\0':
 			have_sdp = 1;
 			goto mgcp_header_done;
@@ -1166,6 +1177,25 @@
 		goto error3;
 	}
 
+	if (mgcp_conn_rtp_is_osmux(conn)) {
+		OSMO_ASSERT(conn->osmux.cid_allocated);
+		if (osmux_cid < -1) {
+			LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR,
+				 "MDCX: Failed to parse Osmux CID!\n");
+			goto error3;
+		} else if (osmux_cid == -1) {
+			LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR,
+				 "MDCX: wilcard in MDCX is not supported!\n");
+			goto error3;
+		} else if (osmux_cid != (int) conn->osmux.cid) {
+			LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR,
+				 "MDCX: changing already allocated CID is not supported!\n");
+			goto error3;
+		}
+		/* TODO: In the future (when we have recvCID!=sendCID), we need to
+		   tell Osmux code that osmux_cid is to be used as sendCID for
+		   that conn. */
+	}
 
 	if (setup_rtp_processing(endp, conn) != 0) {
 		rate_ctr_inc(&rate_ctrs->ctr[MGCP_MDCX_FAIL_START_RTP]);

-- 
To view, visit https://gerrit.osmocom.org/14027
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: I65e53bd5dd08b58c253e03d2f358f3be523a2688
Gerrit-Change-Number: 14027
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/0a5b5161/attachment-0001.html>


More information about the gerrit-log mailing list