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
This commit is contained in:
parent
6e2795bfbf
commit
92a73cd637
|
@ -9,6 +9,7 @@ AM_CFLAGS = \
|
|||
-Wall \
|
||||
$(LIBOSMOCORE_CFLAGS) \
|
||||
$(LIBOSMOVTY_CFLAGS) \
|
||||
$(LIBOSMOABIS_CFLAGS) \
|
||||
$(COVERAGE_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -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 @@ const char *mgcp_client_e1_epname(void *ctx, const struct mgcp_client *mgcp, uin
|
|||
|
||||
/* 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);
|
||||
|
|
Loading…
Reference in New Issue