Change in ...osmo-mgw[master]: mgw: Support receiving uppercase connection mode

pespin gerrit-no-reply at lists.osmocom.org
Wed Jul 3 10:40:56 UTC 2019


pespin has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-mgw/+/14595 )

Change subject: mgw: Support receiving uppercase connection mode
......................................................................

mgw: Support receiving uppercase connection mode

MGCP RFC3435 (https://tools.ietf.org/html/rfc3435) states almost all
text has to be handled in a case-insensitive way, except SDP parts.

Related: OS#4001
Change-Id: I4da93dfc69b5585a197a7e201a1afb72c2f97030
---
M src/libosmo-mgcp/mgcp_msg.c
M tests/mgcp/mgcp_test.c
M tests/mgcp/mgcp_test.ok
3 files changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved



diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c
index 59e0e91..44589d1 100644
--- a/src/libosmo-mgcp/mgcp_msg.c
+++ b/src/libosmo-mgcp/mgcp_msg.c
@@ -91,13 +91,13 @@
 	if (!endp)
 		return -1;
 
-	if (strcmp(mode, "recvonly") == 0)
+	if (strcasecmp(mode, "recvonly") == 0)
 		conn->mode = MGCP_CONN_RECV_ONLY;
-	else if (strcmp(mode, "sendrecv") == 0)
+	else if (strcasecmp(mode, "sendrecv") == 0)
 		conn->mode = MGCP_CONN_RECV_SEND;
-	else if (strcmp(mode, "sendonly") == 0)
+	else if (strcasecmp(mode, "sendonly") == 0)
 		conn->mode = MGCP_CONN_SEND_ONLY;
-	else if (strcmp(mode, "loopback") == 0)
+	else if (strcasecmp(mode, "loopback") == 0)
 		conn->mode = MGCP_CONN_LOOPBACK;
 	else {
 		LOGPCONN(conn, DLMGCP, LOGL_ERROR,
diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index c67b9d5..5a14bdf 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -165,7 +165,7 @@
 
 #define MDCX4_PT1 \
 	"MDCX 18983217 1 at mgw MGCP 1.0\r\n" \
-	"M: sendrecv\r" \
+	"M: SENDRECV\r" \
 	"C: 2\r\n" \
 	"I: %s\r\n" \
 	"L: p:20-40, a:AMR, nt:IN\r\n" \
diff --git a/tests/mgcp/mgcp_test.ok b/tests/mgcp/mgcp_test.ok
index 08ea438..358a85c 100644
--- a/tests/mgcp/mgcp_test.ok
+++ b/tests/mgcp/mgcp_test.ok
@@ -125,7 +125,7 @@
 creating message from statically defined input:
 ---------8<---------
 MDCX 18983217 1 at mgw MGCP 1.0
-M: sendrecv
C: 2
+M: SENDRECV
C: 2
 I: %s
 L: p:20-40, a:AMR, nt:IN
 

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I4da93dfc69b5585a197a7e201a1afb72c2f97030
Gerrit-Change-Number: 14595
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190703/57629223/attachment.html>


More information about the gerrit-log mailing list