[asterisk-commits] branch group/autoconf_and_menuselect r18486 -
/team/group/autoconf_and_menuse...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Sat Apr 8 11:02:25 MST 2006
Author: russell
Date: Sat Apr 8 13:02:23 2006
New Revision: 18486
URL: http://svn.digium.com/view/asterisk?rev=18486&view=rev
Log:
convert chan_zap to use HAVE_LIBPRI as defined from autoconf. Also, use the
pri library provided by autoconf in the Makefile
Modified:
team/group/autoconf_and_menuselect/channels/Makefile
team/group/autoconf_and_menuselect/channels/chan_zap.c
Modified: team/group/autoconf_and_menuselect/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/channels/Makefile?rev=18486&r1=18485&r2=18486&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/channels/Makefile (original)
+++ team/group/autoconf_and_menuselect/channels/Makefile Sat Apr 8 13:02:23 2006
@@ -77,13 +77,6 @@
endif
CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
-
-ifndef WITHOUT_PRI
-ifeq ($(LIBPRI),1)
- CFLAGS+=-DZAPATA_PRI
- ZAPPRI=-lpri
-endif
-endif # WITHOUT_PRI
ifeq ($(LIBMFCR2),1)
CFLAGS+=-DZAPATA_R2
@@ -193,7 +186,7 @@
$(CC) -c $(CFLAGS) -o chan_zap.o chan_zap.c
chan_zap.so: chan_zap.o
- $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -ltonezone
+ $(CC) $(SOLINK) -o $@ $< $(PRI_LIB) $(ZAPR2) -ltonezone
chan_sip.so: chan_sip.o
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} chan_sip.o ${CYGSOLIB}
Modified: team/group/autoconf_and_menuselect/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/channels/chan_zap.c?rev=18486&r1=18485&r2=18486&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/channels/chan_zap.c (original)
+++ team/group/autoconf_and_menuselect/channels/chan_zap.c Sat Apr 8 13:02:23 2006
@@ -60,7 +60,7 @@
#include <math.h>
#include <tonezone.h>
#include <ctype.h>
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
#include <libpri.h>
#ifndef PRI_KEYPAD_FACILITY_TX
#error "You need newer libpri"
@@ -107,7 +107,7 @@
#define SMDI_MD_WAIT_TIMEOUT 1500 /* 1.5 seconds */
#endif
-#if !defined(ZT_SIG_EM_E1) || (defined(ZAPATA_PRI) && !defined(ZT_SIG_HARDHDLC))
+#if !defined(ZT_SIG_EM_E1) || (defined(HAVE_LIBPRI) && !defined(ZT_SIG_HARDHDLC))
#error "Your zaptel is too old. please update"
#endif
@@ -149,7 +149,7 @@
#define NEED_MFDETECT(p) (((p)->sig == SIG_FEATDMF) || ((p)->sig == SIG_FEATDMF_TA) || ((p)->sig == SIG_E911) || ((p)->sig == SIG_FGC_CAMA) || ((p)->sig == SIG_FGC_CAMAMF) || ((p)->sig == SIG_FEATB))
static const char desc[] = "Zapata Telephony"
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
" w/PRI"
#endif
#ifdef ZAPATA_R2
@@ -158,7 +158,7 @@
;
static const char tdesc[] = "Zapata Telephony Driver"
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
" w/PRI"
#endif
#ifdef ZAPATA_R2
@@ -303,7 +303,7 @@
static int priindication_oob = 0;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
static int minunused = 2;
static int minidle = 0;
static char idleext[AST_MAX_EXTENSION];
@@ -342,7 +342,7 @@
static int ifcount = 0;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
AST_MUTEX_DEFINE_STATIC(pridebugfdlock);
#endif
@@ -411,7 +411,7 @@
static int ringt_base = DEFAULT_RINGT;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
#define PVT_TO_CHANNEL(p) (((p)->prioffset) | ((p)->logicalspan << 8) | (p->pri->mastertrunkgroup ? 0x10000 : 0))
#define PRI_CHANNEL(p) ((p) & 0xff)
@@ -601,7 +601,7 @@
unsigned int usedistinctiveringdetection:1;
unsigned int zaptrcallerid:1; /*!< should we use the callerid from incoming call on zap transfer or not */
unsigned int transfertobusy:1; /*!< allow flash-transfers to busy channels */
-#if defined(ZAPATA_PRI)
+#if defined(HAVE_LIBPRI)
unsigned int alerting:1;
unsigned int alreadyhungup:1;
unsigned int isidlecall:1;
@@ -692,7 +692,7 @@
int polarityonanswerdelay;
struct timeval polaritydelaytv;
int sendcalleridafter;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
struct zt_pri *pri;
struct zt_pvt *bearer;
struct zt_pvt *realcall;
@@ -741,7 +741,7 @@
.setoption = zt_setoption,
};
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
#define GET_CHANNEL(p) ((p)->bearer ? (p)->bearer->channel : p->channel)
#else
#define GET_CHANNEL(p) ((p)->channel)
@@ -749,7 +749,7 @@
struct zt_pvt *round_robin[32];
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
static inline int pri_grab(struct zt_pvt *pvt, struct zt_pri *pri)
{
int res;
@@ -816,13 +816,13 @@
return res;
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
static void wakeup_sub(struct zt_pvt *p, int a, struct zt_pri *pri)
#else
static void wakeup_sub(struct zt_pvt *p, int a, void *pri)
#endif
{
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (pri)
ast_mutex_unlock(&pri->lock);
#endif
@@ -840,20 +840,20 @@
} else
break;
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (pri)
ast_mutex_lock(&pri->lock);
#endif
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
static void zap_queue_frame(struct zt_pvt *p, struct ast_frame *f, struct zt_pri *pri)
#else
static void zap_queue_frame(struct zt_pvt *p, struct ast_frame *f, void *pri)
#endif
{
/* We must unlock the PRI to avoid the possibility of a deadlock */
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (pri)
ast_mutex_unlock(&pri->lock);
#endif
@@ -871,7 +871,7 @@
} else
break;
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (pri)
ast_mutex_lock(&pri->lock);
#endif
@@ -1038,7 +1038,7 @@
ast_mutex_lock(&p->lock);
index = zt_get_index(ast, p, 0);
if ((index == SUB_REAL) && p->owner) {
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if ((p->sig == SIG_PRI) && (ast->_state == AST_STATE_DIALING) && !p->proceeding) {
if (p->setup_ack) {
if (!pri_grab(p, p->pri)) {
@@ -1124,7 +1124,7 @@
return buf;
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
static char *dialplan2str(int dialplan)
{
if (dialplan == -1) {
@@ -1761,7 +1761,7 @@
struct zt_pvt *p = ast->tech_pvt;
int x, res, index,mysig;
char *c, *n, *l;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
char *s=NULL;
#endif
char dest[256]; /* must be same length as p->dialdest */
@@ -1918,7 +1918,7 @@
ast_mutex_unlock(&p->lock);
return -1;
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
/* Start the trunk, if not GR-303 */
if (!p->pri) {
#endif
@@ -1931,7 +1931,7 @@
return -1;
}
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
}
#endif
ast_log(LOG_DEBUG, "Dialing '%s'\n", c);
@@ -2029,7 +2029,7 @@
ast_mutex_unlock(&p->lock);
return -1;
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (p->pri) {
struct pri_sr *sr;
#ifdef SUPPORT_USERUSER
@@ -2247,7 +2247,7 @@
return 0;
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
static char *zap_send_keypad_facility_app = "ZapSendKeypadFacility";
static char *zap_send_keypad_facility_synopsis = "Send digits out of band over a PRI";
@@ -2529,7 +2529,7 @@
p->faxhandled = 0;
p->pulsedial = 0;
p->onhooktime = time(NULL);
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
p->proceeding = 0;
p->progress = 0;
p->alerting = 0;
@@ -2545,7 +2545,7 @@
if (res < 0)
ast_log(LOG_WARNING, "Unable to set law on channel %d to default\n", p->channel);
/* Perform low level hangup if no owner left */
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (p->pri) {
#ifdef SUPPORT_USERUSER
const char *useruser = pbx_builtin_getvar_helper(ast,"USERUSERINFO");
@@ -2664,7 +2664,7 @@
x = 0;
ast_channel_setoption(ast,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (p->bearer) {
ast_log(LOG_DEBUG, "Freeing up bearer channel %d\n", p->bearer->channel);
/* Free up the bearer channel as well, and
@@ -2774,7 +2774,7 @@
zt_train_ec(p);
}
break;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
case SIG_PRI:
/* Send a pri acknowledge */
if (!pri_grab(p, p->pri)) {
@@ -3631,7 +3631,7 @@
else
p->pulsedial = 0;
ast_log(LOG_DEBUG, "Detected %sdigit '%c'\n", p->pulsedial ? "pulse ": "", res & 0xff);
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (!p->proceeding && p->sig == SIG_PRI && p->pri && p->pri->overlapdial) {
/* absorb event */
} else {
@@ -3644,7 +3644,7 @@
p->subs[index].f.subclass = res & 0xff;
dtmf_frame.subclass = res & 0xff;
p->subs[index].f.next = ast_frdup(&dtmf_frame);
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
}
#endif
/* Unmute conference, return the captured digit */
@@ -3735,7 +3735,7 @@
}
break;
case ZT_EVENT_ALARM:
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (p->call) {
if (p->pri && p->pri->pri) {
if (!pri_grab(p, p->pri)) {
@@ -4061,7 +4061,7 @@
break;
case ZT_EVENT_NOALARM:
p->inalarm = 0;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
/* Extremely unlikely but just in case */
if (p->bearer)
p->bearer->inalarm = 0;
@@ -4717,7 +4717,7 @@
f = NULL;
}
} else if (f->frametype == AST_FRAME_DTMF) {
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (!p->proceeding && p->sig==SIG_PRI && p->pri && p->pri->overlapdial) {
/* Don't accept in-band DTMF when in overlap dial mode */
f->frametype = AST_FRAME_NULL;
@@ -4837,7 +4837,7 @@
}
#if 0
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
ast_mutex_lock(&p->lock);
if (!p->proceeding && p->sig==SIG_PRI && p->pri && !p->outgoing) {
if (p->pri->pri) {
@@ -4924,7 +4924,7 @@
if (index == SUB_REAL) {
switch(condition) {
case AST_CONTROL_BUSY:
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (p->priindication_oob && p->sig == SIG_PRI) {
chan->hangupcause = AST_CAUSE_USER_BUSY;
chan->_softhangup |= AST_SOFTHANGUP_DEV;
@@ -4945,7 +4945,7 @@
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_BUSY);
break;
case AST_CONTROL_RINGING:
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if ((!p->alerting) && p->sig==SIG_PRI && p->pri && !p->outgoing && (chan->_state != AST_STATE_UP)) {
if (p->pri->pri) {
if (!pri_grab(p, p->pri)) {
@@ -4969,7 +4969,7 @@
break;
case AST_CONTROL_PROCEEDING:
ast_log(LOG_DEBUG,"Received AST_CONTROL_PROCEEDING on %s\n",chan->name);
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (!p->proceeding && p->sig==SIG_PRI && p->pri && !p->outgoing) {
if (p->pri->pri) {
if (!pri_grab(p, p->pri)) {
@@ -4987,7 +4987,7 @@
break;
case AST_CONTROL_PROGRESS:
ast_log(LOG_DEBUG,"Received AST_CONTROL_PROGRESS on %s\n",chan->name);
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
p->digital = 0; /* Digital-only calls isn't allows any inband progress messages */
if (!p->progress && p->sig==SIG_PRI && p->pri && !p->outgoing) {
if (p->pri->pri) {
@@ -5006,7 +5006,7 @@
break;
case AST_CONTROL_CONGESTION:
chan->hangupcause = AST_CAUSE_CONGESTION;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (p->priindication_oob && p->sig == SIG_PRI) {
chan->hangupcause = AST_CAUSE_SWITCH_CONGESTION;
chan->_softhangup |= AST_SOFTHANGUP_DEV;
@@ -5025,7 +5025,7 @@
#endif
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);
break;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
case AST_CONTROL_HOLD:
if (p->pri) {
if (!pri_grab(p, p->pri)) {
@@ -5111,7 +5111,7 @@
}
y = 1;
do {
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (i->bearer || (i->pri && (i->sig == SIG_FXSKS)))
ast_string_field_build(tmp, name, "Zap/%d:%d-%d", i->pri->trunkgroup, i->channel, y);
else
@@ -5168,7 +5168,7 @@
i->dsp = NULL;
if (i->dsp) {
i->dsp_features = features & ~DSP_PROGRESS_TALK;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
/* We cannot do progress detection until receives PROGRESS message */
if (i->outgoing && (i->sig == SIG_PRI)) {
/* Remember requested DSP features, don't treat
@@ -5226,7 +5226,7 @@
#endif
tmp->cid.cid_pres = i->callingpres;
tmp->cid.cid_ton = i->cid_ton;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
tmp->transfercapability = transfercapability;
pbx_builtin_setvar_helper(tmp, "TRANSFERCAPABILITY", ast_transfercapability2str(transfercapability));
if (transfercapability & PRI_TRANS_CAP_DIGITAL) {
@@ -5335,7 +5335,7 @@
if (p->dsp)
ast_dsp_digitreset(p->dsp);
switch(p->sig) {
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
case SIG_PRI:
/* Now loop looking for an extension */
ast_copy_string(exten, p->exten, sizeof(exten));
@@ -5938,7 +5938,7 @@
case SIG_FXSLS:
case SIG_FXSGS:
case SIG_FXSKS:
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (p->pri) {
/* This is a GR-303 trunk actually. Wait for the first ring... */
struct ast_frame *f;
@@ -6777,7 +6777,7 @@
pollres = ast_fdisset(pfds, i->subs[SUB_REAL].zfd, count, &spoint);
if (pollres & POLLIN) {
if (i->owner || i->subs[SUB_REAL].owner) {
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (!i->pri)
#endif
ast_log(LOG_WARNING, "Whoa.... I'm owned but found (%d) in read...\n", i->subs[SUB_REAL].zfd);
@@ -6840,7 +6840,7 @@
#endif
{
if (i->owner || i->subs[SUB_REAL].owner) {
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (!i->pri)
#endif
ast_log(LOG_WARNING, "Whoa.... I'm owned but found (%d)...\n", i->subs[SUB_REAL].zfd);
@@ -6906,7 +6906,7 @@
return 0;
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
static int pri_resolve_span(int *span, int channel, int offset, struct zt_spaninfo *si)
{
int x;
@@ -7040,7 +7040,7 @@
wlist = &iflist;
wend = &ifend;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (pri) {
wlist = &pri->crvs;
wend = &pri->crvend;
@@ -7113,7 +7113,7 @@
return NULL;
}
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if ((signalling == SIG_PRI) || (signalling == SIG_GR303FXOKS) || (signalling == SIG_GR303FXSKS)) {
int offset;
int myswitchtype;
@@ -7429,7 +7429,7 @@
zt_set_hook(tmp->subs[SUB_REAL].zfd, ZT_ONHOOK);
}
ioctl(tmp->subs[SUB_REAL].zfd,ZT_SETTONEZONE,&tmp->tonezone);
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
/* the dchannel is down so put the channel in alarm */
if (tmp->pri && !pri_is_up(tmp->pri))
tmp->inalarm = 1;
@@ -7529,7 +7529,7 @@
/* If no owner definitely available */
if (!p->owner) {
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
/* Trust PRI */
if (p->pri) {
if (p->resetting || p->call)
@@ -7646,7 +7646,7 @@
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
static int pri_find_empty_chan(struct zt_pri *pri, int backwards)
{
int x;
@@ -7688,7 +7688,7 @@
char opt=0;
int res=0, y=0;
int backwards = 0;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
int crv;
int bearer = -1;
int trunkgroup;
@@ -7748,7 +7748,7 @@
x = CHAN_PSEUDO;
channelmatch = x;
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
else if ((res = sscanf(s, "%d:%d%c%d", &trunkgroup, &crv, &opt, &y)) > 1) {
if ((trunkgroup < 1) || (crv < 1)) {
ast_log(LOG_WARNING, "Unable to determine trunk group and CRV for data %s\n", (char *)data);
@@ -7799,7 +7799,7 @@
goto next;
callwait = (p->owner != NULL);
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (pri && (p->subs[SUB_REAL].zfd < 0)) {
if (p->sig != SIG_FXSKS) {
/* Gotta find an actual channel to use for this
@@ -7836,7 +7836,7 @@
}
p->outgoing = 1;
tmp = zt_new(p, AST_STATE_RESERVED, 0, p->owner ? SUB_CALLWAIT : SUB_REAL, 0, 0);
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (p->bearer) {
/* Log owner to bearer channel, too */
p->bearer->owner = tmp;
@@ -7898,7 +7898,7 @@
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
static struct zt_pvt *pri_find_crv(struct zt_pri *pri, int crv)
{
struct zt_pvt *p;
@@ -9679,7 +9679,7 @@
"Ends PRI debug output to file" },
};
-#endif /* ZAPATA_PRI */
+#endif /* HAVE_LIBPRI */
#ifdef ZAPATA_R2
@@ -9791,7 +9791,7 @@
char tmps[20] = "";
ast_mutex_t *lock;
struct zt_pvt *start;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
int trunkgroup;
struct zt_pri *pri=NULL;
int x;
@@ -9800,7 +9800,7 @@
lock = &iflock;
start = iflist;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (argc == 4) {
if ((trunkgroup = atoi(argv[3])) < 1)
return RESULT_SHOWUSAGE;
@@ -9823,7 +9823,7 @@
return RESULT_SHOWUSAGE;
ast_mutex_lock(lock);
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
ast_cli(fd, FORMAT2, pri ? "CRV" : "Chan", "Extension", "Context", "Language", "MusicOnHold");
#else
ast_cli(fd, FORMAT2, "Chan", "Extension", "Context", "Language", "MusicOnHold");
@@ -9853,7 +9853,7 @@
int x;
ast_mutex_t *lock;
struct zt_pvt *start;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
char *c;
int trunkgroup;
struct zt_pri *pri=NULL;
@@ -9864,7 +9864,7 @@
if (argc != 4)
return RESULT_SHOWUSAGE;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if ((c = strchr(argv[3], ':'))) {
if (sscanf(argv[3], "%d:%d", &trunkgroup, &channel) != 2)
return RESULT_SHOWUSAGE;
@@ -9891,7 +9891,7 @@
tmp = start;
while (tmp) {
if (tmp->channel == channel) {
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (pri)
ast_cli(fd, "Trunk/CRV: %d/%d\n", trunkgroup, tmp->channel);
else
@@ -9929,7 +9929,7 @@
if (tmp->slaves[x])
ast_cli(fd, "Slave Channel: %d\n", tmp->slaves[x]->channel);
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (tmp->pri) {
ast_cli(fd, "PRI Flags: ");
if (tmp->resetting)
@@ -10286,7 +10286,7 @@
{
int x = 0;
struct zt_pvt *p, *pl;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
int i;
for(i=0;i<NUM_SPANS;i++) {
if (pris[i].master != AST_PTHREADT_NULL)
@@ -10357,7 +10357,7 @@
ast_log(LOG_WARNING, "Unable to lock the monitor\n");
return -1;
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
for(i=0;i<NUM_SPANS;i++) {
if (pris[i].master && (pris[i].master != AST_PTHREADT_NULL))
pthread_join(pris[i].master, NULL);
@@ -10369,7 +10369,7 @@
int unload_module()
{
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
int y;
for (y=0;y<NUM_SPANS;y++)
ast_mutex_destroy(&pris[y].lock);
@@ -10389,7 +10389,7 @@
int y;
int found_pseudo = 0;
int cur_radio = 0;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
int spanno;
int i;
int logicalspan;
@@ -10412,7 +10412,7 @@
ast_log(LOG_ERROR, "Unable to lock interface list???\n");
return -1;
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (!reload) {
/* Process trunkgroups first */
v = ast_variable_browse(cfg, "trunkgroups");
@@ -10476,7 +10476,7 @@
while(v) {
/* Create the interface list */
if (!strcasecmp(v->name, "channel")
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
|| !strcasecmp(v->name, "crv")
#endif
) {
@@ -10490,7 +10490,7 @@
}
c = v->value;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
pri = NULL;
if (!strcasecmp(v->name, "crv")) {
if (sscanf(c, "%d:%n", &trunkgroup, &y) != 1) {
@@ -10544,7 +10544,7 @@
}
if (cur_outsignalling < 0) cur_outsignalling = cur_signalling;
for (x=start;x<=finish;x++) {
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
tmp = mkintf(x, cur_signalling, cur_outsignalling, cur_radio, pri, reload);
#else
tmp = mkintf(x, cur_signalling, cur_outsignalling, cur_radio, NULL, reload);
@@ -10552,7 +10552,7 @@
if (tmp) {
if (option_verbose > 2) {
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (pri)
ast_verbose(VERBOSE_PREFIX_3 "%s CRV %d:%d, %s signalling\n", reload ? "Reconfigured" : "Registered", trunkgroup,x, sig2str(tmp->sig));
else
@@ -10853,7 +10853,7 @@
} else if (!strcasecmp(v->value, "featb")) {
cur_signalling = SIG_FEATB;
cur_radio = 0;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
} else if (!strcasecmp(v->value, "pri_net")) {
cur_radio = 0;
cur_signalling = SIG_PRI;
@@ -10922,7 +10922,7 @@
ast_log(LOG_WARNING, "Unknown R2 Country '%s' at line %d.\n", v->value, v->lineno);
}
#endif
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
} else if (!strcasecmp(v->name, "pridialplan")) {
if (!strcasecmp(v->value, "national")) {
dialplan = PRI_NATIONAL_ISDN + 1;
@@ -11049,7 +11049,7 @@
} else if (!strcasecmp(v->name, "facilityenable")) {
facilityenable = ast_true(v->value);
#endif /* PRI_GETSET_TIMERS */
-#endif /* ZAPATA_PRI */
+#endif /* HAVE_LIBPRI */
} else if (!strcasecmp(v->name, "cadence")) {
/* setup to scan our argument */
int element_count, c[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
@@ -11207,7 +11207,7 @@
}
ast_mutex_unlock(&iflock);
ast_config_destroy(cfg);
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
if (!reload) {
for (x=0;x<NUM_SPANS;x++) {
if (pris[x].pvts[0]) {
@@ -11229,7 +11229,7 @@
{
int res;
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
int y,i;
memset(pris, 0, sizeof(pris));
for (y=0;y<NUM_SPANS;y++) {
@@ -11254,7 +11254,7 @@
__unload_module();
return -1;
}
-#ifdef ZAPATA_PRI
+#ifdef HAVE_LIBPRI
ast_string_field_init(&inuse, 16);
ast_string_field_set(&inuse, name, "GR-303InUse");
ast_cli_register_multiple(zap_pri_cli, sizeof(zap_pri_cli) / sizeof(zap_pri_cli[0]));
More information about the asterisk-commits
mailing list