Fixed compilation issues
This commit is contained in:
parent
a9af077eb5
commit
f41ff72790
|
@ -65,33 +65,6 @@
|
|||
|
||||
/* TODO: rename all *_cc_* to *_an_* */
|
||||
|
||||
#define SNGISDN_ENUM_NAMES(_NAME, _STRINGS) static const char * _NAME [] = { _STRINGS , NULL };
|
||||
#define SNGISDN_STR2ENUM_P(_FUNC1, _FUNC2, _TYPE) _TYPE _FUNC1 (const char *name); const char * _FUNC2 (_TYPE type);
|
||||
#define SNGISDN_STR2ENUM(_FUNC1, _FUNC2, _TYPE, _STRINGS, _MAX) \
|
||||
_TYPE _FUNC1 (const char *name) \
|
||||
{ \
|
||||
int i; \
|
||||
_TYPE t = _MAX ; \
|
||||
\
|
||||
for (i = 0; i < _MAX ; i++) { \
|
||||
if (!strcasecmp(name, _STRINGS[i])) { \
|
||||
t = (_TYPE) i; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
return t; \
|
||||
} \
|
||||
const char * _FUNC2 (_TYPE type) \
|
||||
{ \
|
||||
if (type > _MAX) { \
|
||||
type = _MAX; \
|
||||
} \
|
||||
return _STRINGS[(int)type]; \
|
||||
} \
|
||||
|
||||
|
||||
|
||||
typedef enum {
|
||||
FLAG_RESET_RX = (1 << 0),
|
||||
FLAG_RESET_TX = (1 << 1),
|
||||
|
@ -164,46 +137,6 @@ typedef enum {
|
|||
SNGISDN_EVENT_RST_IND,
|
||||
} ftdm_sngisdn_event_id_t;
|
||||
|
||||
typedef enum {
|
||||
/* Call is not end-to-end ISDN */
|
||||
SNGISDN_PROGIND_DESCR_NETE_ISDN,
|
||||
/* Destination address is non-ISDN */
|
||||
SNGISDN_PROGIND_DESCR_DEST_NISDN,
|
||||
/* Origination address is non-ISDN */
|
||||
SNGISDN_PROGIND_DESCR_ORIG_NISDN,
|
||||
/* Call has returned to the ISDN */
|
||||
SNGISDN_PROGIND_DESCR_RET_ISDN,
|
||||
/* Interworking as occured and has resulted in a telecommunication service change */
|
||||
SNGISDN_PROGIND_DESCR_SERV_CHANGE,
|
||||
/* In-band information or an appropriate pattern is now available */
|
||||
SNGISDN_PROGIND_DESCR_IB_AVAIL,
|
||||
/* Invalid */
|
||||
SNGISDN_PROGIND_DESCR_INVALID,
|
||||
} ftdm_sngisdn_progind_descr_t;
|
||||
#define SNGISDN_PROGIND_DESCR_STRINGS "not-end-to-end-isdn", "destination-is-non-isdn", "origination-is-non-isdn", "call-returned-to-isdn", "service-change", "inband-info-available", "invalid"
|
||||
SNGISDN_STR2ENUM_P(ftdm_str2ftdm_sngisdn_progind_descr, ftdm_sngisdn_progind_descr2str, ftdm_sngisdn_progind_descr_t);
|
||||
|
||||
typedef enum {
|
||||
/* User */
|
||||
SNGISDN_PROGIND_LOC_USER,
|
||||
/* Private network serving the local user */
|
||||
SNGISDN_PROGIND_LOC_PRIV_NET_LOCAL_USR,
|
||||
/* Public network serving the local user */
|
||||
SNGISDN_PROGIND_LOC_PUB_NET_LOCAL_USR,
|
||||
/* Transit network */
|
||||
SNGISDN_PROGIND_LOC_TRANSIT_NET,
|
||||
/* Public network serving remote user */
|
||||
SNGISDN_PROGIND_LOC_PUB_NET_REMOTE_USR,
|
||||
/* Private network serving remote user */
|
||||
SNGISDN_PROGIND_LOC_PRIV_NET_REMOTE_USR,
|
||||
/* Network beyond the interworking point */
|
||||
SNGISDN_PROGIND_LOC_NET_BEYOND_INTRW,
|
||||
/* Invalid */
|
||||
SNGISDN_PROGIND_LOC_INVALID,
|
||||
} ftdm_sngisdn_progind_loc_t;
|
||||
#define SNGISDN_PROGIND_LOC_STRINGS "user", "private-net-local-user", "public-net-local-user", "transit-network", "public-net-remote-user", "private-net-remote-user", "beyond-interworking", "invalid"
|
||||
SNGISDN_STR2ENUM_P(ftdm_str2ftdm_sngisdn_progind_loc, ftdm_sngisdn_progind_loc2str, ftdm_sngisdn_progind_loc_t);
|
||||
|
||||
typedef struct ftdm_sngisdn_prog_ind {
|
||||
ftdm_sngisdn_progind_loc_t loc; /* location */
|
||||
ftdm_sngisdn_progind_descr_t descr; /* description */
|
||||
|
|
|
@ -49,7 +49,9 @@
|
|||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#ifdef __linux__
|
||||
#ifndef __USE_BSD
|
||||
#define __USE_BSD
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "freetdm.h"
|
||||
|
|
Loading…
Reference in New Issue