Change in osmo-mgw[master]: mgcp_client: get rid of magic numbers for E1 slots

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

dexter gerrit-no-reply at lists.osmocom.org
Thu Nov 26 21:22:30 UTC 2020


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/21385 )


Change subject: mgcp_client: get rid of magic numbers for E1 slots
......................................................................

mgcp_client: get rid of magic numbers for E1 slots

use NUM_E1_TS-1 instead of 31 in relation of E1 timeslot count

Change-Id: Iee134d70f05883fcd2e58e0b9c78ed70aea16695
---
M src/libosmo-mgcp-client/mgcp_client.c
1 file changed, 3 insertions(+), 1 deletion(-)



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

diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c
index 6f4c1f3..a134273 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -30,6 +30,8 @@
 #include <osmocom/mgcp_client/mgcp_client.h>
 #include <osmocom/mgcp_client/mgcp_client_internal.h>
 
+#include <osmocom/abis/e1_input.h>
+
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
@@ -957,7 +959,7 @@
 
 	/* An E1 line has a maximum of 32 timeslots, while the first (ts=0) is
 	 * reserverd for framing and alignment, so we can not use it here. */
-	if (ts == 0 || ts > 31) {
+	if (ts == 0 || ts > NUM_E1_TS-1) {
 		LOGP(DLMGCP, LOGL_ERROR,
 		     "Cannot compose MGCP e1-endpoint name (%s), E1-timeslot number (%u) is invalid!\n", epname, ts);
 		talloc_free(epname);

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Iee134d70f05883fcd2e58e0b9c78ed70aea16695
Gerrit-Change-Number: 21385
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201126/0f8a7ce2/attachment.htm>


More information about the gerrit-log mailing list