echo ";transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of directly" ; \
echo ";runuser = asterisk ; The user to run as" ; \
echo ";rungroup = asterisk ; The group to run as" ; \
+ echo "dahdichanname = yes" ; Set channel name as DAHDI\
echo "" ; \
echo "; Changing the following lines may compromise your security." ; \
echo ";[files]" ; \
understand, and do not affect how it is actually parsed.
Entries of the form 'variable=value' set the value of some parameter in
-asterisk. For example, in zapata.conf, one might specify:
+asterisk. For example, in dahdi.conf, one might specify:
switchtype=national
);
if (ast_strlen_zero(data)) {
- ast_log(LOG_WARNING, "ChanIsAvail requires an argument (Zap/1&Zap/2)\n");
+ ast_log(LOG_WARNING, "ChanIsAvail requires an argument (DAHDI/1&DAHDI/2)\n");
return -1;
}
#include "asterisk/translate.h"
#include "asterisk/module.h"
#include "asterisk/lock.h"
+#include "asterisk/options.h"
#define AST_NAME_STRLEN 256
#define NUM_SPYGROUPS 128
const char *exten, const char *context, struct chanspy_ds *chanspy_ds)
{
struct ast_channel *next;
+ char channel_name[AST_CHANNEL_NAME];
redo:
if (!ast_strlen_zero(spec))
if (!next)
return NULL;
- if (!strncmp(next->name, "Zap/pseudo", 10)) {
+ snprintf(channel_name, AST_CHANNEL_NAME, "%s/pseudo", dahdi_chan_name);
+ if (!strncmp(next->name, channel_name, 10)) {
ast_channel_unlock(next);
goto redo;
} else if (next == chan) {
/*! \file
*
- * \brief Zap Barge support
+ * \brief DAHDI Barge support
*
* \author Mark Spencer <markster@digium.com>
*
*/
/*** MODULEINFO
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-#include "asterisk/zapata.h"
+#include "asterisk/dahdi.h"
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/say.h"
#include "asterisk/utils.h"
-static char *app = "ZapBarge";
+static char *app = "DAHDIBarge";
+static char *deprecated_app = "ZapBarge";
-static char *synopsis = "Barge in (monitor) Zap channel";
+static char *synopsis = "Barge in (monitor) DAHDI channel";
static char *descrip =
-" ZapBarge([channel]): Barges in on a specified zap\n"
+" DAHDIBarge([channel]): Barges in on a specified DAHDI\n"
"channel or prompts if one is not specified. Returns\n"
"-1 when caller user hangs up and is independent of the\n"
"state of the channel being monitored.";
static int conf_run(struct ast_channel *chan, int confno, int confflags)
{
int fd;
- struct zt_confinfo ztc;
+ struct dahdi_confinfo dahdic;
struct ast_frame *f;
struct ast_channel *c;
struct ast_frame fr;
int nfds;
int res;
int flags;
- int retryzap;
+ int retrydahdi;
int origfd;
int ret = -1;
- ZT_BUFFERINFO bi;
+ DAHDI_BUFFERINFO bi;
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
char *buf = __buf + AST_FRIENDLY_OFFSET;
goto outrun;
}
ast_indicate(chan, -1);
- retryzap = strcasecmp(chan->tech->type, "Zap");
-zapretry:
+ retrydahdi = strcasecmp(chan->tech->type, "DAHDI");
+dahdiretry:
origfd = chan->fds[0];
- if (retryzap) {
- fd = open("/dev/zap/pseudo", O_RDWR);
+ if (retrydahdi) {
+ fd = open("/dev/dahdi/pseudo", O_RDWR);
if (fd < 0) {
ast_log(LOG_WARNING, "Unable to open pseudo channel: %s\n", strerror(errno));
goto outrun;
/* Setup buffering information */
memset(&bi, 0, sizeof(bi));
bi.bufsize = CONF_SIZE;
- bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
- bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
+ bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
+ bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.numbufs = 4;
- if (ioctl(fd, ZT_SET_BUFINFO, &bi)) {
+ if (ioctl(fd, DAHDI_SET_BUFINFO, &bi)) {
ast_log(LOG_WARNING, "Unable to set buffering information: %s\n", strerror(errno));
close(fd);
goto outrun;
fd = chan->fds[0];
nfds = 0;
}
- memset(&ztc, 0, sizeof(ztc));
+ memset(&dahdic, 0, sizeof(dahdic));
/* Check to see if we're in a conference... */
- ztc.chan = 0;
- if (ioctl(fd, ZT_GETCONF, &ztc)) {
+ dahdic.chan = 0;
+ if (ioctl(fd, DAHDI_GETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error getting conference\n");
close(fd);
goto outrun;
}
- if (ztc.confmode) {
+ if (dahdic.confmode) {
/* Whoa, already in a conference... Retry... */
- if (!retryzap) {
- ast_debug(1, "Zap channel is in a conference already, retrying with pseudo\n");
- retryzap = 1;
- goto zapretry;
+ if (!retrydahdi) {
+ ast_debug(1, "DAHDI channel is in a conference already, retrying with pseudo\n");
+ retrydahdi = 1;
+ goto dahdiretry;
}
}
- memset(&ztc, 0, sizeof(ztc));
+ memset(&dahdic, 0, sizeof(dahdic));
/* Add us to the conference */
- ztc.chan = 0;
- ztc.confno = confno;
- ztc.confmode = ZT_CONF_MONITORBOTH;
+ dahdic.chan = 0;
+ dahdic.confno = confno;
+ dahdic.confmode = DAHDI_CONF_MONITORBOTH;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
goto outrun;
}
- ast_debug(1, "Placed channel %s in ZAP channel %d monitor\n", chan->name, confno);
+ ast_debug(1, "Placed channel %s in DAHDI channel %d monitor\n", chan->name, confno);
for(;;) {
outfd = -1;
c = ast_waitfor_nandfds(&chan, 1, &fd, nfds, NULL, &outfd, &ms);
if (c) {
if (c->fds[0] != origfd) {
- if (retryzap) {
+ if (retrydahdi) {
/* Kill old pseudo */
close(fd);
}
ast_debug(1, "Ooh, something swapped out under us, starting over\n");
- retryzap = 0;
- goto zapretry;
+ retrydahdi = 0;
+ goto dahdiretry;
}
f = ast_read(c);
if (!f)
else {
/* Take out of conference */
/* Add us to the conference */
- ztc.chan = 0;
- ztc.confno = 0;
- ztc.confmode = 0;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ dahdic.chan = 0;
+ dahdic.confno = 0;
+ dahdic.confmode = 0;
+ if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error setting conference\n");
}
}
char confstr[80] = "";
if (!ast_strlen_zero(data)) {
- if ((sscanf(data, "Zap/%d", &confno) != 1) &&
+ if ((sscanf(data, "DAHDI/%d", &confno) != 1) &&
(sscanf(data, "%d", &confno) != 1)) {
- ast_log(LOG_WARNING, "ZapBarge Argument (if specified) must be a channel number, not '%s'\n", (char *)data);
+ ast_log(LOG_WARNING, "DAHDIBarge Argument (if specified) must be a channel number, not '%s'\n", (char *)data);
return 0;
}
}
return res;
}
+static int conf_exec_warn(struct ast_channel *chan, void *data)
+{
+ ast_log(LOG_WARNING, "Use of the command %s is deprecated, please use %s instead.\n", deprecated_app, app);
+ return conf_exec(chan, data);
+}
+
static int unload_module(void)
{
return ast_unregister_application(app);
static int load_module(void)
{
+ ast_register_application(deprecated_app, conf_exec_warn, synopsis, descrip);
return ((ast_register_application(app, conf_exec, synopsis, descrip)) ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_SUCCESS);
}
-AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Barge in on Zap channel application");
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Barge in on DAHDI channel application");
*/
/*** MODULEINFO
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
***/
#include "asterisk.h"
#include <fcntl.h>
-#include "asterisk/zapata.h"
+#include "asterisk/dahdi.h"
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/module.h"
#include "asterisk/app.h"
-static char *app = "ZapRAS";
+static char *app = "DAHDIRAS";
+static char *deprecated_app = "ZapRAS";
-static char *synopsis = "Executes Zaptel ISDN RAS application";
+static char *synopsis = "Executes DAHDI ISDN RAS application";
static char *descrip =
-" ZapRAS(args): Executes a RAS server using pppd on the given channel.\n"
-"The channel must be a clear channel (i.e. PRI source) and a Zaptel\n"
+" DAHDIRAS(args): Executes a RAS server using pppd on the given channel.\n"
+"The channel must be a clear channel (i.e. PRI source) and a DAHDI\n"
"channel to be able to use this function (No modem emulation is included).\n"
-"Your pppd must be patched to be zaptel aware. Arguments should be\n"
+"Your pppd must be patched to be DAHDI aware. Arguments should be\n"
"separated by , characters.\n";
memset(argv, 0, sizeof(argv));
/* First argument is executable, followed by standard
- arguments for zaptel PPP */
+ arguments for DAHDI PPP */
argv[argc++] = PPP_EXEC;
argv[argc++] = "nodetach";
}
argv[argc++] = "plugin";
- argv[argc++] = "zaptel.so";
+ argv[argc++] = "dahdi.so";
argv[argc++] = "stdin";
/* Finally launch PPP */
int status;
int res;
int signalled = 0;
- struct zt_bufferinfo savebi;
+ struct dahdi_bufferinfo savebi;
int x;
- res = ioctl(chan->fds[0], ZT_GET_BUFINFO, &savebi);
+ res = ioctl(chan->fds[0], DAHDI_GET_BUFINFO, &savebi);
if(res) {
ast_log(LOG_WARNING, "Unable to check buffer policy on channel %s\n", chan->name);
return;
}
/* Throw back into audio mode */
x = 1;
- ioctl(chan->fds[0], ZT_AUDIOMODE, &x);
+ ioctl(chan->fds[0], DAHDI_AUDIOMODE, &x);
/* Restore saved values */
- res = ioctl(chan->fds[0], ZT_SET_BUFINFO, &savebi);
+ res = ioctl(chan->fds[0], DAHDI_SET_BUFINFO, &savebi);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to set buffer policy on channel %s\n", chan->name);
}
ast_safe_fork_cleanup();
}
-static int zapras_exec(struct ast_channel *chan, void *data)
+static int dahdiras_exec(struct ast_channel *chan, void *data)
{
int res=-1;
char *args;
- ZT_PARAMS ztp;
+ DAHDI_PARAMS dahdip;
if (!data)
data = "";
/* Answer the channel if it's not up */
if (chan->_state != AST_STATE_UP)
ast_answer(chan);
- if (strcasecmp(chan->tech->type, "Zap")) {
- /* If it's not a zap channel, we're done. Wait a couple of
+ if (strcasecmp(chan->tech->type, "DAHDI")) {
+ /* If it's not a DAHDI channel, we're done. Wait a couple of
seconds and then hangup... */
- ast_verb(2, "Channel %s is not a Zap channel\n", chan->name);
+ ast_verb(2, "Channel %s is not a DAHDI channel\n", chan->name);
sleep(2);
} else {
- memset(&ztp, 0, sizeof(ztp));
- if (ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp)) {
- ast_log(LOG_WARNING, "Unable to get zaptel parameters\n");
- } else if (ztp.sigtype != ZT_SIG_CLEAR) {
+ memset(&dahdip, 0, sizeof(dahdip));
+ if (ioctl(chan->fds[0], DAHDI_GET_PARAMS, &dahdip)) {
+ ast_log(LOG_WARNING, "Unable to get DAHDI parameters\n");
+ } else if (dahdip.sigtype != DAHDI_SIG_CLEAR) {
ast_verb(2, "Channel %s is not a clear channel\n", chan->name);
} else {
/* Everything should be okay. Run PPP. */
return res;
}
+static int dahdiras_exec_warn(struct ast_channel *chan, void *data)
+{
+ ast_log(LOG_WARNING, "Use of the command %s is deprecated, please use %s instead.\n", deprecated_app, app);
+ return dahdiras_exec(chan, data);
+}
+
static int unload_module(void)
{
return ast_unregister_application(app);
static int load_module(void)
{
- return ((ast_register_application(app, zapras_exec, synopsis, descrip)) ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_SUCCESS);
+ ast_register_application(deprecated_app, dahdiras_exec_warn, synopsis, descrip);
+ return ((ast_register_application(app, dahdiras_exec, synopsis, descrip)) ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_SUCCESS);
}
-AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Zaptel ISDN Remote Access Server");
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "DAHDI ISDN Remote Access Server");
/*! \file
*
- * \brief Zap Scanner
+ * \brief DAHDI Scanner
*
* \author Mark Spencer <markster@digium.com>
*
*/
/*** MODULEINFO
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-#include "asterisk/zapata.h"
+#include "asterisk/dahdi.h"
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/utils.h"
#include "asterisk/cli.h"
#include "asterisk/say.h"
+#include "asterisk/options.h"
-static char *app = "ZapScan";
+static char *app = "DAHDIScan";
+static char *deprecated_app = "ZapScan";
-static char *synopsis = "Scan Zap channels to monitor calls";
+static char *synopsis = "Scan DAHDI channels to monitor calls";
static char *descrip =
-" ZapScan([group]) allows a call center manager to monitor Zap channels in\n"
+" DAHDIScan([group]) allows a call center manager to monitor DAHDI channels in\n"
"a convenient way. Use '#' to select the next channel and use '*' to exit\n"
"Limit scanning to a channel GROUP by setting the option group argument.\n";
#define CONF_SIZE 160
-static struct ast_channel *get_zap_channel_locked(int num) {
+static struct ast_channel *get_dahdi_channel_locked(int num) {
char name[80];
- snprintf(name, sizeof(name), "Zap/%d-1", num);
+ snprintf(name, sizeof(name), "%s/%d-1", dahdi_chan_name, num);
return ast_get_channel_by_name_locked(name);
}
static int conf_run(struct ast_channel *chan, int confno, int confflags)
{
int fd;
- struct zt_confinfo ztc;
+ struct dahdi_confinfo dahdic;
struct ast_frame *f;
struct ast_channel *c;
struct ast_frame fr;
int nfds;
int res;
int flags;
- int retryzap;
+ int retrydahdi;
int origfd;
int ret = -1;
char input[4];
int ic = 0;
- ZT_BUFFERINFO bi;
+ DAHDI_BUFFERINFO bi;
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
char *buf = __buf + AST_FRIENDLY_OFFSET;
goto outrun;
}
ast_indicate(chan, -1);
- retryzap = strcasecmp(chan->tech->type, "Zap");
- zapretry:
+ retrydahdi = strcasecmp(chan->tech->type, "DAHDI");
+ dahdiretry:
origfd = chan->fds[0];
- if (retryzap) {
- fd = open("/dev/zap/pseudo", O_RDWR);
+ if (retrydahdi) {
+ fd = open("/dev/dahdi/pseudo", O_RDWR);
if (fd < 0) {
ast_log(LOG_WARNING, "Unable to open pseudo channel: %s\n", strerror(errno));
goto outrun;
/* Setup buffering information */
memset(&bi, 0, sizeof(bi));
bi.bufsize = CONF_SIZE;
- bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
- bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
+ bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
+ bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.numbufs = 4;
- if (ioctl(fd, ZT_SET_BUFINFO, &bi)) {
+ if (ioctl(fd, DAHDI_SET_BUFINFO, &bi)) {
ast_log(LOG_WARNING, "Unable to set buffering information: %s\n", strerror(errno));
close(fd);
goto outrun;
fd = chan->fds[0];
nfds = 0;
}
- memset(&ztc, 0, sizeof(ztc));
+ memset(&dahdic, 0, sizeof(dahdic));
/* Check to see if we're in a conference... */
- ztc.chan = 0;
- if (ioctl(fd, ZT_GETCONF, &ztc)) {
+ dahdic.chan = 0;
+ if (ioctl(fd, DAHDI_GETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error getting conference\n");
close(fd);
goto outrun;
}
- if (ztc.confmode) {
+ if (dahdic.confmode) {
/* Whoa, already in a conference... Retry... */
- if (!retryzap) {
- ast_debug(1, "Zap channel is in a conference already, retrying with pseudo\n");
- retryzap = 1;
- goto zapretry;
+ if (!retrydahdi) {
+ ast_debug(1, "DAHDI channel is in a conference already, retrying with pseudo\n");
+ retrydahdi = 1;
+ goto dahdiretry;
}
}
- memset(&ztc, 0, sizeof(ztc));
+ memset(&dahdic, 0, sizeof(dahdic));
/* Add us to the conference */
- ztc.chan = 0;
- ztc.confno = confno;
- ztc.confmode = ZT_CONF_MONITORBOTH;
+ dahdic.chan = 0;
+ dahdic.confno = confno;
+ dahdic.confmode = DAHDI_CONF_MONITORBOTH;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
goto outrun;
}
- ast_debug(1, "Placed channel %s in ZAP channel %d monitor\n", chan->name, confno);
+ ast_debug(1, "Placed channel %s in DAHDI channel %d monitor\n", chan->name, confno);
for (;;) {
outfd = -1;
c = ast_waitfor_nandfds(&chan, 1, &fd, nfds, NULL, &outfd, &ms);
if (c) {
if (c->fds[0] != origfd) {
- if (retryzap) {
+ if (retrydahdi) {
/* Kill old pseudo */
close(fd);
}
ast_debug(1, "Ooh, something swapped out under us, starting over\n");
- retryzap = 0;
- goto zapretry;
+ retrydahdi = 0;
+ goto dahdiretry;
}
f = ast_read(c);
if (!f) {
input[ic++] = '\0';
ic = 0;
ret = atoi(input);
- ast_verb(3, "Zapscan: change channel to %d\n", ret);
+ ast_verb(3, "DAHDIScan: change channel to %d\n", ret);
break;
}
}
} else {
/* Take out of conference */
/* Add us to the conference */
- ztc.chan = 0;
- ztc.confno = 0;
- ztc.confmode = 0;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ dahdic.chan = 0;
+ dahdic.confno = 0;
+ dahdic.confmode = 0;
+ if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error setting conference\n");
}
}
ast_frfree(f);
ichan = NULL;
if(input) {
- ichan = get_zap_channel_locked(input);
+ ichan = get_dahdi_channel_locked(input);
input = 0;
}
continue;
}
}
- if (tempchan && (!strcmp(tempchan->tech->type, "Zap")) && (tempchan != chan)) {
- ast_verb(3, "Zap channel %s is in-use, monitoring...\n", tempchan->name);
+ if (tempchan && (!strcmp(tempchan->tech->type, "DAHDI")) && (tempchan != chan)) {
+ ast_verb(3, "DAHDI channel %s is in-use, monitoring...\n", tempchan->name);
ast_copy_string(confstr, tempchan->name, sizeof(confstr));
ast_channel_unlock(tempchan);
if ((tmp = strchr(confstr, '-'))) {
return res;
}
+static int conf_exec_warn(struct ast_channel *chan, void *data)
+{
+ ast_log(LOG_WARNING, "Use of the command %s is deprecated, please use %s instead.\n", deprecated_app, app);
+ return conf_exec(chan, data);
+}
+
static int unload_module(void)
{
return ast_unregister_application(app);
static int load_module(void)
{
+ ast_register_application(deprecated_app, conf_exec_warn, synopsis, descrip);
return ((ast_register_application(app, conf_exec, synopsis, descrip)) ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_SUCCESS);
}
-AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Scan Zap channels application");
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Scan DAHDI channels application");
" o - Specify that the CallerID that was present on the *calling* channel\n"
" be set as the CallerID on the *called* channel. This was the\n"
" behavior of Asterisk 1.0 and earlier.\n"
-" O([x]) - \"Operator Services\" mode (Zaptel channel to Zaptel channel\n"
-" only, if specified on non-Zaptel interface, it will be ignored).\n"
+" O([x]) - \"Operator Services\" mode (DAHDI channel to DAHDI channel\n"
+" only, if specified on non-DAHDI interface, it will be ignored).\n"
" When the destination answers (presumably an operator services\n"
" station), the originator no longer has control of their line.\n"
" They may hang up, but the switch will not release their line\n"
res = -1;
goto done;
}
- if (opermode && !strncmp(chan->name, "Zap", 3) && !strncmp(peer->name, "Zap", 3)) {
- /* what's this special handling for Zap <-> Zap ?
- * A: Zap to Zap calls are natively bridged at the kernel driver
+ if (opermode && !strncmp(chan->tech->type, "DAHDI", 3) && !strncmp(peer->name, "DAHDI", 3)) {
+ /* what's this special handling for dahdi <-> dahdi ?
+ * A: dahdi to dahdi calls are natively bridged at the kernel driver
* level, so we need to ensure that this mode gets propagated
* all the way down. */
struct oprmode oprmode;
+++ /dev/null
-/*
- * Asterisk -- A telephony toolkit for Linux.
- *
- * Simple fax applications
- *
- * 2007-2008, Dmitry Andrianov <asterisk@dima.spb.ru>
- *
- * Code based on original implementation by Steve Underwood <steveu@coppice.org>
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License
- *
- */
-
-/*** MODULEINFO
- <depend>spandsp</depend>
-***/
-
-#include "asterisk.h"
-
-ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <inttypes.h>
-#include <pthread.h>
-#include <errno.h>
-#include <tiffio.h>
-
-#include <spandsp.h>
-
-#include "asterisk/lock.h"
-#include "asterisk/file.h"
-#include "asterisk/logger.h"
-#include "asterisk/channel.h"
-#include "asterisk/pbx.h"
-#include "asterisk/app.h"
-#include "asterisk/dsp.h"
-#include "asterisk/module.h"
-#include "asterisk/manager.h"
-
-static char *app_sndfax_name = "SendFAX";
-static char *app_sndfax_synopsis = "Send a FAX";
-static char *app_sndfax_desc =
-" SendFAX(filename[|options]):\n"
-"Send a given TIFF file to the channel as a FAX.\n"
-"The option string may contain zero or more of the following characters:\n"
-" 'a' -- makes the application behave as an answering machine\n"
-" The default behaviour is to behave as a calling machine.\n"
-"\n"
-"This application uses following variables:\n"
-" LOCALSTATIONID to identify itself to the remote end.\n"
-" LOCALHEADERINFO to generate a header line on each page.\n"
-"\n"
-"This application sets the following channel variables upon completion:\n"
-" FAXSTATUS - status of operation:\n"
-" SUCCESS | FAILED\n"
-" FAXERROR - Error when FAILED\n"
-" REMOTESTATIONID - CSID of the remote side.\n"
-" FAXPAGES - number of pages sent.\n"
-" FAXBITRATE - transmition rate.\n"
-" FAXRESOLUTION - resolution.\n"
-"\n"
-"Returns -1 in case of user hang up or any channel error.\n"
-"Returns 0 on success.\n";
-
-static char *app_rcvfax_name = "ReceiveFAX";
-static char *app_rcvfax_synopsis = "Receive a FAX";
-static char *app_rcvfax_desc =
-" ReceiveFAX(filename[|options]):\n"
-"Receives a fax from the channel into the given filename overwriting\n"
-"the file if it already exists. File created will have TIFF format.\n"
-"The option string may contain zero or more of the following characters:\n"
-" 'c' -- makes the application behave as a calling machine\n"
-" The default behaviour is to behave as an answering machine.\n"
-"\n"
-"This application uses following variables:\n"
-" LOCALSTATIONID to identify itself to the remote end.\n"
-" LOCALHEADERINFO to generate a header line on each page.\n"
-"\n"
-"This application sets the following channel variables upon completion:\n"
-" FAXSTATUS - status of operation:\n"
-" SUCCESS | FAILED\n"
-" FAXERROR - Error when FAILED\n"
-" REMOTESTATIONID - CSID of the remote side.\n"
-" FAXPAGES - number of pages sent.\n"
-" FAXBITRATE - transmition rate.\n"
-" FAXRESOLUTION - resolution.\n"
-"\n"
-"Returns -1 in case of user hang up or any channel error.\n"
-"Returns 0 on success.\n";
-
-#define MAX_SAMPLES 240
-
-/* Watchdog. I have seen situations when remote fax disconnects (because of poor line
- quality) while SpanDSP continues staying in T30_STATE_IV_CTC state forever.
- To avoid this, we terminate when we see that T30 state does not change for 5 minutes.
- We also terminate application when more than 30 minutes passed regardless of
- state changes. This is just a precaution measure - no fax should take that long */
-
-#define WATCHDOG_TOTAL_TIMEOUT 30 * 60
-#define WATCHDOG_STATE_TIMEOUT 5 * 60
-
-typedef struct {
- struct ast_channel *chan;
- enum ast_t38_state t38state; /* T38 state of the channel */
- int direction; /* Fax direction: 0 - receiving, 1 - sending */
- int caller_mode;
- char *file_name;
-
- volatile int finished;
-} fax_session;
-
-static void span_message(int level, const char *msg)
-{
- if (level == SPAN_LOG_ERROR) {
- ast_log(LOG_ERROR, "%s", msg);
- } else if (level == SPAN_LOG_WARNING) {
- ast_log(LOG_WARNING, "%s", msg);
- } else {
- ast_log(LOG_DEBUG, "%s", msg);
- }
-}
-
-static int t38_tx_packet_handler(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count)
-{
- struct ast_channel *chan = (struct ast_channel *) user_data;
-
- struct ast_frame outf = {
- .frametype = AST_FRAME_MODEM,
- .subclass = AST_MODEM_T38,
- .src = __FUNCTION__,
- };
-
- /* TODO: Asterisk does not provide means of resending the same packet multiple
- times so count is ignored at the moment */
-
- AST_FRAME_SET_BUFFER(&outf, buf, 0, len);
-
- if (ast_write(chan, &outf) < 0) {
- ast_log(LOG_WARNING, "Unable to write frame to channel; %s\n", strerror(errno));
- return -1;
- }
-
- return 0;
-}
-
-static void phase_e_handler(t30_state_t *f, void *user_data, int result)
-{
- const char *local_ident;
- const char *far_ident;
- char buf[20];
- fax_session *s = (fax_session *) user_data;
- t30_stats_t stat;
-
- ast_debug(1, "Fax phase E handler. result=%d\n", result);
-
- t30_get_transfer_statistics(f, &stat);
-
- s = (fax_session *) user_data;
-
- if (result != T30_ERR_OK) {
- s->finished = -1;
-
- /* FAXSTATUS is already set to FAILED */
- pbx_builtin_setvar_helper(s->chan, "FAXERROR", t30_completion_code_to_str(result));
-
- ast_log(LOG_WARNING, "Error transmitting fax. result=%d: %s.\n", result, t30_completion_code_to_str(result));
-
- return;
- }
-
- s->finished = 1;
-
- local_ident = t30_get_tx_ident(f);
- far_ident = t30_get_rx_ident(f);
- pbx_builtin_setvar_helper(s->chan, "FAXSTATUS", "SUCCESS");
- pbx_builtin_setvar_helper(s->chan, "FAXERROR", NULL);
- pbx_builtin_setvar_helper(s->chan, "REMOTESTATIONID", far_ident);
- snprintf(buf, sizeof(buf), "%d", stat.pages_transferred);
- pbx_builtin_setvar_helper(s->chan, "FAXPAGES", buf);
- snprintf(buf, sizeof(buf), "%d", stat.y_resolution);
- pbx_builtin_setvar_helper(s->chan, "FAXRESOLUTION", buf);
- snprintf(buf, sizeof(buf), "%d", stat.bit_rate);
- pbx_builtin_setvar_helper(s->chan, "FAXBITRATE", buf);
-
- ast_debug(1, "Fax transmitted successfully.\n");
- ast_debug(1, " Remote station ID: %s\n", far_ident);
- ast_debug(1, " Pages transferred: %d\n", stat.pages_transferred);
- ast_debug(1, " Image resolution: %d x %d\n", stat.x_resolution, stat.y_resolution);
- ast_debug(1, " Transfer Rate: %d\n", stat.bit_rate);
-
- manager_event(EVENT_FLAG_CALL,
- s->direction ? "FaxSent" : "FaxReceived",
- "Channel: %s\r\n"
- "Exten: %s\r\n"
- "CallerID: %s\r\n"
- "RemoteStationID: %s\r\n"
- "LocalStationID: %s\r\n"
- "PagesTransferred: %d\r\n"
- "Resolution: %d\r\n"
- "TransferRate: %d\r\n"
- "FileName: %s\r\n",
- s->chan->name,
- s->chan->exten,
- S_OR(s->chan->cid.cid_num, ""),
- far_ident,
- local_ident,
- stat.pages_transferred,
- stat.y_resolution,
- stat.bit_rate,
- s->file_name);
-}
-
-/* === Helper functions to configure fax === */
-
-/* Setup SPAN logging according to Asterisk debug level */
-static int set_logging(logging_state_t *state)
-{
- int level = SPAN_LOG_WARNING + option_debug;
-
- span_log_set_message_handler(state, span_message);
- span_log_set_level(state, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | level);
-
- return 0;
-}
-
-static void set_local_info(t30_state_t *state, fax_session *s)
-{
- const char *x;
-
- x = pbx_builtin_getvar_helper(s->chan, "LOCALSTATIONID");
- if (!ast_strlen_zero(x))
- t30_set_tx_ident(state, x);
-
- x = pbx_builtin_getvar_helper(s->chan, "LOCALHEADERINFO");
- if (!ast_strlen_zero(x))
- t30_set_tx_page_header_info(state, x);
-}
-
-static void set_file(t30_state_t *state, fax_session *s)
-{
- if (s->direction)
- t30_set_tx_file(state, s->file_name, -1, -1);
- else
- t30_set_rx_file(state, s->file_name, -1);
-}
-
-static void set_ecm(t30_state_t *state, int ecm)
-{
- t30_set_ecm_capability(state, ecm);
- t30_set_supported_compressions(state, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION);
-}
-
-/* === Generator === */
-
-/* This function is only needed to return passed params so
- generator_activate will save it to channel's generatordata */
-static void *fax_generator_alloc(struct ast_channel *chan, void *params)
-{
- return params;
-}
-
-static int fax_generator_generate(struct ast_channel *chan, void *data, int len, int samples)
-{
- fax_state_t *fax = (fax_state_t*) data;
- uint8_t buffer[AST_FRIENDLY_OFFSET + MAX_SAMPLES * sizeof(uint16_t)];
- int16_t *buf = (int16_t *) (buffer + AST_FRIENDLY_OFFSET);
-
- struct ast_frame outf = {
- .frametype = AST_FRAME_VOICE,
- .subclass = AST_FORMAT_SLINEAR,
- .src = __FUNCTION__,
- };
-
- if (samples > MAX_SAMPLES) {
- ast_log(LOG_WARNING, "Only generating %d samples, where %d requested\n", MAX_SAMPLES, samples);
- samples = MAX_SAMPLES;
- }
-
- if ((len = fax_tx(fax, buf, samples)) > 0) {
- outf.samples = len;
- AST_FRAME_SET_BUFFER(&outf, buffer, AST_FRIENDLY_OFFSET, len * sizeof(int16_t));
-
- if (ast_write(chan, &outf) < 0) {
- ast_log(LOG_WARNING, "Failed to write frame to '%s': %s\n", chan->name, strerror(errno));
- return -1;
- }
- }
-
- return 0;
-}
-
-struct ast_generator generator = {
- alloc: fax_generator_alloc,
- generate: fax_generator_generate,
-};
-
-
-/* === Transmission === */
-
-static int transmit_audio(fax_session *s)
-{
- int res = -1;
- int original_read_fmt = AST_FORMAT_SLINEAR;
- int original_write_fmt = AST_FORMAT_SLINEAR;
- fax_state_t fax;
- struct ast_dsp *dsp = NULL;
- int detect_tone = 0;
- struct ast_frame *inf = NULL;
- struct ast_frame *fr;
- int last_state = 0;
- struct timeval now, start, state_change;
- enum ast_control_t38 t38control;
-
- original_read_fmt = s->chan->readformat;
- if (original_read_fmt != AST_FORMAT_SLINEAR) {
- res = ast_set_read_format(s->chan, AST_FORMAT_SLINEAR);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set to linear read mode, giving up\n");
- goto done;
- }
- }
-
- original_write_fmt = s->chan->writeformat;
- if (original_write_fmt != AST_FORMAT_SLINEAR) {
- res = ast_set_write_format(s->chan, AST_FORMAT_SLINEAR);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set to linear write mode, giving up\n");
- goto done;
- }
- }
-
- /* Initialize T30 terminal */
- fax_init(&fax, s->caller_mode);
-
- /* Setup logging */
- set_logging(&fax.logging);
- set_logging(&fax.t30_state.logging);
-
- /* Configure terminal */
- set_local_info(&fax.t30_state, s);
- set_file(&fax.t30_state, s);
- set_ecm(&fax.t30_state, TRUE);
-
- fax_set_transmit_on_idle(&fax, TRUE);
-
- t30_set_phase_e_handler(&fax.t30_state, phase_e_handler, s);
-
- if (s->t38state == T38_STATE_UNAVAILABLE) {
- ast_debug(1, "T38 is unavailable on %s\n", s->chan->name);
- } else if (!s->direction) {
- /* We are receiving side and this means we are the side which should
- request T38 when the fax is detected. Use DSP to detect fax tone */
- ast_debug(1, "Setting up CNG detection on %s\n", s->chan->name);
- dsp = ast_dsp_new();
- ast_dsp_set_features(dsp, DSP_FEATURE_FAX_DETECT);
- ast_dsp_set_faxmode(dsp, DSP_FAXMODE_DETECT_CNG);
- detect_tone = 1;
- }
-
- start = state_change = ast_tvnow();
-
- ast_activate_generator(s->chan, &generator, &fax);
-
- while (!s->finished) {
- res = ast_waitfor(s->chan, 20);
- if (res < 0)
- break;
- else if (res > 0)
- res = 0;
-
- inf = ast_read(s->chan);
- if (inf == NULL) {
- ast_debug(1, "Channel hangup\n");
- res = -1;
- break;
- }
-
- ast_debug(10, "frame %d/%d, len=%d\n", inf->frametype, inf->subclass, inf->datalen);
-
- /* Detect fax tone */
- if (detect_tone && inf->frametype == AST_FRAME_VOICE) {
- /* Duplicate frame because ast_dsp_process may free the frame passed */
- fr = ast_frdup(inf);
-
- /* Do not pass channel to ast_dsp_process otherwise it may queue modified audio frame back */
- fr = ast_dsp_process(NULL, dsp, fr);
- if (fr && fr->frametype == AST_FRAME_DTMF && fr->subclass == 'f') {
- ast_debug(1, "Fax tone detected. Requesting T38\n");
- t38control = AST_T38_REQUEST_NEGOTIATE;
- ast_indicate_data(s->chan, AST_CONTROL_T38, &t38control, sizeof(t38control));
- detect_tone = 0;
- }
-
- ast_frfree(fr);
- }
-
-
- /* Check the frame type. Format also must be checked because there is a chance
- that a frame in old format was already queued before we set chanel format
- to slinear so it will still be received by ast_read */
- if (inf->frametype == AST_FRAME_VOICE && inf->subclass == AST_FORMAT_SLINEAR) {
-
- if (fax_rx(&fax, inf->data.ptr, inf->samples) < 0) {
- /* I know fax_rx never returns errors. The check here is for good style only */
- ast_log(LOG_WARNING, "fax_rx returned error\n");
- res = -1;
- break;
- }
-
- /* Watchdog */
- if (last_state != fax.t30_state.state) {
- state_change = ast_tvnow();
- last_state = fax.t30_state.state;
- }
- } else if (inf->frametype == AST_FRAME_CONTROL && inf->subclass == AST_CONTROL_T38 &&
- inf->datalen == sizeof(enum ast_control_t38)) {
- t38control =*((enum ast_control_t38 *) inf->data.ptr);
- if (t38control == AST_T38_NEGOTIATED) {
- /* T38 switchover completed */
- ast_debug(1, "T38 negotiated, finishing audio loop\n");
- res = 1;
- break;
- }
- }
-
- ast_frfree(inf);
- inf = NULL;
-
- /* Watchdog */
- now = ast_tvnow();
- if (ast_tvdiff_sec(now, start) > WATCHDOG_TOTAL_TIMEOUT || ast_tvdiff_sec(now, state_change) > WATCHDOG_STATE_TIMEOUT) {
- ast_log(LOG_WARNING, "It looks like we hung. Aborting.\n");
- res = -1;
- break;
- }
- }
-
- ast_debug(1, "Loop finished, res=%d\n", res);
-
- if (inf)
- ast_frfree(inf);
-
- if (dsp)
- ast_dsp_free(dsp);
-
- ast_deactivate_generator(s->chan);
-
- /* Remove phase E handler because we do not want it to be executed
- only because we called t30_terminate */
- t30_set_phase_e_handler(&fax.t30_state, NULL, NULL);
-
- t30_terminate(&fax.t30_state);
- fax_release(&fax);
-
-done:
- if (original_write_fmt != AST_FORMAT_SLINEAR) {
- if (ast_set_write_format(s->chan, original_write_fmt) < 0)
- ast_log(LOG_WARNING, "Unable to restore write format on '%s'\n", s->chan->name);
- }
-
- if (original_read_fmt != AST_FORMAT_SLINEAR) {
- if (ast_set_read_format(s->chan, original_read_fmt) < 0)
- ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", s->chan->name);
- }
-
- return res;
-
-}
-
-static int transmit_t38(fax_session *s)
-{
- int res = 0;
- t38_terminal_state_t t38;
- struct ast_frame *inf = NULL;
- int last_state = 0;
- struct timeval now, start, state_change, last_frame;
- enum ast_control_t38 t38control;
-
- /* Initialize terminal */
- memset(&t38, 0, sizeof(t38));
- if (t38_terminal_init(&t38, s->caller_mode, t38_tx_packet_handler, s->chan) == NULL) {
- ast_log(LOG_WARNING, "Unable to start T.38 termination.\n");
- return -1;
- }
-
- /* Setup logging */
- set_logging(&t38.logging);
- set_logging(&t38.t30_state.logging);
- set_logging(&t38.t38.logging);
-
- /* Configure terminal */
- set_local_info(&t38.t30_state, s);
- set_file(&t38.t30_state, s);
- set_ecm(&t38.t30_state, TRUE);
-
- t30_set_phase_e_handler(&t38.t30_state, phase_e_handler, s);
-
- now = start = state_change = ast_tvnow();
-
- while (!s->finished) {
-
- res = ast_waitfor(s->chan, 20);
- if (res < 0)
- break;
- else if (res > 0)
- res = 0;
-
- last_frame = now;
- now = ast_tvnow();
- t38_terminal_send_timeout(&t38, ast_tvdiff_us(now, last_frame) / (1000000 / 8000));
-
- inf = ast_read(s->chan);
- if (inf == NULL) {
- ast_debug(1, "Channel hangup\n");
- res = -1;
- break;
- }
-
- ast_debug(10, "frame %d/%d, len=%d\n", inf->frametype, inf->subclass, inf->datalen);
-
- if (inf->frametype == AST_FRAME_MODEM && inf->subclass == AST_MODEM_T38) {
- t38_core_rx_ifp_packet(&t38.t38, inf->data.ptr, inf->datalen, inf->seqno);
-
- /* Watchdog */
- if (last_state != t38.t30_state.state) {
- state_change = ast_tvnow();
- last_state = t38.t30_state.state;
- }
- } else if (inf->frametype == AST_FRAME_CONTROL && inf->subclass == AST_CONTROL_T38 &&
- inf->datalen == sizeof(enum ast_control_t38)) {
-
- t38control = *((enum ast_control_t38 *) inf->data.ptr);
-
- if (t38control == AST_T38_TERMINATED || t38control == AST_T38_REFUSED) {
- ast_debug(1, "T38 down, terminating\n");
- res = -1;
- break;
- }
- }
-
- ast_frfree(inf);
- inf = NULL;
-
- /* Watchdog */
- if (ast_tvdiff_sec(now, start) > WATCHDOG_TOTAL_TIMEOUT || ast_tvdiff_sec(now, state_change) > WATCHDOG_STATE_TIMEOUT) {
- ast_log(LOG_WARNING, "It looks like we hung. Aborting.\n");
- res = -1;
- break;
- }
- }
-
- ast_debug(1, "Loop finished, res=%d\n", res);
-
- if (inf)
- ast_frfree(inf);
-
- /* Remove phase E handler because we do not want it to be executed
- only because we called t30_terminate */
- t30_set_phase_e_handler(&t38.t30_state, NULL, NULL);
-
- t30_terminate(&t38.t30_state);
-
- return res;
-}
-
-static int transmit(fax_session *s)
-{
- int res = 0;
-
- /* Clear all channel variables which to be set by the application.
- Pre-set status to error so in case of any problems we can just leave */
- pbx_builtin_setvar_helper(s->chan, "FAXSTATUS", "FAILED");
- pbx_builtin_setvar_helper(s->chan, "FAXERROR", "Channel problems");
-
- pbx_builtin_setvar_helper(s->chan, "REMOTESTATIONID", NULL);
- pbx_builtin_setvar_helper(s->chan, "FAXPAGES", NULL);
- pbx_builtin_setvar_helper(s->chan, "FAXRESOLUTION", NULL);
- pbx_builtin_setvar_helper(s->chan, "FAXBITRATE", NULL);
-
- if (s->chan->_state != AST_STATE_UP) {
- /* Shouldn't need this, but checking to see if channel is already answered
- * Theoretically asterisk should already have answered before running the app */
- res = ast_answer(s->chan);
- if (res) {
- ast_log(LOG_WARNING, "Could not answer channel '%s'\n", s->chan->name);
- return res;
- }
- }
-
- s->t38state = ast_channel_get_t38_state(s->chan);
- if (s->t38state != T38_STATE_NEGOTIATED) {
- /* T38 is not negotiated on the channel yet. First start regular transmission. If it switches to T38, follow */
- res = transmit_audio(s);
- if (res > 0) {
- /* transmit_audio reports switchover to T38. Update t38state */
- s->t38state = ast_channel_get_t38_state(s->chan);
- if (s->t38state != T38_STATE_NEGOTIATED) {
- ast_log(LOG_ERROR, "Audio loop reports T38 switchover but t38state != T38_STATE_NEGOTIATED\n");
- }
- }
- }
-
- if (s->t38state == T38_STATE_NEGOTIATED) {
- res = transmit_t38(s);
- }
-
- if (res) {
- ast_log(LOG_WARNING, "Transmission error\n");
- res = -1;
- } else if (s->finished < 0) {
- ast_log(LOG_WARNING, "Transmission failed\n");
- } else if (s->finished > 0) {
- ast_debug(1, "Transmission finished Ok\n");
- }
-
- return res;
-}
-
-/* === Application functions === */
-
-static int sndfax_exec(struct ast_channel *chan, void *data)
-{
- int res = 0;
- char *parse;
- fax_session session;
-
- AST_DECLARE_APP_ARGS(args,
- AST_APP_ARG(file_name);
- AST_APP_ARG(options);
- );
-
- if (chan == NULL) {
- ast_log(LOG_ERROR, "Fax channel is NULL. Giving up.\n");
- return -1;
- }
-
- /* The next few lines of code parse out the filename and header from the input string */
- if (ast_strlen_zero(data)) {
- /* No data implies no filename or anything is present */
- ast_log(LOG_ERROR, "SendFAX requires an argument (filename)\n");
- return -1;
- }
-
- parse = ast_strdupa(data);
- AST_STANDARD_APP_ARGS(args, parse);
-
- session.caller_mode = TRUE;
-
- if (args.options) {
- if (strchr(args.options, 'a'))
- session.caller_mode = FALSE;
- }
-
- /* Done parsing */
- session.direction = 1;
- session.file_name = args.file_name;
- session.chan = chan;
- session.finished = 0;
-
- res = transmit(&session);
-
- return res;
-}
-
-static int rcvfax_exec(struct ast_channel *chan, void *data)
-{
- int res = 0;
- char *parse;
- fax_session session;
-
- AST_DECLARE_APP_ARGS(args,
- AST_APP_ARG(file_name);
- AST_APP_ARG(options);
- );
-
- if (chan == NULL) {
- ast_log(LOG_ERROR, "Fax channel is NULL. Giving up.\n");
- return -1;
- }
-
- /* The next few lines of code parse out the filename and header from the input string */
- if (ast_strlen_zero(data)) {
- /* No data implies no filename or anything is present */
- ast_log(LOG_ERROR, "ReceiveFAX requires an argument (filename)\n");
- return -1;
- }
-
- parse = ast_strdupa(data);
- AST_STANDARD_APP_ARGS(args, parse);
-
- session.caller_mode = FALSE;
-
- if (args.options) {
- if (strchr(args.options, 'c'))
- session.caller_mode = TRUE;
- }
-
- /* Done parsing */
- session.direction = 0;
- session.file_name = args.file_name;
- session.chan = chan;
- session.finished = 0;
-
- res = transmit(&session);
-
- return res;
-}
-
-static int unload_module(void)
-{
- int res;
-
- res = ast_unregister_application(app_sndfax_name);
- res |= ast_unregister_application(app_rcvfax_name);
-
- return res;
-}
-
-static int load_module(void)
-{
- int res ;
-
- res = ast_register_application(app_sndfax_name, sndfax_exec, app_sndfax_synopsis, app_sndfax_desc);
- res |= ast_register_application(app_rcvfax_name, rcvfax_exec, app_rcvfax_synopsis, app_rcvfax_desc);
-
- /* The default SPAN message handler prints to stderr. It is something we do not want */
- span_set_message_handler(NULL);
-
- return res;
-}
-
-
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Simple FAX Application",
- .load = load_module,
- .unload = unload_module,
- );
-
-
/*! \file
*
- * \brief App to flash a zap trunk
+ * \brief App to flash a DAHDI trunk
*
* \author Mark Spencer <markster@digium.com>
*
*/
/*** MODULEINFO
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-#include "asterisk/zapata.h"
+#include "asterisk/dahdi.h"
#include "asterisk/lock.h"
#include "asterisk/file.h"
static char *app = "Flash";
-static char *synopsis = "Flashes a Zap Trunk";
+static char *synopsis = "Flashes a DAHDI Trunk";
static char *descrip =
-"Performs a flash on a zap trunk. This can be used\n"
+"Performs a flash on a DAHDI trunk. This can be used\n"
"to access features provided on an incoming analogue circuit\n"
"such as conference and call waiting. Use with SendDTMF() to\n"
"perform external transfers\n";
-static inline int zt_wait_event(int fd)
+static inline int dahdi_wait_event(int fd)
{
- /* Avoid the silly zt_waitevent which ignores a bunch of events */
+ /* Avoid the silly dahdi_waitevent which ignores a bunch of events */
int i,j=0;
- i = ZT_IOMUX_SIGEVENT;
- if (ioctl(fd, ZT_IOMUX, &i) == -1) return -1;
- if (ioctl(fd, ZT_GETEVENT, &j) == -1) return -1;
+ i = DAHDI_IOMUX_SIGEVENT;
+ if (ioctl(fd, DAHDI_IOMUX, &i) == -1) return -1;
+ if (ioctl(fd, DAHDI_GETEVENT, &j) == -1) return -1;
return j;
}
{
int res = -1;
int x;
- struct zt_params ztp;
+ struct dahdi_params dahdip;
- if (strcasecmp(chan->tech->type, "Zap")) {
- ast_log(LOG_WARNING, "%s is not a Zap channel\n", chan->name);
+ if (strcasecmp(chan->tech->type, "DAHDI")) {
+ ast_log(LOG_WARNING, "%s is not a DAHDI channel\n", chan->name);
return -1;
}
- memset(&ztp, 0, sizeof(ztp));
- res = ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp);
+ memset(&dahdip, 0, sizeof(dahdip));
+ res = ioctl(chan->fds[0], DAHDI_GET_PARAMS, &dahdip);
if (!res) {
- if (ztp.sigtype & __ZT_SIG_FXS) {
- x = ZT_FLASH;
- res = ioctl(chan->fds[0], ZT_HOOK, &x);
+ if (dahdip.sigtype & __DAHDI_SIG_FXS) {
+ x = DAHDI_FLASH;
+ res = ioctl(chan->fds[0], DAHDI_HOOK, &x);
if (!res || (errno == EINPROGRESS)) {
if (res) {
/* Wait for the event to finish */
- zt_wait_event(chan->fds[0]);
+ dahdi_wait_event(chan->fds[0]);
}
res = ast_safe_sleep(chan, 1000);
ast_verb(3, "Flashed channel %s\n", chan->name);
static char *descrip =
" GetCPEID(): Obtains and displays ADSI CPE ID and other information in order\n"
-"to properly setup zapata.conf for on-hook operations.\n";
+"to properly setup dahdi.conf for on-hook operations.\n";
static int cpeid_setstatus(struct ast_channel *chan, char *stuff[], int voice)
*/
/*** MODULEINFO
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-#include "asterisk/zapata.h"
+#include "asterisk/dahdi.h"
#include "asterisk/lock.h"
#include "asterisk/file.h"
"conference. If the conference number is omitted, the user will be prompted\n"
"to enter one. User can exit the conference by hangup, or if the 'p' option\n"
"is specified, by pressing '#'.\n"
-"Please note: The Zaptel kernel modules and at least one hardware driver (or ztdummy)\n"
-" must be present for conferencing to operate properly. In addition, the chan_zap\n"
+"Please note: The DAHDI kernel modules and at least one hardware driver (or dahdi_dummy)\n"
+" must be present for conferencing to operate properly. In addition, the chan_dahdi\n"
" channel driver must be loaded for the 'i' and 'r' options to operate at all.\n\n"
"The option string may contain zero or more of the following characters:\n"
" 'a' -- set admin mode\n"
" 'A' -- set marked mode\n"
" 'b' -- run AGI script specified in ${MEETME_AGI_BACKGROUND}\n"
" Default: conf-background.agi (Note: This does not work with\n"
-" non-Zap channels in the same conference)\n"
+" non-DAHDI channels in the same conference)\n"
" 'c' -- announce user(s) count on joining a conference\n"
" 'C' -- continue in dialplan when kicked out of conference\n"
" 'd' -- dynamically add conference\n"
struct ast_channel *chan; /*!< Announcements channel */
struct ast_channel *lchan; /*!< Listen/Record channel */
int fd; /*!< Announcements fd */
- int zapconf; /*!< Zaptel Conf # */
+ int dahdiconf; /*!< DAHDI Conf # */
int users; /*!< Number of active users */
int markedusers; /*!< Number of marked users */
int maxusers; /*!< Participant limit if scheduled */
int adminflags; /*!< Flags set by the Admin */
struct ast_channel *chan; /*!< Connected channel */
int talking; /*!< Is user talking */
- int zapchannel; /*!< Is a Zaptel channel */
+ int dahdichannel; /*!< Is a DAHDI channel */
char usrvalue[50]; /*!< Custom User Value */
char namerecloc[PATH_MAX]; /*!< Name Recorded file Location */
time_t jointime; /*!< Time the user joined the conference */
while (len) {
if (block) {
- x = ZT_IOMUX_WRITE | ZT_IOMUX_SIGEVENT;
- res = ioctl(fd, ZT_IOMUX, &x);
+ x = DAHDI_IOMUX_WRITE | DAHDI_IOMUX_SIGEVENT;
+ res = ioctl(fd, DAHDI_IOMUX, &x);
} else
res = 0;
if (res >= 0)
static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin, int make, int dynamic, int refcount, const struct ast_channel *chan)
{
struct ast_conference *cnf;
- struct zt_confinfo ztc = { 0, };
+ struct dahdi_confinfo dahdic = { 0, };
int confno_int = 0;
AST_LIST_LOCK(&confs);
ast_copy_string(cnf->pinadmin, pinadmin, sizeof(cnf->pinadmin));
ast_copy_string(cnf->uniqueid, chan->uniqueid, sizeof(cnf->uniqueid));
- /* Setup a new zap conference */
- ztc.confno = -1;
- ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
- cnf->fd = open("/dev/zap/pseudo", O_RDWR);
- if (cnf->fd < 0 || ioctl(cnf->fd, ZT_SETCONF, &ztc)) {
+ /* Setup a new dahdi conference */
+ dahdic.confno = -1;
+ dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
+ cnf->fd = open("/dev/dahdi/pseudo", O_RDWR);
+ if (cnf->fd < 0 || ioctl(cnf->fd, DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Unable to open pseudo device\n");
if (cnf->fd >= 0)
close(cnf->fd);
goto cnfout;
}
- cnf->zapconf = ztc.confno;
+ cnf->dahdiconf = dahdic.confno;
/* Setup a new channel for playback of audio files */
- cnf->chan = ast_request("zap", AST_FORMAT_SLINEAR, "pseudo", NULL);
+ cnf->chan = ast_request("DAHDI", AST_FORMAT_SLINEAR, "pseudo", NULL);
if (cnf->chan) {
ast_set_read_format(cnf->chan, AST_FORMAT_SLINEAR);
ast_set_write_format(cnf->chan, AST_FORMAT_SLINEAR);
- ztc.chan = 0;
- ztc.confno = cnf->zapconf;
- ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
- if (ioctl(cnf->chan->fds[0], ZT_SETCONF, &ztc)) {
+ dahdic.chan = 0;
+ dahdic.confno = cnf->dahdiconf;
+ dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
+ if (ioctl(cnf->chan->fds[0], DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error setting conference\n");
if (cnf->chan)
ast_hangup(cnf->chan);
cnf->start = time(NULL);
cnf->maxusers = 0x7fffffff;
cnf->isdynamic = dynamic ? 1 : 0;
- ast_verb(3, "Created MeetMe conference %d for conference '%s'\n", cnf->zapconf, cnf->confno);
+ ast_verb(3, "Created MeetMe conference %d for conference '%s'\n", cnf->dahdiconf, cnf->confno);
AST_LIST_INSERT_HEAD(&confs, cnf, list);
/* Reserve conference number in map */
}
/* flush any data sitting in the pseudo channel */
- x = ZT_FLUSH_ALL;
- if (ioctl(fd, ZT_FLUSH, &x))
+ x = DAHDI_FLUSH_ALL;
+ if (ioctl(fd, DAHDI_FLUSH, &x))
ast_log(LOG_WARNING, "Error flushing channel\n");
}
struct ast_conf_user *user = NULL;
struct ast_conf_user *usr = NULL;
int fd;
- struct zt_confinfo ztc, ztc_empty;
+ struct dahdi_confinfo dahdic, dahdic_empty;
struct ast_frame *f;
struct ast_channel *c;
struct ast_frame fr;
int nfds;
int res;
int flags;
- int retryzap;
+ int retrydahdi;
int origfd;
int musiconhold = 0;
int firstpass = 0;
char members[10] = "";
int dtmf, opt_waitmarked_timeout = 0;
time_t timeout = 0;
- ZT_BUFFERINFO bi;
+ DAHDI_BUFFERINFO bi;
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
char *buf = __buf + AST_FRIENDLY_OFFSET;
char *exitkeys = NULL;
}
ast_mutex_lock(&conf->recordthreadlock);
- if ((conf->recordthread == AST_PTHREADT_NULL) && (confflags & CONFFLAG_RECORDCONF) && ((conf->lchan = ast_request("zap", AST_FORMAT_SLINEAR, "pseudo", NULL)))) {
+ if ((conf->recordthread == AST_PTHREADT_NULL) && (confflags & CONFFLAG_RECORDCONF) && ((conf->lchan = ast_request("DAHDI", AST_FORMAT_SLINEAR, "pseudo", NULL)))) {
ast_set_read_format(conf->lchan, AST_FORMAT_SLINEAR);
ast_set_write_format(conf->lchan, AST_FORMAT_SLINEAR);
- ztc.chan = 0;
- ztc.confno = conf->zapconf;
- ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
- if (ioctl(conf->lchan->fds[0], ZT_SETCONF, &ztc)) {
+ dahdic.chan = 0;
+ dahdic.confno = conf->dahdiconf;
+ dahdic.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
+ if (ioctl(conf->lchan->fds[0], DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error starting listen channel\n");
ast_hangup(conf->lchan);
conf->lchan = NULL;
goto outrun;
}
- retryzap = (strcasecmp(chan->tech->type, "Zap") || (chan->audiohooks || chan->monitor) ? 1 : 0);
- user->zapchannel = !retryzap;
+ retrydahdi = (strcasecmp(chan->tech->type, "DAHDI") || (chan->audiohooks || chan->monitor) ? 1 : 0);
+ user->dahdichannel = !retrydahdi;
- zapretry:
+ dahdiretry:
origfd = chan->fds[0];
- if (retryzap) {
- fd = open("/dev/zap/pseudo", O_RDWR);
+ if (retrydahdi) {
+ fd = open("/dev/dahdi/pseudo", O_RDWR);
if (fd < 0) {
ast_log(LOG_WARNING, "Unable to open pseudo channel: %s\n", strerror(errno));
goto outrun;
/* Setup buffering information */
memset(&bi, 0, sizeof(bi));
bi.bufsize = CONF_SIZE / 2;
- bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
- bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
+ bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
+ bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.numbufs = audio_buffers;
- if (ioctl(fd, ZT_SET_BUFINFO, &bi)) {
+ if (ioctl(fd, DAHDI_SET_BUFINFO, &bi)) {
ast_log(LOG_WARNING, "Unable to set buffering information: %s\n", strerror(errno));
close(fd);
goto outrun;
}
x = 1;
- if (ioctl(fd, ZT_SETLINEAR, &x)) {
+ if (ioctl(fd, DAHDI_SETLINEAR, &x)) {
ast_log(LOG_WARNING, "Unable to set linear mode: %s\n", strerror(errno));
close(fd);
goto outrun;
fd = chan->fds[0];
nfds = 0;
}
- memset(&ztc, 0, sizeof(ztc));
- memset(&ztc_empty, 0, sizeof(ztc_empty));
+ memset(&dahdic, 0, sizeof(dahdic));
+ memset(&dahdic_empty, 0, sizeof(dahdic_empty));
/* Check to see if we're in a conference... */
- ztc.chan = 0;
- if (ioctl(fd, ZT_GETCONF, &ztc)) {
+ dahdic.chan = 0;
+ if (ioctl(fd, DAHDI_GETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error getting conference\n");
close(fd);
goto outrun;
}
- if (ztc.confmode) {
+ if (dahdic.confmode) {
/* Whoa, already in a conference... Retry... */
- if (!retryzap) {
- ast_debug(1, "Zap channel is in a conference already, retrying with pseudo\n");
- retryzap = 1;
- goto zapretry;
+ if (!retrydahdi) {
+ ast_debug(1, "DAHDI channel is in a conference already, retrying with pseudo\n");
+ retrydahdi = 1;
+ goto dahdiretry;
}
}
- memset(&ztc, 0, sizeof(ztc));
+ memset(&dahdic, 0, sizeof(dahdic));
/* Add us to the conference */
- ztc.chan = 0;
- ztc.confno = conf->zapconf;
+ dahdic.chan = 0;
+ dahdic.confno = conf->dahdiconf;
ast_mutex_lock(&conf->playlock);
}
if (confflags & CONFFLAG_WAITMARKED && !conf->markedusers)
- ztc.confmode = ZT_CONF_CONF;
+ dahdic.confmode = DAHDI_CONF_CONF;
else if (confflags & CONFFLAG_MONITOR)
- ztc.confmode = ZT_CONF_CONFMON | ZT_CONF_LISTENER;
+ dahdic.confmode = DAHDI_CONF_CONFMON | DAHDI_CONF_LISTENER;
else if (confflags & CONFFLAG_TALKER)
- ztc.confmode = ZT_CONF_CONF | ZT_CONF_TALKER;
+ dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER;
else
- ztc.confmode = ZT_CONF_CONF | ZT_CONF_TALKER | ZT_CONF_LISTENER;
+ dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
ast_mutex_unlock(&conf->playlock);
goto outrun;
}
- ast_debug(1, "Placed channel %s in ZAP conf %d\n", chan->name, conf->zapconf);
+ ast_debug(1, "Placed channel %s in ZAP conf %d\n", chan->name, conf->dahdiconf);
if (!sent_event) {
manager_event(EVENT_FLAG_CALL, "MeetmeJoin",
}
ast_channel_unlock(chan);
- if (user->zapchannel) {
- /* Set CONFMUTE mode on Zap channel to mute DTMF tones */
+ if (user->dahdichannel) {
+ /* Set CONFMUTE mode on DAHDI channel to mute DTMF tones */
x = 1;
ast_channel_setoption(chan, AST_OPTION_TONE_VERIFY, &x, sizeof(char), 0);
}
ast_log(LOG_WARNING, "Could not find application (agi)\n");
ret = -2;
}
- if (user->zapchannel) {
- /* Remove CONFMUTE mode on Zap channel */
+ if (user->dahdichannel) {
+ /* Remove CONFMUTE mode on DAHDI channel */
x = 0;
ast_channel_setoption(chan, AST_OPTION_TONE_VERIFY, &x, sizeof(char), 0);
}
} else {
- if (user->zapchannel && (confflags & CONFFLAG_STARMENU)) {
- /* Set CONFMUTE mode on Zap channel to mute DTMF tones when the menu is enabled */
+ if (user->dahdichannel && (confflags & CONFFLAG_STARMENU)) {
+ /* Set CONFMUTE mode on DAHDI channel to mute DTMF tones when the menu is enabled */
x = 1;
ast_channel_setoption(chan, AST_OPTION_TONE_VERIFY, &x, sizeof(char), 0);
}
ret = 0;
break;
} else {
- ztc.confmode = ZT_CONF_CONF;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ dahdic.confmode = DAHDI_CONF_CONF;
+ if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
goto outrun;
/* Marked user entered, so cancel timeout */
timeout = 0;
if (confflags & CONFFLAG_MONITOR)
- ztc.confmode = ZT_CONF_CONFMON | ZT_CONF_LISTENER;
+ dahdic.confmode = DAHDI_CONF_CONFMON | DAHDI_CONF_LISTENER;
else if (confflags & CONFFLAG_TALKER)
- ztc.confmode = ZT_CONF_CONF | ZT_CONF_TALKER;
+ dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER;
else
- ztc.confmode = ZT_CONF_CONF | ZT_CONF_TALKER | ZT_CONF_LISTENER;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ dahdic.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
+ if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
goto outrun;
/* Check if my modes have changed */
/* If I should be muted but am still talker, mute me */
- if ((user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && (ztc.confmode & ZT_CONF_TALKER)) {
- ztc.confmode ^= ZT_CONF_TALKER;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ if ((user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && (dahdic.confmode & DAHDI_CONF_TALKER)) {
+ dahdic.confmode ^= DAHDI_CONF_TALKER;
+ if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error setting conference - Un/Mute \n");
ret = -1;
break;
}
/* If I should be un-muted but am not talker, un-mute me */
- if (!(user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && !(confflags & CONFFLAG_MONITOR) && !(ztc.confmode & ZT_CONF_TALKER)) {
- ztc.confmode |= ZT_CONF_TALKER;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ if (!(user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && !(confflags & CONFFLAG_MONITOR) && !(dahdic.confmode & DAHDI_CONF_TALKER)) {
+ dahdic.confmode |= DAHDI_CONF_TALKER;
+ if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error setting conference - Un/Mute \n");
ret = -1;
break;
if (c) {
char dtmfstr[2] = "";
- if (c->fds[0] != origfd || (user->zapchannel && (c->audiohooks || c->monitor))) {
+ if (c->fds[0] != origfd || (user->dahdichannel && (c->audiohooks || c->monitor))) {
if (using_pseudo) {
/* Kill old pseudo */
close(fd);
using_pseudo = 0;
}
ast_debug(1, "Ooh, something swapped out under us, starting over\n");
- retryzap = (strcasecmp(c->tech->type, "Zap") || (c->audiohooks || c->monitor) ? 1 : 0);
- user->zapchannel = !retryzap;
- goto zapretry;
+ retrydahdi = (strcasecmp(c->tech->type, "DAHDI") || (c->audiohooks || c->monitor) ? 1 : 0);
+ user->dahdichannel = !retrydahdi;
+ goto dahdiretry;
}
if ((confflags & CONFFLAG_MONITOR) || (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)))
f = ast_read_noaudio(c);
} else if (((f->frametype == AST_FRAME_DTMF) && (f->subclass == '*') && (confflags & CONFFLAG_STARMENU)) || ((f->frametype == AST_FRAME_DTMF) && menu_active)) {
if (confflags & CONFFLAG_PASS_DTMF)
conf_queue_dtmf(conf, user, f);
- if (ioctl(fd, ZT_SETCONF, &ztc_empty)) {
+ if (ioctl(fd, DAHDI_SETCONF, &dahdic_empty)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
ast_frfree(f);
if (musiconhold)
conf_start_moh(chan, optargs[OPT_ARG_MOH_CLASS]);
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
ast_frfree(f);
close(fd);
else {
/* Take out of conference */
- ztc.chan = 0;
- ztc.confno = 0;
- ztc.confmode = 0;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ dahdic.chan = 0;
+ dahdic.confno = 0;
+ dahdic.confmode = 0;
+ if (ioctl(fd, DAHDI_SETCONF, &dahdic)) {
ast_log(LOG_WARNING, "Error setting conference\n");
}
}
if (confflags && !cnf->chan &&
!ast_test_flag(confflags, CONFFLAG_QUIET) &&
ast_test_flag(confflags, CONFFLAG_INTROUSER)) {
- ast_log(LOG_WARNING, "No Zap channel available for conference, user introduction disabled (is chan_zap loaded?)\n");
+ ast_log(LOG_WARNING, "No DAHDI channel available for conference, user introduction disabled (is chan_dahdi loaded?)\n");
ast_clear_flag(confflags, CONFFLAG_INTROUSER);
}
if (confflags && !cnf->chan &&
ast_test_flag(confflags, CONFFLAG_RECORDCONF)) {
- ast_log(LOG_WARNING, "No Zap channel available for conference, conference recording disabled (is chan_zap loaded?)\n");
+ ast_log(LOG_WARNING, "No DAHDI channel available for conference, conference recording disabled (is chan_dahdi loaded?)\n");
ast_clear_flag(confflags, CONFFLAG_RECORDCONF);
}
}
if (confflags && !cnf->chan &&
!ast_test_flag(confflags, CONFFLAG_QUIET) &&
ast_test_flag(confflags, CONFFLAG_INTROUSER)) {
- ast_log(LOG_WARNING, "No Zap channel available for conference, user introduction disabled (is chan_zap loaded?)\n");
+ ast_log(LOG_WARNING, "No DAHDI channel available for conference, user introduction disabled (is chan_dahdi loaded?)\n");
ast_clear_flag(confflags, CONFFLAG_INTROUSER);
}
if (confflags && !cnf->chan &&
ast_test_flag(confflags, CONFFLAG_RECORDCONF)) {
- ast_log(LOG_WARNING, "No Zap channel available for conference, conference recording disabled (is chan_zap loaded?)\n");
+ ast_log(LOG_WARNING, "No DAHDI channel available for conference, conference recording disabled (is chan_dahdi loaded?)\n");
ast_clear_flag(confflags, CONFFLAG_RECORDCONF);
}
}
if ((sscanf(val, "%d", &audio_buffers) != 1)) {
ast_log(LOG_WARNING, "audiobuffers setting must be a number, not '%s'\n", val);
audio_buffers = DEFAULT_AUDIO_BUFFERS;
- } else if ((audio_buffers < ZT_DEFAULT_NUM_BUFS) || (audio_buffers > ZT_MAX_NUM_BUFS)) {
+ } else if ((audio_buffers < DAHDI_DEFAULT_NUM_BUFS) || (audio_buffers > DAHDI_MAX_NUM_BUFS)) {
ast_log(LOG_WARNING, "audiobuffers setting must be between %d and %d\n",
- ZT_DEFAULT_NUM_BUFS, ZT_MAX_NUM_BUFS);
+ DAHDI_DEFAULT_NUM_BUFS, DAHDI_MAX_NUM_BUFS);
audio_buffers = DEFAULT_AUDIO_BUFFERS;
}
if (audio_buffers != DEFAULT_AUDIO_BUFFERS)
*/
/*** MODULEINFO
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
<depend>app_meetme</depend>
***/
static void update_realtime_members(struct call_queue *q);
static int set_member_paused(const char *queuename, const char *interface, const char *reason, int paused);
-static void queue_transfer_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan);
/*! \brief sets the QUEUESTATUS channel variable */
static void set_queue_result(struct ast_channel *chan, enum queue_result res)
{
qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, vars_len) : "");
}
-struct queue_transfer_ds {
- struct queue_ent *qe;
- struct member *member;
- int starttime;
-};
-
-/*! \brief a datastore used to help correctly log attended transfers of queue callers
- */
-static const struct ast_datastore_info queue_transfer_info = {
- .type = "queue_transfer",
- .chan_fixup = queue_transfer_fixup,
-};
-
-/*! \brief Log an attended transfer when a queue caller channel is masqueraded
- *
- * When a caller is masqueraded, we want to log a transfer. Fixup time is the closest we can come to when
- * the actual transfer occurs. This happens during the masquerade after datastores are moved from old_chan
- * to new_chan. This is why new_chan is referenced for exten, context, and datastore information.
- *
- * At the end of this, we want to remove the datastore so that this fixup function is not called on any
- * future masquerades of the caller during the current call.
- */
-static void queue_transfer_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
-{
- struct queue_transfer_ds *qtds = data;
- struct queue_ent *qe = qtds->qe;
- struct member *member = qtds->member;
- int callstart = qtds->starttime;
- struct ast_datastore *datastore;
-
- ast_queue_log(qe->parent->name, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%ld|%ld",
- new_chan->exten, new_chan->context, (long) (callstart - qe->start),
- (long) (time(NULL) - callstart));
-
- if (!(datastore = ast_channel_datastore_find(new_chan, &queue_transfer_info, NULL))) {
- ast_log(LOG_WARNING, "Can't find the queue_transfer datastore.\n");
- return;
- }
-
- ast_channel_datastore_remove(new_chan, datastore);
-}
-
-/*! \brief mechanism to tell if a queue caller was atxferred by a queue member.
- *
- * When a caller is atxferred, then the queue_transfer_info datastore
- * is removed from the channel. If it's still there after the bridge is
- * broken, then the caller was not atxferred.
- */
-static int attended_transfer_occurred(struct ast_channel *chan)
-{
- return ast_channel_datastore_find(chan, &queue_transfer_info, NULL) ? 0 : 1;
-}
-
-/*! \brief create a datastore for storing relevant info to log attended transfers in the queue_log
- */
-static void setup_transfer_datastore(struct queue_ent *qe, struct member *member, int starttime)
-{
- struct ast_datastore *ds;
- struct queue_transfer_ds qtds;
-
- ast_channel_lock(qe->chan);
- if (!(ds = ast_channel_datastore_alloc(&queue_transfer_info, NULL))) {
- ast_channel_unlock(qe->chan);
- ast_log(LOG_WARNING, "Unable to create transfer datastore. queue_log will not show attended transfer\n");
- return;
- }
-
- qtds.qe = qe;
- /* This member is refcounted in try_calling, so no need to add it here, too */
- qtds.member = member;
- qtds.starttime = starttime;
- ds->data = &qtds;
- ast_channel_datastore_add(qe->chan, ds);
- ast_channel_unlock(qe->chan);
-}
-
/*! \brief A large function which calls members, updates statistics, and bridges the caller and a member
*
* Here is the process of this function
/* Ah ha! Someone answered within the desired timeframe. Of course after this
we will always return with -1 so that it is hung up properly after the
conversation. */
- if (!strcmp(qe->chan->tech->type, "Zap"))
+ if (!strcmp(qe->chan->tech->type, "DAHDI"))
ast_channel_setoption(qe->chan, AST_OPTION_TONE_VERIFY, &nondataquality, sizeof(nondataquality), 0);
- if (!strcmp(peer->tech->type, "Zap"))
+ if (!strcmp(peer->tech->type, "DAHDI"))
ast_channel_setoption(peer, AST_OPTION_TONE_VERIFY, &nondataquality, sizeof(nondataquality), 0);
/* Update parameters for the queue */
time(&now);
ast_copy_string(oldcontext, qe->chan->context, sizeof(oldcontext));
ast_copy_string(oldexten, qe->chan->exten, sizeof(oldexten));
time(&callstart);
- setup_transfer_datastore(qe, member, callstart);
+
bridge = ast_bridge_call(qe->chan,peer, &bridge_config);
- /* If the queue member did an attended transfer, then the TRANSFER already was logged in the queue_log
- * when the masquerade occurred. These other "ending" queue_log messages are unnecessary
- */
- if (!attended_transfer_occurred(qe->chan)) {
- if (strcasecmp(oldcontext, qe->chan->context) || strcasecmp(oldexten, qe->chan->exten)) {
- ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%ld|%ld",
- qe->chan->exten, qe->chan->context, (long) (callstart - qe->start),
- (long) (time(NULL) - callstart));
- send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), TRANSFER);
- } else if (ast_check_hangup(qe->chan)) {
- ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETECALLER", "%ld|%ld|%d",
- (long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos);
- send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), CALLER);
- } else {
- ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETEAGENT", "%ld|%ld|%d",
- (long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos);
- send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), AGENT);
- }
+ if (strcasecmp(oldcontext, qe->chan->context) || strcasecmp(oldexten, qe->chan->exten)) {
+ ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%ld|%ld",
+ qe->chan->exten, qe->chan->context, (long) (callstart - qe->start),
+ (long) (time(NULL) - callstart));
+ send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), TRANSFER);
+ } else if (ast_check_hangup(qe->chan)) {
+ ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETECALLER", "%ld|%ld|%d",
+ (long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos);
+ send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), CALLER);
+ } else {
+ ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETEAGENT", "%ld|%ld|%d",
+ (long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos);
+ send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), AGENT);
}
if (bridge != AST_PBX_NO_HANGUP_PEER)
*/
/*** MODULEINFO
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
<depend>tonezone</depend>
<defaultenabled>no</defaultenabled>
***/
int parrottimer;
unsigned int parrotcnt;
struct ast_channel *rxchannel,*txchannel, *monchannel, *parrotchannel;
- struct ast_channel *pchannel,*txpchannel, *zaprxchannel, *zaptxchannel;
+ struct ast_channel *pchannel,*txpchannel, *dahdirxchannel, *dahditxchannel;
struct ast_channel *voxchannel;
struct ast_frame *lastf1,*lastf2;
struct rpt_tele tele;
ast_stopstream(chan);
/*
- * Wait for the zaptel driver to physically write the tone blocks to the hardware
+ * Wait for the DAHDI driver to physically write the tone blocks to the hardware
*/
for(i = 0; i < 20 ; i++){
- flags = ZT_IOMUX_WRITEEMPTY | ZT_IOMUX_NOWAIT;
- res = ioctl(chan->fds[0], ZT_IOMUX, &flags);
- if(flags & ZT_IOMUX_WRITEEMPTY)
+ flags = DAHDI_IOMUX_WRITEEMPTY | DAHDI_IOMUX_NOWAIT;
+ res = ioctl(chan->fds[0], DAHDI_IOMUX, &flags);
+ if(flags & DAHDI_IOMUX_WRITEEMPTY)
break;
if( ast_safe_sleep(chan, 50)){
res = -1;
ast_stopstream(chan);
/*
- * Wait for the zaptel driver to physically write the tone blocks to the hardware
+ * Wait for the DAHDI driver to physically write the tone blocks to the hardware
*/
for(i = 0; i < 20 ; i++){
- flags = ZT_IOMUX_WRITEEMPTY | ZT_IOMUX_NOWAIT;
- res = ioctl(chan->fds[0], ZT_IOMUX, &flags);
- if(flags & ZT_IOMUX_WRITEEMPTY)
+ flags = DAHDI_IOMUX_WRITEEMPTY | DAHDI_IOMUX_NOWAIT;
+ res = ioctl(chan->fds[0], DAHDI_IOMUX, &flags);
+ if(flags & DAHDI_IOMUX_WRITEEMPTY)
break;
if( ast_safe_sleep(chan, 50)){
res = -1;
static void *rpt_tele_thread(void *this)
{
-ZT_CONFINFO ci; /* conference info */
+DAHDI_CONFINFO ci; /* conference info */
int res = 0,haslink,hastx,hasremote,imdone = 0, unkeys_queued, x;
struct rpt_tele *mytele = (struct rpt_tele *)this;
struct rpt_tele *tlist;
char mhz[MAXREMSTR];
char decimals[MAXREMSTR];
char mystr[200];
-struct zt_params par;
+struct dahdi_params par;
/* get a pointer to myrpt */
/* allocate a pseudo-channel thru asterisk */
- mychannel = ast_request("zap",AST_FORMAT_SLINEAR,"pseudo",NULL);
+ mychannel = ast_request("DAHDI",AST_FORMAT_SLINEAR,"pseudo",NULL);
if (!mychannel)
{
fprintf(stderr,"rpt:Sorry unable to obtain pseudo channel\n");
(mytele->mode == TAILMSG) || (mytele->mode == LINKUNKEY) || (mytele->mode == TIMEOUT) ||
(mytele->mode == PARROT) || (mytele->mode == STATS_TIME_LOCAL)) ?
myrpt->txconf : myrpt->conf);
- ci.confmode = ZT_CONF_CONFANN;
+ ci.confmode = DAHDI_CONF_CONFANN;
/* first put the channel on the conference in announce mode */
- if (ioctl(mychannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(mychannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
rpt_mutex_lock(&myrpt->lock);
/* set for all to hear */
ci.chan = 0;
ci.confno = myrpt->conf;
- ci.confmode = ZT_CONF_CONFANN;
+ ci.confmode = DAHDI_CONF_CONFANN;
/* first put the channel on the conference in announce mode */
- if (ioctl(mychannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(mychannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
rpt_mutex_lock(&myrpt->lock);
/* set for all to hear */
ci.chan = 0;
ci.confno = myrpt->txconf;
- ci.confmode = ZT_CONF_CONFANN;
+ ci.confmode = DAHDI_CONF_CONFANN;
/* first put the channel on the conference in announce mode */
- if (ioctl(mychannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(mychannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
rpt_mutex_lock(&myrpt->lock);
}
if (myrpt->iofd < 0)
{
- i = ZT_FLUSH_EVENT;
- if (ioctl(myrpt->zaptxchannel->fds[0],ZT_FLUSH,&i) == -1)
+ i = DAHDI_FLUSH_EVENT;
+ if (ioctl(myrpt->dahditxchannel->fds[0],DAHDI_FLUSH,&i) == -1)
{
ast_mutex_unlock(&myrpt->remlock);
ast_log(LOG_ERROR,"Cant flush events");
res = -1;
break;
}
- if (ioctl(myrpt->zaprxchannel->fds[0],ZT_GET_PARAMS,&par) == -1)
+ if (ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_GET_PARAMS,&par) == -1)
{
ast_mutex_unlock(&myrpt->remlock);
ast_log(LOG_ERROR,"Cant get params");
static void *rpt_call(void *this)
{
-ZT_CONFINFO ci; /* conference info */
+DAHDI_CONFINFO ci; /* conference info */
struct rpt *myrpt = (struct rpt *)this;
int res;
int stopped,congstarted,dialtimer,lastcidx,aborted;
myrpt->mydtmf = 0;
/* allocate a pseudo-channel thru asterisk */
- mychannel = ast_request("zap",AST_FORMAT_SLINEAR,"pseudo",NULL);
+ mychannel = ast_request("DAHDI",AST_FORMAT_SLINEAR,"pseudo",NULL);
if (!mychannel)
{
fprintf(stderr,"rpt:Sorry unable to obtain pseudo channel\n");
ci.chan = 0;
ci.confno = myrpt->conf; /* use the pseudo conference */
#if 0
- ci.confmode = ZT_CONF_REALANDPSEUDO | ZT_CONF_TALKER | ZT_CONF_LISTENER
- | ZT_CONF_PSEUDO_TALKER | ZT_CONF_PSEUDO_LISTENER;
+ ci.confmode = DAHDI_CONF_REALANDPSEUDO | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER
+ | DAHDI_CONF_PSEUDO_TALKER | DAHDI_CONF_PSEUDO_LISTENER;
#endif
- ci.confmode = ZT_CONF_CONF | ZT_CONF_TALKER | ZT_CONF_LISTENER;
+ ci.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
/* first put the channel on the conference */
- if (ioctl(mychannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(mychannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
ast_hangup(mychannel);
pthread_exit(NULL);
}
/* allocate a pseudo-channel thru asterisk */
- genchannel = ast_request("zap",AST_FORMAT_SLINEAR,"pseudo",NULL);
+ genchannel = ast_request("DAHDI",AST_FORMAT_SLINEAR,"pseudo",NULL);
if (!genchannel)
{
fprintf(stderr,"rpt:Sorry unable to obtain pseudo channel\n");
#endif
ci.chan = 0;
ci.confno = myrpt->conf;
- ci.confmode = ZT_CONF_REALANDPSEUDO | ZT_CONF_TALKER | ZT_CONF_LISTENER
- | ZT_CONF_PSEUDO_TALKER | ZT_CONF_PSEUDO_LISTENER;
+ ci.confmode = DAHDI_CONF_REALANDPSEUDO | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER
+ | DAHDI_CONF_PSEUDO_TALKER | DAHDI_CONF_PSEUDO_LISTENER;
/* first put the channel on the conference */
- if (ioctl(genchannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(genchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
ast_hangup(mychannel);
pthread_exit(NULL);
}
/* start dialtone if patchquiet is 0. Special patch modes don't send dial tone */
- if ((!myrpt->patchquiet) && (tone_zone_play_tone(genchannel->fds[0],ZT_TONE_DIALTONE) < 0))
+ if ((!myrpt->patchquiet) && (tone_zone_play_tone(genchannel->fds[0],DAHDI_TONE_DIALTONE) < 0))
{
ast_log(LOG_WARNING, "Cannot start dialtone\n");
ast_hangup(mychannel);
if(!congstarted){
congstarted = 1;
/* start congestion tone */
- tone_zone_play_tone(genchannel->fds[0],ZT_TONE_CONGESTION);
+ tone_zone_play_tone(genchannel->fds[0],DAHDI_TONE_CONGESTION);
}
}
res = ast_safe_sleep(mychannel, MSWAIT);
/* set appropriate conference for the pseudo */
ci.chan = 0;
ci.confno = myrpt->conf;
- ci.confmode = (myrpt->p.duplex == 2) ? ZT_CONF_CONFANNMON :
- (ZT_CONF_CONF | ZT_CONF_LISTENER | ZT_CONF_TALKER);
+ ci.confmode = (myrpt->p.duplex == 2) ? DAHDI_CONF_CONFANNMON :
+ (DAHDI_CONF_CONF | DAHDI_CONF_LISTENER | DAHDI_CONF_TALKER);
/* first put the channel on the conference in announce mode */
- if (ioctl(myrpt->pchannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(myrpt->pchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
ast_hangup(mychannel);
pthread_exit(NULL);
}
/* get its channel number */
- if (ioctl(mychannel->fds[0],ZT_CHANNO,&res) == -1)
+ if (ioctl(mychannel->fds[0],DAHDI_CHANNO,&res) == -1)
{
ast_log(LOG_WARNING, "Unable to get autopatch channel number\n");
ast_hangup(mychannel);
}
ci.chan = 0;
ci.confno = res;
- ci.confmode = ZT_CONF_MONITOR;
+ ci.confmode = DAHDI_CONF_MONITOR;
/* put vox channel monitoring on the channel */
- if (ioctl(myrpt->voxchannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(myrpt->voxchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
ast_hangup(mychannel);
myrpt->callmode = 4;
rpt_mutex_unlock(&myrpt->lock);
/* start congestion tone */
- tone_zone_play_tone(genchannel->fds[0],ZT_TONE_CONGESTION);
+ tone_zone_play_tone(genchannel->fds[0],DAHDI_TONE_CONGESTION);
rpt_mutex_lock(&myrpt->lock);
}
}
/* set appropriate conference for the pseudo */
ci.chan = 0;
ci.confno = myrpt->conf;
- ci.confmode = ((myrpt->p.duplex == 2) || (myrpt->p.duplex == 4)) ? ZT_CONF_CONFANNMON :
- (ZT_CONF_CONF | ZT_CONF_LISTENER | ZT_CONF_TALKER);
+ ci.confmode = ((myrpt->p.duplex == 2) || (myrpt->p.duplex == 4)) ? DAHDI_CONF_CONFANNMON :
+ (DAHDI_CONF_CONF | DAHDI_CONF_LISTENER | DAHDI_CONF_TALKER);
/* first put the channel on the conference in announce mode */
- if (ioctl(myrpt->pchannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(myrpt->pchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
}
struct rpt_link *l;
int reconnects = 0;
int i,n;
- ZT_CONFINFO ci; /* conference info */
+ DAHDI_CONFINFO ci; /* conference info */
val = node_lookup(myrpt,node);
if (!val){
return -1;
}
/* allocate a pseudo-channel thru asterisk */
- l->pchan = ast_request("zap",AST_FORMAT_SLINEAR,"pseudo",NULL);
+ l->pchan = ast_request("DAHDI",AST_FORMAT_SLINEAR,"pseudo",NULL);
if (!l->pchan){
ast_log(LOG_WARNING,"rpt connect: Sorry unable to obtain pseudo channel\n");
ast_hangup(l->chan);
/* make a conference for the tx */
ci.chan = 0;
ci.confno = myrpt->conf;
- ci.confmode = ZT_CONF_CONF | ZT_CONF_LISTENER | ZT_CONF_TALKER;
+ ci.confmode = DAHDI_CONF_CONF | DAHDI_CONF_LISTENER | DAHDI_CONF_TALKER;
/* first put the channel on the conference in proper mode */
- if (ioctl(l->pchan->fds[0], ZT_SETCONF, &ci) == -1)
+ if (ioctl(l->pchan->fds[0], DAHDI_SETCONF, &ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
ast_hangup(l->chan);
static void rbi_out(struct rpt *myrpt,unsigned char *data)
{
-struct zt_radio_param r;
+struct dahdi_radio_param r;
- memset(&r,0,sizeof(struct zt_radio_param));
- r.radpar = ZT_RADPAR_REMMODE;
- r.data = ZT_RADPAR_REM_RBI1;
+ memset(&r,0,sizeof(struct dahdi_radio_param));
+ r.radpar = DAHDI_RADPAR_REMMODE;
+ r.data = DAHDI_RADPAR_REM_RBI1;
/* if setparam ioctl fails, its probably not a pciradio card */
- if (ioctl(myrpt->zaprxchannel->fds[0],ZT_RADIO_SETPARAM,&r) == -1)
+ if (ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_RADIO_SETPARAM,&r) == -1)
{
rbi_out_parallel(myrpt,data);
return;
}
- r.radpar = ZT_RADPAR_REMCOMMAND;
+ r.radpar = DAHDI_RADPAR_REMCOMMAND;
memcpy(&r.data,data,5);
- if (ioctl(myrpt->zaprxchannel->fds[0],ZT_RADIO_SETPARAM,&r) == -1)
+ if (ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_RADIO_SETPARAM,&r) == -1)
{
- ast_log(LOG_WARNING,"Cannot send RBI command for channel %s\n",myrpt->zaprxchannel->name);
+ ast_log(LOG_WARNING,"Cannot send RBI command for channel %s\n",myrpt->dahdirxchannel->name);
return;
}
}
unsigned char *rxbuf, int rxmaxbytes, int asciiflag)
{
int i,j,index,oldmode,olddata;
- struct zt_radio_param prm;
+ struct dahdi_radio_param prm;
char c;
if(debug) {
return(i);
}
- /* if not a zap channel, cant use pciradio stuff */
- if (myrpt->rxchannel != myrpt->zaprxchannel) return -1;
+ /* if not a DAHDI channel, cant use pciradio stuff */
+ if (myrpt->rxchannel != myrpt->dahdirxchannel) return -1;
- prm.radpar = ZT_RADPAR_UIOMODE;
- if (ioctl(myrpt->zaprxchannel->fds[0],ZT_RADIO_GETPARAM,&prm) == -1) return -1;
+ prm.radpar = DAHDI_RADPAR_UIOMODE;
+ if (ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_RADIO_GETPARAM,&prm) == -1) return -1;
oldmode = prm.data;
- prm.radpar = ZT_RADPAR_UIODATA;
- if (ioctl(myrpt->zaprxchannel->fds[0],ZT_RADIO_GETPARAM,&prm) == -1) return -1;
+ prm.radpar = DAHDI_RADPAR_UIODATA;
+ if (ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_RADIO_GETPARAM,&prm) == -1) return -1;
olddata = prm.data;
- prm.radpar = ZT_RADPAR_REMMODE;
- if (asciiflag & 1) prm.data = ZT_RADPAR_REM_SERIAL_ASCII;
- else prm.data = ZT_RADPAR_REM_SERIAL;
- if (ioctl(myrpt->zaprxchannel->fds[0],ZT_RADIO_SETPARAM,&prm) == -1) return -1;
+ prm.radpar = DAHDI_RADPAR_REMMODE;
+ if (asciiflag & 1) prm.data = DAHDI_RADPAR_REM_SERIAL_ASCII;
+ else prm.data = DAHDI_RADPAR_REM_SERIAL;
+ if (ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_RADIO_SETPARAM,&prm) == -1) return -1;
if (asciiflag & 2)
{
- i = ZT_ONHOOK;
- if (ioctl(myrpt->zaprxchannel->fds[0],ZT_HOOK,&i) == -1) return -1;
+ i = DAHDI_ONHOOK;
+ if (ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_HOOK,&i) == -1) return -1;
usleep(100000);
}
- prm.radpar = ZT_RADPAR_REMCOMMAND;
+ prm.radpar = DAHDI_RADPAR_REMCOMMAND;
prm.data = rxmaxbytes;
memcpy(prm.buf,txbuf,txbytes);
prm.index = txbytes;
- if (ioctl(myrpt->zaprxchannel->fds[0],ZT_RADIO_SETPARAM,&prm) == -1) return -1;
+ if (ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_RADIO_SETPARAM,&prm) == -1) return -1;
if (rxbuf)
{
*rxbuf = 0;
memcpy(rxbuf,prm.buf,prm.index);
}
index = prm.index;
- prm.radpar = ZT_RADPAR_REMMODE;
- prm.data = ZT_RADPAR_REM_NONE;
- if (ioctl(myrpt->zaprxchannel->fds[0],ZT_RADIO_SETPARAM,&prm) == -1) return -1;
+ prm.radpar = DAHDI_RADPAR_REMMODE;
+ prm.data = DAHDI_RADPAR_REM_NONE;
+ if (ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_RADIO_SETPARAM,&prm) == -1) return -1;
if (asciiflag & 2)
{
- i = ZT_OFFHOOK;
- if (ioctl(myrpt->zaprxchannel->fds[0],ZT_HOOK,&i) == -1) return -1;
+ i = DAHDI_OFFHOOK;
+ if (ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_HOOK,&i) == -1) return -1;
}
- prm.radpar = ZT_RADPAR_UIOMODE;
+ prm.radpar = DAHDI_RADPAR_UIOMODE;
prm.data = oldmode;
- if (ioctl(myrpt->zaprxchannel->fds[0],ZT_RADIO_SETPARAM,&prm) == -1) return -1;
- prm.radpar = ZT_RADPAR_UIODATA;
+ if (ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_RADIO_SETPARAM,&prm) == -1) return -1;
+ prm.radpar = DAHDI_RADPAR_UIODATA;
prm.data = olddata;
- if (ioctl(myrpt->zaprxchannel->fds[0],ZT_RADIO_SETPARAM,&prm) == -1) return -1;
+ if (ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_RADIO_SETPARAM,&prm) == -1) return -1;
return(index);
}
int ms = MSWAIT,i,lasttx=0,val,remrx=0,identqueued,othertelemqueued;
int tailmessagequeued,ctqueued,dtmfed,lastmyrx,localmsgqueued;
struct ast_channel *who;
-ZT_CONFINFO ci; /* conference info */
+DAHDI_CONFINFO ci; /* conference info */
time_t t;
struct rpt_link *l,*m;
struct rpt_tele *telem;
}
*tele++ = 0;
myrpt->rxchannel = ast_request(tmpstr,AST_FORMAT_SLINEAR,tele,NULL);
- myrpt->zaprxchannel = NULL;
- if (!strcasecmp(tmpstr,"Zap"))
- myrpt->zaprxchannel = myrpt->rxchannel;
+ myrpt->dahdirxchannel = NULL;
+ if (!strcasecmp(tmpstr,"DAHDI"))
+ myrpt->dahdirxchannel = myrpt->rxchannel;
if (myrpt->rxchannel)
{
if (myrpt->rxchannel->_state == AST_STATE_BUSY)
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
- myrpt->zaptxchannel = NULL;
+ myrpt->dahditxchannel = NULL;
if (myrpt->txchanname)
{
strncpy(tmpstr,myrpt->txchanname,sizeof(tmpstr) - 1);
}
*tele++ = 0;
myrpt->txchannel = ast_request(tmpstr,AST_FORMAT_SLINEAR,tele,NULL);
- if (!strcasecmp(tmpstr,"Zap"))
- myrpt->zaptxchannel = myrpt->txchannel;
+ if (!strcasecmp(tmpstr,"DAHDI"))
+ myrpt->dahditxchannel = myrpt->txchannel;
if (myrpt->txchannel)
{
if (myrpt->txchannel->_state == AST_STATE_BUSY)
else
{
myrpt->txchannel = myrpt->rxchannel;
- if (!strncasecmp(myrpt->rxchanname,"Zap",3))
- myrpt->zaptxchannel = myrpt->txchannel;
+ if (!strncasecmp(myrpt->rxchanname,"DAHDI",3))
+ myrpt->dahditxchannel = myrpt->txchannel;
}
ast_indicate(myrpt->txchannel,AST_CONTROL_RADIO_KEY);
ast_indicate(myrpt->txchannel,AST_CONTROL_RADIO_UNKEY);
/* allocate a pseudo-channel thru asterisk */
- myrpt->pchannel = ast_request("zap",AST_FORMAT_SLINEAR,"pseudo",NULL);
+ myrpt->pchannel = ast_request("DAHDI",AST_FORMAT_SLINEAR,"pseudo",NULL);
if (!myrpt->pchannel)
{
fprintf(stderr,"rpt:Sorry unable to obtain pseudo channel\n");
if (myrpt->pchannel->cdr)
ast_set_flag(myrpt->pchannel->cdr,AST_CDR_FLAG_POST_DISABLED);
#endif
- if (!myrpt->zaprxchannel) myrpt->zaprxchannel = myrpt->pchannel;
- if (!myrpt->zaptxchannel)
+ if (!myrpt->dahdirxchannel) myrpt->dahdirxchannel = myrpt->pchannel;
+ if (!myrpt->dahditxchannel)
{
/* allocate a pseudo-channel thru asterisk */
- myrpt->zaptxchannel = ast_request("zap",AST_FORMAT_SLINEAR,"pseudo",NULL);
- if (!myrpt->zaptxchannel)
+ myrpt->dahditxchannel = ast_request("DAHDI",AST_FORMAT_SLINEAR,"pseudo",NULL);
+ if (!myrpt->dahditxchannel)
{
fprintf(stderr,"rpt:Sorry unable to obtain pseudo channel\n");
rpt_mutex_unlock(&myrpt->lock);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
- ast_set_read_format(myrpt->zaptxchannel,AST_FORMAT_SLINEAR);
- ast_set_write_format(myrpt->zaptxchannel,AST_FORMAT_SLINEAR);
+ ast_set_read_format(myrpt->dahditxchannel,AST_FORMAT_SLINEAR);
+ ast_set_write_format(myrpt->dahditxchannel,AST_FORMAT_SLINEAR);
#ifdef AST_CDR_FLAG_POST_DISABLED
- if (myrpt->zaptxchannel->cdr)
- ast_set_flag(myrpt->zaptxchannel->cdr,AST_CDR_FLAG_POST_DISABLED);
+ if (myrpt->dahditxchannel->cdr)
+ ast_set_flag(myrpt->dahditxchannel->cdr,AST_CDR_FLAG_POST_DISABLED);
#endif
}
/* allocate a pseudo-channel thru asterisk */
- myrpt->monchannel = ast_request("zap",AST_FORMAT_SLINEAR,"pseudo",NULL);
+ myrpt->monchannel = ast_request("DAHDI",AST_FORMAT_SLINEAR,"pseudo",NULL);
if (!myrpt->monchannel)
{
fprintf(stderr,"rpt:Sorry unable to obtain pseudo channel\n");
/* make a conference for the tx */
ci.chan = 0;
ci.confno = -1; /* make a new conf */
- ci.confmode = ZT_CONF_CONF | ZT_CONF_LISTENER;
+ ci.confmode = DAHDI_CONF_CONF | DAHDI_CONF_LISTENER;
/* first put the channel on the conference in proper mode */
- if (ioctl(myrpt->zaptxchannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(myrpt->dahditxchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
rpt_mutex_unlock(&myrpt->lock);
/* make a conference for the pseudo */
ci.chan = 0;
ci.confno = -1; /* make a new conf */
- ci.confmode = ((myrpt->p.duplex == 2) || (myrpt->p.duplex == 4)) ? ZT_CONF_CONFANNMON :
- (ZT_CONF_CONF | ZT_CONF_LISTENER | ZT_CONF_TALKER);
+ ci.confmode = ((myrpt->p.duplex == 2) || (myrpt->p.duplex == 4)) ? DAHDI_CONF_CONFANNMON :
+ (DAHDI_CONF_CONF | DAHDI_CONF_LISTENER | DAHDI_CONF_TALKER);
/* first put the channel on the conference in announce mode */
- if (ioctl(myrpt->pchannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(myrpt->pchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
rpt_mutex_unlock(&myrpt->lock);
/* make a conference for the pseudo */
ci.chan = 0;
if ((strstr(myrpt->txchannel->name,"pseudo") == NULL) &&
- (myrpt->zaptxchannel == myrpt->txchannel))
+ (myrpt->dahditxchannel == myrpt->txchannel))
{
/* get tx channel's port number */
- if (ioctl(myrpt->txchannel->fds[0],ZT_CHANNO,&ci.confno) == -1)
+ if (ioctl(myrpt->txchannel->fds[0],DAHDI_CHANNO,&ci.confno) == -1)
{
ast_log(LOG_WARNING, "Unable to set tx channel's chan number\n");
rpt_mutex_unlock(&myrpt->lock);
myrpt->rpt_thread = AST_PTHREADT_STOP;
pthread_exit(NULL);
}
- ci.confmode = ZT_CONF_MONITORTX;
+ ci.confmode = DAHDI_CONF_MONITORTX;
}
else
{
ci.confno = myrpt->txconf;
- ci.confmode = ZT_CONF_CONFANNMON;
+ ci.confmode = DAHDI_CONF_CONFANNMON;
}
/* first put the channel on the conference in announce mode */
- if (ioctl(myrpt->monchannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(myrpt->monchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode for monitor\n");
rpt_mutex_unlock(&myrpt->lock);
pthread_exit(NULL);
}
/* allocate a pseudo-channel thru asterisk */
- myrpt->parrotchannel = ast_request("zap",AST_FORMAT_SLINEAR,"pseudo",NULL);
+ myrpt->parrotchannel = ast_request("DAHDI",AST_FORMAT_SLINEAR,"pseudo",NULL);
if (!myrpt->parrotchannel)
{
fprintf(stderr,"rpt:Sorry unable to obtain pseudo channel\n");
ast_set_flag(myrpt->parrotchannel->cdr,AST_CDR_FLAG_POST_DISABLED);
#endif
/* allocate a pseudo-channel thru asterisk */
- myrpt->voxchannel = ast_request("zap",AST_FORMAT_SLINEAR,"pseudo",NULL);
+ myrpt->voxchannel = ast_request("DAHDI",AST_FORMAT_SLINEAR,"pseudo",NULL);
if (!myrpt->voxchannel)
{
fprintf(stderr,"rpt:Sorry unable to obtain pseudo channel\n");
ast_set_flag(myrpt->voxchannel->cdr,AST_CDR_FLAG_POST_DISABLED);
#endif
/* allocate a pseudo-channel thru asterisk */
- myrpt->txpchannel = ast_request("zap",AST_FORMAT_SLINEAR,"pseudo",NULL);
+ myrpt->txpchannel = ast_request("DAHDI",AST_FORMAT_SLINEAR,"pseudo",NULL);
if (!myrpt->txpchannel)
{
fprintf(stderr,"rpt:Sorry unable to obtain pseudo channel\n");
/* make a conference for the tx */
ci.chan = 0;
ci.confno = myrpt->txconf;
- ci.confmode = ZT_CONF_CONF | ZT_CONF_TALKER ;
+ ci.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER ;
/* first put the channel on the conference in proper mode */
- if (ioctl(myrpt->txpchannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(myrpt->txpchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
rpt_mutex_unlock(&myrpt->lock);
/* DEBUG Dump */
if((myrpt->disgorgetime) && (time(NULL) >= myrpt->disgorgetime)){
- struct rpt_link *zl;
- struct rpt_tele *zt;
+ struct rpt_link *dl;
+ struct rpt_tele *dt;
myrpt->disgorgetime = 0;
ast_log(LOG_NOTICE,"********** Variable Dump Start (app_rpt) **********\n");
ast_log(LOG_NOTICE,"myrpt->tailtimer = %d\n",myrpt->tailtimer);
ast_log(LOG_NOTICE,"myrpt->tailevent = %d\n",myrpt->tailevent);
- zl = myrpt->links.next;
- while(zl != &myrpt->links){
- ast_log(LOG_NOTICE,"*** Link Name: %s ***\n",zl->name);
- ast_log(LOG_NOTICE," link->lasttx %d\n",zl->lasttx);
- ast_log(LOG_NOTICE," link->lastrx %d\n",zl->lastrx);
- ast_log(LOG_NOTICE," link->connected %d\n",zl->connected);
- ast_log(LOG_NOTICE," link->hasconnected %d\n",zl->hasconnected);
- ast_log(LOG_NOTICE," link->outbound %d\n",zl->outbound);
- ast_log(LOG_NOTICE," link->disced %d\n",zl->disced);
- ast_log(LOG_NOTICE," link->killme %d\n",zl->killme);
- ast_log(LOG_NOTICE," link->disctime %ld\n",zl->disctime);
- ast_log(LOG_NOTICE," link->retrytimer %ld\n",zl->retrytimer);
- ast_log(LOG_NOTICE," link->retries = %d\n",zl->retries);
- ast_log(LOG_NOTICE," link->reconnects = %d\n",zl->reconnects);
- ast_log(LOG_NOTICE," link->newkey = %d\n",zl->newkey);
- zl = zl->next;
+ dl = myrpt->links.next;
+ while(dl != &myrpt->links){
+ ast_log(LOG_NOTICE,"*** Link Name: %s ***\n",dl->name);
+ ast_log(LOG_NOTICE," link->lasttx %d\n",dl->lasttx);
+ ast_log(LOG_NOTICE," link->lastrx %d\n",dl->lastrx);
+ ast_log(LOG_NOTICE," link->connected %d\n",dl->connected);
+ ast_log(LOG_NOTICE," link->hasconnected %d\n",dl->hasconnected);
+ ast_log(LOG_NOTICE," link->outbound %d\n",dl->outbound);
+ ast_log(LOG_NOTICE," link->disced %d\n",dl->disced);
+ ast_log(LOG_NOTICE," link->killme %d\n",dl->killme);
+ ast_log(LOG_NOTICE," link->disctime %ld\n",dl->disctime);
+ ast_log(LOG_NOTICE," link->retrytimer %ld\n",dl->retrytimer);
+ ast_log(LOG_NOTICE," link->retries = %d\n",dl->retries);
+ ast_log(LOG_NOTICE," link->reconnects = %d\n",dl->reconnects);
+ ast_log(LOG_NOTICE," link->newkey = %d\n",dl->newkey);
+ dl = dl->next;
}
- zt = myrpt->tele.next;
- if(zt != &myrpt->tele)
+ dt = myrpt->tele.next;
+ if(dt != &myrpt->tele)
ast_log(LOG_NOTICE,"*** Telemetry Queue ***\n");
- while(zt != &myrpt->tele){
- ast_log(LOG_NOTICE," Telemetry mode: %d\n",zt->mode);
- zt = zt->next;
+ while(dt != &myrpt->tele){
+ ast_log(LOG_NOTICE," Telemetry mode: %d\n",dt->mode);
+ dt = dt->next;
}
ast_log(LOG_NOTICE,"******* Variable Dump End (app_rpt) *******\n");
if (myrpt->voxchannel &&
ast_check_hangup(myrpt->voxchannel)) break;
if (ast_check_hangup(myrpt->txpchannel)) break;
- if (myrpt->zaptxchannel && ast_check_hangup(myrpt->zaptxchannel)) break;
+ if (myrpt->dahditxchannel && ast_check_hangup(myrpt->dahditxchannel)) break;
/* Set local tx with keyed */
myrpt->localtx = myrpt->keyed;
char myfname[300];
ci.confno = myrpt->conf;
- ci.confmode = ZT_CONF_CONFANNMON;
+ ci.confmode = DAHDI_CONF_CONFANNMON;
ci.chan = 0;
/* first put the channel on the conference in announce mode */
- if (ioctl(myrpt->parrotchannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(myrpt->parrotchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode for parrot\n");
break;
if (myrpt->voxchannel) cs[n++] = myrpt->voxchannel;
cs[n++] = myrpt->txpchannel;
if (myrpt->txchannel != myrpt->rxchannel) cs[n++] = myrpt->txchannel;
- if (myrpt->zaptxchannel != myrpt->txchannel)
- cs[n++] = myrpt->zaptxchannel;
+ if (myrpt->dahditxchannel != myrpt->txchannel)
+ cs[n++] = myrpt->dahditxchannel;
l = myrpt->links.next;
while(l != &myrpt->links)
{
ci.chan = 0;
/* first put the channel on the conference in announce mode */
- if (ioctl(myrpt->parrotchannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(myrpt->parrotchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode for parrot\n");
break;
/* apply inbound filters, if any */
rpt_filter(myrpt,f->data,f->datalen / 2);
#endif
- if (ioctl(myrpt->zaprxchannel->fds[0], ZT_GETCONFMUTE, &ismuted) == -1)
+ if (ioctl(myrpt->dahdirxchannel->fds[0], DAHDI_GETCONFMUTE, &ismuted) == -1)
{
ismuted = 0;
}
ast_frfree(f);
continue;
}
- if (who == myrpt->zaptxchannel) /* if it was a read from pseudo-tx */
+ if (who == myrpt->dahditxchannel) /* if it was a read from pseudo-tx */
{
- f = ast_read(myrpt->zaptxchannel);
+ f = ast_read(myrpt->dahditxchannel);
if (!f)
{
if (debug) printf("@@@@ rpt:Hung Up\n");
ast_frfree(f);
f = AST_LIST_REMOVE_HEAD(&l->rxq,frame_list);
}
- if (ioctl(l->chan->fds[0], ZT_GETCONFMUTE, &ismuted) == -1)
+ if (ioctl(l->chan->fds[0], DAHDI_GETCONFMUTE, &ismuted) == -1)
{
ismuted = 0;
}
if (myrpt->voxchannel) ast_hangup(myrpt->voxchannel);
ast_hangup(myrpt->txpchannel);
if (myrpt->txchannel != myrpt->rxchannel) ast_hangup(myrpt->txchannel);
- if (myrpt->zaptxchannel != myrpt->txchannel) ast_hangup(myrpt->zaptxchannel);
+ if (myrpt->dahditxchannel != myrpt->txchannel) ast_hangup(myrpt->dahditxchannel);
if (myrpt->lastf1) ast_frfree(myrpt->lastf1);
myrpt->lastf1 = NULL;
if (myrpt->lastf2) ast_frfree(myrpt->lastf2);
struct ast_channel *who;
struct ast_channel *cs[20];
struct rpt_link *l;
- ZT_CONFINFO ci; /* conference info */
- ZT_PARAMS par;
+ DAHDI_CONFINFO ci; /* conference info */
+ DAHDI_PARAMS par;
int ms,elap,nullfd;
time_t t,last_timeout_warning;
- struct zt_radio_param z;
+ struct dahdi_radio_param z;
struct rpt_tele *telem;
int numlinks;
ast_set_read_format(l->chan,AST_FORMAT_SLINEAR);
ast_set_write_format(l->chan,AST_FORMAT_SLINEAR);
/* allocate a pseudo-channel thru asterisk */
- l->pchan = ast_request("zap",AST_FORMAT_SLINEAR,"pseudo",NULL);
+ l->pchan = ast_request("DAHDI",AST_FORMAT_SLINEAR,"pseudo",NULL);
if (!l->pchan)
{
fprintf(stderr,"rpt:Sorry unable to obtain pseudo channel\n");
/* make a conference for the tx */
ci.chan = 0;
ci.confno = myrpt->conf;
- ci.confmode = ZT_CONF_CONF | ZT_CONF_LISTENER | ZT_CONF_TALKER;
+ ci.confmode = DAHDI_CONF_CONF | DAHDI_CONF_LISTENER | DAHDI_CONF_TALKER;
/* first put the channel on the conference in proper mode */
- if (ioctl(l->pchan->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(l->pchan->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
pthread_exit(NULL);
}
*tele++ = 0;
myrpt->rxchannel = ast_request(myrpt->rxchanname,AST_FORMAT_SLINEAR,tele,NULL);
- myrpt->zaprxchannel = NULL;
- if (!strcasecmp(myrpt->rxchanname,"Zap"))
- myrpt->zaprxchannel = myrpt->rxchannel;
+ myrpt->dahdirxchannel = NULL;
+ if (!strcasecmp(myrpt->rxchanname,"DAHDI"))
+ myrpt->dahdirxchannel = myrpt->rxchannel;
if (myrpt->rxchannel)
{
ast_set_read_format(myrpt->rxchannel,AST_FORMAT_SLINEAR);
pthread_exit(NULL);
}
*--tele = '/';
- myrpt->zaptxchannel = NULL;
+ myrpt->dahditxchannel = NULL;
if (myrpt->txchanname)
{
tele = strchr(myrpt->txchanname,'/');
}
*tele++ = 0;
myrpt->txchannel = ast_request(myrpt->txchanname,AST_FORMAT_SLINEAR,tele,NULL);
- if (!strncasecmp(myrpt->txchanname,"Zap",3))
- myrpt->zaptxchannel = myrpt->txchannel;
+ if (!strncasecmp(myrpt->txchanname,"DAHDI",3))
+ myrpt->dahditxchannel = myrpt->txchannel;
if (myrpt->txchannel)
{
ast_set_read_format(myrpt->txchannel,AST_FORMAT_SLINEAR);
else
{
myrpt->txchannel = myrpt->rxchannel;
- if (!strncasecmp(myrpt->rxchanname,"Zap",3))
- myrpt->zaptxchannel = myrpt->rxchannel;
+ if (!strncasecmp(myrpt->rxchanname,"DAHDI",3))
+ myrpt->dahditxchannel = myrpt->rxchannel;
}
/* allocate a pseudo-channel thru asterisk */
- myrpt->pchannel = ast_request("zap",AST_FORMAT_SLINEAR,"pseudo",NULL);
+ myrpt->pchannel = ast_request("DAHDI",AST_FORMAT_SLINEAR,"pseudo",NULL);
if (!myrpt->pchannel)
{
fprintf(stderr,"rpt:Sorry unable to obtain pseudo channel\n");
if (myrpt->pchannel->cdr)
ast_set_flag(myrpt->pchannel->cdr,AST_CDR_FLAG_POST_DISABLED);
#endif
- if (!myrpt->zaprxchannel) myrpt->zaprxchannel = myrpt->pchannel;
- if (!myrpt->zaptxchannel) myrpt->zaptxchannel = myrpt->pchannel;
+ if (!myrpt->dahdirxchannel) myrpt->dahdirxchannel = myrpt->pchannel;
+ if (!myrpt->dahditxchannel) myrpt->dahditxchannel = myrpt->pchannel;
/* make a conference for the pseudo */
ci.chan = 0;
ci.confno = -1; /* make a new conf */
- ci.confmode = ZT_CONF_CONFANNMON ;
+ ci.confmode = DAHDI_CONF_CONFANNMON ;
/* first put the channel on the conference in announce/monitor mode */
- if (ioctl(myrpt->pchannel->fds[0],ZT_SETCONF,&ci) == -1)
+ if (ioctl(myrpt->pchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
rpt_mutex_unlock(&myrpt->lock);
}
iskenwood_pci4 = 0;
memset(&z,0,sizeof(z));
- if ((myrpt->iofd < 1) && (myrpt->txchannel == myrpt->zaptxchannel))
+ if ((myrpt->iofd < 1) && (myrpt->txchannel == myrpt->dahditxchannel))
{
- z.radpar = ZT_RADPAR_REMMODE;
- z.data = ZT_RADPAR_REM_NONE;
- res = ioctl(myrpt->zaptxchannel->fds[0],ZT_RADIO_SETPARAM,&z);
+ z.radpar = DAHDI_RADPAR_REMMODE;
+ z.data = DAHDI_RADPAR_REM_NONE;
+ res = ioctl(myrpt->dahditxchannel->fds[0],DAHDI_RADIO_SETPARAM,&z);
/* if PCIRADIO and kenwood selected */
if ((!res) && (!strcmp(myrpt->remoterig,remote_rig_kenwood)))
{
- z.radpar = ZT_RADPAR_UIOMODE;
+ z.radpar = DAHDI_RADPAR_UIOMODE;
z.data = 1;
- if (ioctl(myrpt->zaptxchannel->fds[0],ZT_RADIO_SETPARAM,&z) == -1)
+ if (ioctl(myrpt->dahditxchannel->fds[0],DAHDI_RADIO_SETPARAM,&z) == -1)
{
ast_log(LOG_ERROR,"Cannot set UIOMODE\n");
return -1;
}
- z.radpar = ZT_RADPAR_UIODATA;
+ z.radpar = DAHDI_RADPAR_UIODATA;
z.data = 3;
- if (ioctl(myrpt->zaptxchannel->fds[0],ZT_RADIO_SETPARAM,&z) == -1)
+ if (ioctl(myrpt->dahditxchannel->fds[0],DAHDI_RADIO_SETPARAM,&z) == -1)
{
ast_log(LOG_ERROR,"Cannot set UIODATA\n");
return -1;
}
- i = ZT_OFFHOOK;
- if (ioctl(myrpt->zaptxchannel->fds[0],ZT_HOOK,&i) == -1)
+ i = DAHDI_OFFHOOK;
+ if (ioctl(myrpt->dahditxchannel->fds[0],DAHDI_HOOK,&i) == -1)
{
ast_log(LOG_ERROR,"Cannot set hook\n");
return -1;
iskenwood_pci4 = 1;
}
}
- if (myrpt->txchannel == myrpt->zaptxchannel)
+ if (myrpt->txchannel == myrpt->dahditxchannel)
{
- i = ZT_ONHOOK;
- ioctl(myrpt->zaptxchannel->fds[0],ZT_HOOK,&i);
+ i = DAHDI_ONHOOK;
+ ioctl(myrpt->dahditxchannel->fds[0],DAHDI_HOOK,&i);
/* if PCIRADIO and Yaesu ft897/ICOM IC-706 selected */
if ((myrpt->iofd < 1) && (!res) &&
((!strcmp(myrpt->remoterig,remote_rig_ft897)) ||
(!strcmp(myrpt->remoterig,remote_rig_ic706)) ||
(!strcmp(myrpt->remoterig,remote_rig_tm271))))
{
- z.radpar = ZT_RADPAR_UIOMODE;
+ z.radpar = DAHDI_RADPAR_UIOMODE;
z.data = 1;
- if (ioctl(myrpt->zaptxchannel->fds[0],ZT_RADIO_SETPARAM,&z) == -1)
+ if (ioctl(myrpt->dahditxchannel->fds[0],DAHDI_RADIO_SETPARAM,&z) == -1)
{
ast_log(LOG_ERROR,"Cannot set UIOMODE\n");
return -1;
}
- z.radpar = ZT_RADPAR_UIODATA;
+ z.radpar = DAHDI_RADPAR_UIODATA;
z.data = 3;
- if (ioctl(myrpt->zaptxchannel->fds[0],ZT_RADIO_SETPARAM,&z) == -1)
+ if (ioctl(myrpt->dahditxchannel->fds[0],DAHDI_RADIO_SETPARAM,&z) == -1)
{
ast_log(LOG_ERROR,"Cannot set UIODATA\n");
return -1;
if (myrpt->remote && (myrpt->rxchannel == myrpt->txchannel))
{
i = 128;
- ioctl(myrpt->zaprxchannel->fds[0],ZT_ECHOCANCEL,&i);
+ ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_ECHOCANCEL,&i);
}
if (chan->_state != AST_STATE_UP) {
ast_answer(chan);
if (!phone_mode) send_newkey(chan);
}
- if (myrpt->rxchannel == myrpt->zaprxchannel)
+ if (myrpt->rxchannel == myrpt->dahdirxchannel)
{
- if (ioctl(myrpt->zaprxchannel->fds[0],ZT_GET_PARAMS,&par) != -1)
+ if (ioctl(myrpt->dahdirxchannel->fds[0],DAHDI_GET_PARAMS,&par) != -1)
{
if (par.rxisoffhook)
{
if((myrpt->remtxfreqok = check_tx_freq(myrpt)))
{
time(&myrpt->last_activity_time);
- if ((iskenwood_pci4) && (myrpt->txchannel == myrpt->zaptxchannel))
+ if ((iskenwood_pci4) && (myrpt->txchannel == myrpt->dahditxchannel))
{
- z.radpar = ZT_RADPAR_UIODATA;
+ z.radpar = DAHDI_RADPAR_UIODATA;
z.data = 1;
- if (ioctl(myrpt->zaptxchannel->fds[0],ZT_RADIO_SETPARAM,&z) == -1)
+ if (ioctl(myrpt->dahditxchannel->fds[0],DAHDI_RADIO_SETPARAM,&z) == -1)
{
ast_log(LOG_ERROR,"Cannot set UIODATA\n");
return -1;
if(!myrpt->remtxfreqok){
rpt_telemetry(myrpt,UNAUTHTX,NULL);
}
- if ((iskenwood_pci4) && (myrpt->txchannel == myrpt->zaptxchannel))
+ if ((iskenwood_pci4) && (myrpt->txchannel == myrpt->dahditxchannel))
{
- z.radpar = ZT_RADPAR_UIODATA;
+ z.radpar = DAHDI_RADPAR_UIODATA;
z.data = 3;
- if (ioctl(myrpt->zaptxchannel->fds[0],ZT_RADIO_SETPARAM,&z) == -1)
+ if (ioctl(myrpt->dahditxchannel->fds[0],DAHDI_RADIO_SETPARAM,&z) == -1)
{
ast_log(LOG_ERROR,"Cannot set UIODATA\n");
return -1;
}
if (f->frametype == AST_FRAME_VOICE)
{
- if (ioctl(chan->fds[0], ZT_GETCONFMUTE, &ismuted) == -1)
+ if (ioctl(chan->fds[0], DAHDI_GETCONFMUTE, &ismuted) == -1)
{
ismuted = 0;
}
myrpt->lastf1 = NULL;
if (myrpt->lastf2) ast_frfree(myrpt->lastf2);
myrpt->lastf2 = NULL;
- if ((iskenwood_pci4) && (myrpt->txchannel == myrpt->zaptxchannel))
+ if ((iskenwood_pci4) && (myrpt->txchannel == myrpt->dahditxchannel))
{
- z.radpar = ZT_RADPAR_UIOMODE;
+ z.radpar = DAHDI_RADPAR_UIOMODE;
z.data = 3;
- if (ioctl(myrpt->zaptxchannel->fds[0],ZT_RADIO_SETPARAM,&z) == -1)
+ if (ioctl(myrpt->dahditxchannel->fds[0],DAHDI_RADIO_SETPARAM,&z) == -1)
{
ast_log(LOG_ERROR,"Cannot set UIOMODE\n");
return -1;
}
- z.radpar = ZT_RADPAR_UIODATA;
+ z.radpar = DAHDI_RADPAR_UIODATA;
z.data = 3;
- if (ioctl(myrpt->zaptxchannel->fds[0],ZT_RADIO_SETPARAM,&z) == -1)
+ if (ioctl(myrpt->dahditxchannel->fds[0],DAHDI_RADIO_SETPARAM,&z) == -1)
{
ast_log(LOG_ERROR,"Cannot set UIODATA\n");
return -1;
}
- i = ZT_OFFHOOK;
- if (ioctl(myrpt->zaptxchannel->fds[0],ZT_HOOK,&i) == -1)
+ i = DAHDI_OFFHOOK;
+ if (ioctl(myrpt->dahditxchannel->fds[0],DAHDI_HOOK,&i) == -1)
{
ast_log(LOG_ERROR,"Cannot set hook\n");
return -1;
ASOUND=@PBX_ALSA@
CRYPTO=@PBX_CRYPTO@
CURL=@PBX_CURL@
+DAHDI=@PBX_DAHDI@
FREETDS=@PBX_FREETDS@
GMIME=@PBX_GMIME@
GNU_LD=@GNU_LD@
VORBIS=@PBX_VORBIS@
VPBAPI=@PBX_VPB@
WINARCH=@WINARCH@
-ZAPTEL=@PBX_ZAPTEL@
-ZAPTEL_TRANSCODE=@PBX_ZAPTEL_TRANSCODE@
-ZAPTEL_VLDTMF=@PBX_ZAPTEL_VLDTMF@
ZLIB=@PBX_ZLIB@
"accountcode", accountcode is the account name of detail records, Master.csv contains all records *
Detail records are configured on a channel basis, IAX and SIP are determined by user *
- Zap is determined by channel in zaptel.conf
+ DAHDI is determined by channel in dahdi.conf
"source",
"destination",
"destination context",
/*! \file
*
- * \brief Zaptel Pseudo TDM interface
+ * \brief DAHDI for Pseudo TDM
*
* \author Mark Spencer <markster@digium.com>
*
- * Connects to the Zaptel telephony library as well as
+ * Connects to the DAHDI telephony library as well as
* libpri. Libpri is optional and needed only if you are
* going to use ISDN connections.
*
* You need to install libraries before you attempt to compile
- * and install the Zaptel channel.
+ * and install the DAHDI channel.
*
* \par See also
- * \arg \ref Config_zap
+ * \arg \ref Config_dahdi
*
* \ingroup channel_drivers
*
/*** MODULEINFO
<depend>res_smdi</depend>
- <depend>zaptel_vldtmf</depend>
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
<depend>tonezone</depend>
<use>pri</use>
<use>ss7</use>
#include <sys/ioctl.h>
#include <math.h>
#include <ctype.h>
-#include "asterisk/zapata.h"
+#include "asterisk/dahdi.h"
#ifdef HAVE_PRI
#include <libpri.h>
#define SMDI_MD_WAIT_TIMEOUT 1500 /* 1.5 seconds */
-#ifdef ZT_SPANINFO_HAS_LINECONFIG
+#ifdef DAHDI_SPANINFO_HAS_LINECONFIG
static const char *lbostr[] = {
"0 db (CSU)/0-133 feet (DSX-1)",
"133-266 feet (DSX-1)",
};
static struct ast_jb_conf global_jbconf;
-#if !defined(ZT_SIG_EM_E1) || (defined(HAVE_PRI) && !defined(ZT_SIG_HARDHDLC))
-#error "Your Zaptel is too old. Please update"
+#if !defined(DAHDI_SIG_EM_E1) || (defined(HAVE_PRI) && !defined(DAHDI_SIG_HARDHDLC))
+#error "Your DAHDI is too old. Please update"
#endif
-#ifndef ZT_TONEDETECT
+#ifndef DAHDI_TONEDETECT
/* Work around older code with no tone detect */
-#define ZT_EVENT_DTMFDOWN 0
-#define ZT_EVENT_DTMFUP 0
+#define DAHDI_EVENT_DTMFDOWN 0
+#define DAHDI_EVENT_DTMFUP 0
#endif
/* define this to send PRI user-user information elements */
* before dialing on it. Certain FXO interfaces always think they're out of
* service with this method however.
*/
-/* #define ZAP_CHECK_HOOKSTATE */
+/* #define DAHDI_CHECK_HOOKSTATE */
/*! \brief Typically, how many rings before we should send Caller*ID */
#define DEFAULT_CIDRINGS 1
#define CHANNEL_PSEUDO -12
-#define AST_LAW(p) (((p)->law == ZT_LAW_ALAW) ? AST_FORMAT_ALAW : AST_FORMAT_ULAW)
+#define AST_LAW(p) (((p)->law == DAHDI_LAW_ALAW) ? AST_FORMAT_ALAW : AST_FORMAT_ULAW)
/*! \brief Signaling types that need to use MF detection should be placed in this macro */
#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 tdesc[] = "Zapata Telephony Driver"
+static const char tdesc[] = "DAHDI Telephony Driver"
#ifdef HAVE_PRI
" w/PRI"
#endif
#endif
;
-static const char config[] = "zapata.conf";
-
-#define SIG_EM ZT_SIG_EM
-#define SIG_EMWINK (0x0100000 | ZT_SIG_EM)
-#define SIG_FEATD (0x0200000 | ZT_SIG_EM)
-#define SIG_FEATDMF (0x0400000 | ZT_SIG_EM)
-#define SIG_FEATB (0x0800000 | ZT_SIG_EM)
-#define SIG_E911 (0x1000000 | ZT_SIG_EM)
-#define SIG_FEATDMF_TA (0x2000000 | ZT_SIG_EM)
-#define SIG_FGC_CAMA (0x4000000 | ZT_SIG_EM)
-#define SIG_FGC_CAMAMF (0x8000000 | ZT_SIG_EM)
-#define SIG_FXSLS ZT_SIG_FXSLS
-#define SIG_FXSGS ZT_SIG_FXSGS
-#define SIG_FXSKS ZT_SIG_FXSKS
-#define SIG_FXOLS ZT_SIG_FXOLS
-#define SIG_FXOGS ZT_SIG_FXOGS
-#define SIG_FXOKS ZT_SIG_FXOKS
-#define SIG_PRI ZT_SIG_CLEAR
-#define SIG_BRI (0x2000000 | ZT_SIG_CLEAR)
-#define SIG_BRI_PTMP (0X4000000 | ZT_SIG_CLEAR)
-#define SIG_SS7 (0x1000000 | ZT_SIG_CLEAR)
-#define SIG_SF ZT_SIG_SF
-#define SIG_SFWINK (0x0100000 | ZT_SIG_SF)
-#define SIG_SF_FEATD (0x0200000 | ZT_SIG_SF)
-#define SIG_SF_FEATDMF (0x0400000 | ZT_SIG_SF)
-#define SIG_SF_FEATB (0x0800000 | ZT_SIG_SF)
-#define SIG_EM_E1 ZT_SIG_EM_E1
-#define SIG_GR303FXOKS (0x0100000 | ZT_SIG_FXOKS)
-#define SIG_GR303FXSKS (0x0100000 | ZT_SIG_FXSKS)
+static const char config[] = "chan_dahdi.conf";
+
+#define SIG_EM DAHDI_SIG_EM
+#define SIG_EMWINK (0x0100000 | DAHDI_SIG_EM)
+#define SIG_FEATD (0x0200000 | DAHDI_SIG_EM)
+#define SIG_FEATDMF (0x0400000 | DAHDI_SIG_EM)
+#define SIG_FEATB (0x0800000 | DAHDI_SIG_EM)
+#define SIG_E911 (0x1000000 | DAHDI_SIG_EM)
+#define SIG_FEATDMF_TA (0x2000000 | DAHDI_SIG_EM)
+#define SIG_FGC_CAMA (0x4000000 | DAHDI_SIG_EM)
+#define SIG_FGC_CAMAMF (0x8000000 | DAHDI_SIG_EM)
+#define SIG_FXSLS DAHDI_SIG_FXSLS
+#define SIG_FXSGS DAHDI_SIG_FXSGS
+#define SIG_FXSKS DAHDI_SIG_FXSKS
+#define SIG_FXOLS DAHDI_SIG_FXOLS
+#define SIG_FXOGS DAHDI_SIG_FXOGS
+#define SIG_FXOKS DAHDI_SIG_FXOKS
+#define SIG_PRI DAHDI_SIG_CLEAR
+#define SIG_BRI (0x2000000 | DAHDI_SIG_CLEAR)
+#define SIG_BRI_PTMP (0X4000000 | DAHDI_SIG_CLEAR)
+#define SIG_SS7 (0x1000000 | DAHDI_SIG_CLEAR)
+#define SIG_SF DAHDI_SIG_SF
+#define SIG_SFWINK (0x0100000 | DAHDI_SIG_SF)
+#define SIG_SF_FEATD (0x0200000 | DAHDI_SIG_SF)
+#define SIG_SF_FEATDMF (0x0400000 | DAHDI_SIG_SF)
+#define SIG_SF_FEATB (0x0800000 | DAHDI_SIG_SF)
+#define SIG_EM_E1 DAHDI_SIG_EM_E1
+#define SIG_GR303FXOKS (0x0100000 | DAHDI_SIG_FXOKS)
+#define SIG_GR303FXSKS (0x0100000 | DAHDI_SIG_FXSKS)
#ifdef LOTS_OF_SPANS
-#define NUM_SPANS ZT_MAX_SPANS
+#define NUM_SPANS DAHDI_MAX_SPANS
#else
#define NUM_SPANS 32
#endif
#define DCHAN_AVAILABLE (DCHAN_PROVISIONED | DCHAN_NOTINALARM | DCHAN_UP)
/* Overlap dialing option types */
-#define ZAP_OVERLAPDIAL_NONE 0
-#define ZAP_OVERLAPDIAL_OUTGOING 1
-#define ZAP_OVERLAPDIAL_INCOMING 2
-#define ZAP_OVERLAPDIAL_BOTH (ZAP_OVERLAPDIAL_INCOMING|ZAP_OVERLAPDIAL_OUTGOING)
+#define DAHDI_OVERLAPDIAL_NONE 0
+#define DAHDI_OVERLAPDIAL_OUTGOING 1
+#define DAHDI_OVERLAPDIAL_INCOMING 2
+#define DAHDI_OVERLAPDIAL_BOTH (DAHDI_OVERLAPDIAL_INCOMING|DAHDI_OVERLAPDIAL_OUTGOING)
#define CALLPROGRESS_PROGRESS 1
/*! \brief How long to wait for an extra digit, if there is an ambiguous match */
static int matchdigittimeout = 3000;
-/*! \brief Protect the interface list (of zt_pvt's) */
+/*! \brief Protect the interface list (of dahdi_pvt's) */
AST_MUTEX_DEFINE_STATIC(iflock);
static int restart_monitor(void);
-static enum ast_bridge_result zt_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms);
+static enum ast_bridge_result dahdi_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms);
-static int zt_sendtext(struct ast_channel *c, const char *text);
+static int dahdi_sendtext(struct ast_channel *c, const char *text);
static void mwi_event_cb(const struct ast_event *event, void *userdata)
{
/* This module does not handle MWI in an event-based manner. However, it
* subscribes to MWI for each mailbox that is configured so that the core
- * knows that we care about it. Then, chan_zap will get the MWI from the
+ * knows that we care about it. Then, chan_dahdi will get the MWI from the
* event cache instead of checking the mailbox directly. */
}
-/*! \brief Avoid the silly zt_getevent which ignores a bunch of events */
-static inline int zt_get_event(int fd)
+/*! \brief Avoid the silly dahdi_getevent which ignores a bunch of events */
+static inline int dahdi_get_event(int fd)
{
int j;
- if (ioctl(fd, ZT_GETEVENT, &j) == -1)
+ if (ioctl(fd, DAHDI_GETEVENT, &j) == -1)
return -1;
return j;
}
-/*! \brief Avoid the silly zt_waitevent which ignores a bunch of events */
-static inline int zt_wait_event(int fd)
+/*! \brief Avoid the silly dahdi_waitevent which ignores a bunch of events */
+static inline int dahdi_wait_event(int fd)
{
int i, j = 0;
- i = ZT_IOMUX_SIGEVENT;
- if (ioctl(fd, ZT_IOMUX, &i) == -1)
+ i = DAHDI_IOMUX_SIGEVENT;
+ if (ioctl(fd, DAHDI_IOMUX, &i) == -1)
return -1;
- if (ioctl(fd, ZT_GETEVENT, &j) == -1)
+ if (ioctl(fd, DAHDI_GETEVENT, &j) == -1)
return -1;
return j;
}
#define MIN_MS_SINCE_FLASH ( (2000) ) /*!< 2000 ms */
#define DEFAULT_RINGT ( (8000 * 8) / READ_SIZE) /*!< 8,000 ms */
-struct zt_pvt;
+struct dahdi_pvt;
static int ringt_base = DEFAULT_RINGT;
#define SS7_NAI_DYNAMIC -1
-struct zt_ss7 {
+struct dahdi_ss7 {
pthread_t master; /*!< Thread of master */
ast_mutex_t lock;
int fds[NUM_DCHANS];
char subscriberprefix[20]; /*!< area access code + area code ('0'+area code for european dialplans) */
char unknownprefix[20]; /*!< for unknown dialplans */
struct ss7 *ss7;
- struct zt_pvt *pvts[MAX_CHANNELS]; /*!< Member channel pvt structs */
+ struct dahdi_pvt *pvts[MAX_CHANNELS]; /*!< Member channel pvt structs */
};
-static struct zt_ss7 linksets[NUM_SPANS];
+static struct dahdi_ss7 linksets[NUM_SPANS];
static int cur_ss7type = -1;
static int cur_linkset = -1;
#define PRI_SPAN(p) (((p) >> 8) & 0xff)
#define PRI_EXPLICIT(p) (((p) >> 16) & 0x01)
-struct zt_pri {
+struct dahdi_pri {
pthread_t master; /*!< Thread of master */
ast_mutex_t lock; /*!< Mutex */
char idleext[AST_MAX_EXTENSION]; /*!< Where to idle extra calls */
time_t lastreset; /*!< time when unused channels were last reset */
long resetinterval; /*!< Interval (in seconds) for resetting unused channels */
int sig;
- struct zt_pvt *pvts[MAX_CHANNELS]; /*!< Member channel pvt structs */
- struct zt_pvt *crvs; /*!< Member CRV structs */
- struct zt_pvt *crvend; /*!< Pointer to end of CRV structs */
+ struct dahdi_pvt *pvts[MAX_CHANNELS]; /*!< Member channel pvt structs */
+ struct dahdi_pvt *crvs; /*!< Member CRV structs */
+ struct dahdi_pvt *crvend; /*!< Pointer to end of CRV structs */
};
-static struct zt_pri pris[NUM_SPANS];
+static struct dahdi_pri pris[NUM_SPANS];
#if 0
#define DEFAULT_PRI_DEBUG (PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q921_DUMP | PRI_DEBUG_Q921_RAW | PRI_DEBUG_Q921_STATE)
#define DEFAULT_PRI_DEBUG 0
#endif
-static inline void pri_rel(struct zt_pri *pri)
+static inline void pri_rel(struct dahdi_pri *pri)
{
ast_mutex_unlock(&pri->lock);
}
#else
/*! Shut up the compiler */
-struct zt_pri;
+struct dahdi_pri;
#endif
#define SUB_REAL 0 /*!< Active call */
struct ringContextData {
char contextData[AST_MAX_CONTEXT];
};
-struct zt_distRings {
+struct dahdi_distRings {
struct distRingData ringnum[3];
struct ringContextData ringContext[3];
};
"Threeway"
};
-struct zt_subchannel {
+struct dahdi_subchannel {
int zfd;
struct ast_channel *owner;
int chan;
unsigned int needunhold:1;
unsigned int linear:1;
unsigned int inthreeway:1;
- ZT_CONFINFO curconf;
+ DAHDI_CONFINFO curconf;
};
#define CONF_USER_REAL (1 << 0)
#define MAX_SLAVES 4
-static struct zt_pvt {
+static struct dahdi_pvt {
ast_mutex_t lock;
struct ast_channel *owner; /*!< Our current active owner (if applicable) */
/*!< Up to three channels can be associated with this call */
- struct zt_subchannel sub_unused; /*!< Just a safety precaution */
- struct zt_subchannel subs[3]; /*!< Sub-channels */
- struct zt_confinfo saveconf; /*!< Saved conference info */
+ struct dahdi_subchannel sub_unused; /*!< Just a safety precaution */
+ struct dahdi_subchannel subs[3]; /*!< Sub-channels */
+ struct dahdi_confinfo saveconf; /*!< Saved conference info */
- struct zt_pvt *slaves[MAX_SLAVES]; /*!< Slave to us (follows our conferencing) */
- struct zt_pvt *master; /*!< Master to us (we follow their conferencing) */
+ struct dahdi_pvt *slaves[MAX_SLAVES]; /*!< Slave to us (follows our conferencing) */
+ struct dahdi_pvt *master; /*!< Master to us (we follow their conferencing) */
int inconference; /*!< If our real should be in the conference */
int sig; /*!< Signalling style */
int radio; /*!< radio type */
int outsigmod; /*!< Outbound Signalling style (modifier) */
int oprmode; /*!< "Operator Services" mode */
- struct zt_pvt *oprpeer; /*!< "Operator Services" peer tech_pvt ptr */
+ struct dahdi_pvt *oprpeer; /*!< "Operator Services" peer tech_pvt ptr */
float cid_rxgain; /*!< "Gain to apply during caller id */
float rxgain;
float txgain;
int tonezone; /*!< tone zone for this chan, or -1 for default */
- struct zt_pvt *next; /*!< Next channel in list */
- struct zt_pvt *prev; /*!< Prev channel in list */
+ struct dahdi_pvt *next; /*!< Next channel in list */
+ struct dahdi_pvt *prev; /*!< Prev channel in list */
/* flags */
unsigned int adsi:1;
unsigned int use_callerid:1; /*!< Whether or not to use caller id on this channel */
unsigned int use_callingpres:1; /*!< Whether to use the callingpres the calling switch sends */
unsigned int usedistinctiveringdetection:1;
- unsigned int zaptrcallerid:1; /*!< should we use the callerid from incoming call on zap transfer or not */
+ unsigned int dahditrcallerid:1; /*!< should we use the callerid from incoming call on dahdi transfer or not */
unsigned int transfertobusy:1; /*!< allow flash-transfers to busy channels */
unsigned int mwimonitor_neon:1; /*!< monitor this FXO port for neon type MWI indication from other end */
unsigned int mwimonitor_fsk:1; /*!< monitor this FXO port for fsk MWI indication from other end */
unsigned int use_smdi:1; /* Whether to use SMDI on this channel */
struct ast_smdi_interface *smdi_iface; /* The serial port to listen for SMDI data on */
- struct zt_distRings drings;
+ struct dahdi_distRings drings;
char context[AST_MAX_CONTEXT];
char defcontext[AST_MAX_CONTEXT];
int stripmsd;
int callwaitcas;
int callwaitrings;
-#if defined(HAVE_ZAPTEL_ECHOCANPARAMS)
struct {
- struct zt_echocanparams head;
- struct zt_echocanparam params[ZT_MAX_ECHOCANPARAMS];
+ struct dahdi_echocanparams head;
+ struct dahdi_echocanparam params[DAHDI_MAX_ECHOCANPARAMS];
} echocancel;
-#else
- int echocancel;
-#endif
int echotraining;
char echorest[20];
int busycount;
struct timeval flashtime; /*!< Last flash-hook time */
struct ast_dsp *dsp;
int cref; /*!< Call reference number */
- ZT_DIAL_OPERATION dop;
+ DAHDI_DIAL_OPERATION dop;
int whichwink; /*!< SIG_FEATDMF_TA Which wink are we on? */
char finaldial[64];
char accountcode[AST_MAX_ACCOUNT_CODE]; /*!< Account code */
struct timeval polaritydelaytv;
int sendcalleridafter;
#ifdef HAVE_PRI
- struct zt_pri *pri;
- struct zt_pvt *bearer;
- struct zt_pvt *realcall;
+ struct dahdi_pri *pri;
+ struct dahdi_pvt *bearer;
+ struct dahdi_pvt *realcall;
q931_call *call;
int prioffset;
int logicalspan;
int polarity;
int dsp_features;
#ifdef HAVE_SS7
- struct zt_ss7 *ss7;
+ struct dahdi_ss7 *ss7;
struct isup_call *ss7call;
char charge_number[50];
char gen_add_number[50];
int muting;
} *iflist = NULL, *ifend = NULL;
-/*! \brief Channel configuration from zapata.conf .
- * This struct is used for parsing the [channels] section of zapata.conf.
+/*! \brief Channel configuration from chan_dahdi.conf .
+ * This struct is used for parsing the [channels] section of chan_dahdi.conf.
* Generally there is a field here for every possible configuration item.
*
* The state of fields is saved along the parsing and whenever a 'channel'
- * statement is reached, the current zt_chan_conf is used to configure the
- * channel (struct zt_pvt)
+ * statement is reached, the current dahdi_chan_conf is used to configure the
+ * channel (struct dahdi_pvt)
*
- * \see zt_chan_init for the default values.
+ * \see dahdi_chan_init for the default values.
*/
-struct zt_chan_conf {
- struct zt_pvt chan;
+struct dahdi_chan_conf {
+ struct dahdi_pvt chan;
#ifdef HAVE_PRI
- struct zt_pri pri;
+ struct dahdi_pri pri;
#endif
#ifdef HAVE_SS7
- struct zt_ss7 ss7;
+ struct dahdi_ss7 ss7;
#endif
- ZT_PARAMS timing;
- int is_sig_auto; /*!< Use channel signalling from Zaptel? */
+ DAHDI_PARAMS timing;
+ int is_sig_auto; /*!< Use channel signalling from DAHDI? */
char smdi_port[SMDI_MAX_FILENAME_LEN];
};
-/*! returns a new zt_chan_conf with default values (by-value) */
-static struct zt_chan_conf zt_chan_conf_default(void) {
+/*! returns a new dahdi_chan_conf with default values (by-value) */
+static struct dahdi_chan_conf dahdi_chan_conf_default(void) {
/* recall that if a field is not included here it is initialized
* to 0 or equivalent
*/
- struct zt_chan_conf conf = {
+ struct dahdi_chan_conf conf = {
#ifdef HAVE_PRI
.pri = {
.nsf = PRI_NSF_NONE,
.cid_signalling = CID_SIG_BELL,
.cid_start = CID_START_RING,
- .zaptrcallerid = 0,
+ .dahditrcallerid = 0,
.use_callerid = 1,
.sig = -1,
.outsigmod = -1,
.tonezone = -1,
-#if defined(HAVE_ZAPTEL_ECHOCANPARAMS)
.echocancel.head.tap_length = 1,
-#else
- .echocancel = 1,
-#endif
.busycount = 3,
}
-static struct ast_channel *zt_request(const char *type, int format, void *data, int *cause);
-static int zt_digit_begin(struct ast_channel *ast, char digit);
-static int zt_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
-static int zt_sendtext(struct ast_channel *c, const char *text);
-static int zt_call(struct ast_channel *ast, char *rdest, int timeout);
-static int zt_hangup(struct ast_channel *ast);
-static int zt_answer(struct ast_channel *ast);
-static struct ast_frame *zt_read(struct ast_channel *ast);
-static int zt_write(struct ast_channel *ast, struct ast_frame *frame);
-static struct ast_frame *zt_exception(struct ast_channel *ast);
-static int zt_indicate(struct ast_channel *chan, int condition, const void *data, size_t datalen);
-static int zt_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
-static int zt_setoption(struct ast_channel *chan, int option, void *data, int datalen);
-static int zt_func_read(struct ast_channel *chan, const char *function, char *data, char *buf, size_t len);
-
-static const struct ast_channel_tech zap_tech = {
- .type = "Zap",
+static struct ast_channel *dahdi_request(const char *type, int format, void *data, int *cause);
+static int dahdi_digit_begin(struct ast_channel *ast, char digit);
+static int dahdi_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
+static int dahdi_sendtext(struct ast_channel *c, const char *text);
+static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout);
+static int dahdi_hangup(struct ast_channel *ast);
+static int dahdi_answer(struct ast_channel *ast);
+static struct ast_frame *dahdi_read(struct ast_channel *ast);
+static int dahdi_write(struct ast_channel *ast, struct ast_frame *frame);
+static struct ast_frame *dahdi_exception(struct ast_channel *ast);
+static int dahdi_indicate(struct ast_channel *chan, int condition, const void *data, size_t datalen);
+static int dahdi_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
+static int dahdi_setoption(struct ast_channel *chan, int option, void *data, int datalen);
+static int dahdi_func_read(struct ast_channel *chan, const char *function, char *data, char *buf, size_t len);
+
+static const struct ast_channel_tech dahdi_tech = {
+ .type = "DAHDI",
.description = tdesc,
.capabilities = AST_FORMAT_SLINEAR | AST_FORMAT_ULAW | AST_FORMAT_ALAW,
- .requester = zt_request,
- .send_digit_begin = zt_digit_begin,
- .send_digit_end = zt_digit_end,
- .send_text = zt_sendtext,
- .call = zt_call,
- .hangup = zt_hangup,
- .answer = zt_answer,
- .read = zt_read,
- .write = zt_write,
- .bridge = zt_bridge,
- .exception = zt_exception,
- .indicate = zt_indicate,
- .fixup = zt_fixup,
- .setoption = zt_setoption,
- .func_channel_read = zt_func_read,
+ .requester = dahdi_request,
+ .send_digit_begin = dahdi_digit_begin,
+ .send_digit_end = dahdi_digit_end,
+ .send_text = dahdi_sendtext,
+ .call = dahdi_call,
+ .hangup = dahdi_hangup,
+ .answer = dahdi_answer,
+ .read = dahdi_read,
+ .write = dahdi_write,
+ .bridge = dahdi_bridge,
+ .exception = dahdi_exception,
+ .indicate = dahdi_indicate,
+ .fixup = dahdi_fixup,
+ .setoption = dahdi_setoption,
+ .func_channel_read = dahdi_func_read,
};
#ifdef HAVE_PRI
#define GET_CHANNEL(p) ((p)->channel)
#endif
-struct zt_pvt *round_robin[32];
+struct dahdi_pvt *round_robin[32];
#ifdef HAVE_PRI
-static inline int pri_grab(struct zt_pvt *pvt, struct zt_pri *pri)
+static inline int pri_grab(struct dahdi_pvt *pvt, struct dahdi_pri *pri)
{
int res;
/* Grab the lock first */
#endif
#ifdef HAVE_SS7
-static inline void ss7_rel(struct zt_ss7 *ss7)
+static inline void ss7_rel(struct dahdi_ss7 *ss7)
{
ast_mutex_unlock(&ss7->lock);
}
-static inline int ss7_grab(struct zt_pvt *pvt, struct zt_ss7 *pri)
+static inline int ss7_grab(struct dahdi_pvt *pvt, struct dahdi_ss7 *pri)
{
int res;
/* Grab the lock first */
static int num_cadence = 4;
static int user_has_defined_cadences = 0;
-static struct zt_ring_cadence cadences[NUM_CADENCE_MAX] = {
+static struct dahdi_ring_cadence cadences[NUM_CADENCE_MAX] = {
{ { 125, 125, 2000, 4000 } }, /*!< Quick chirp followed by normal ring */
{ { 250, 250, 500, 1000, 250, 250, 500, 4000 } }, /*!< British style ring */
{ { 125, 125, 125, 125, 125, 4000 } }, /*!< Three short bursts */
#define ISTRUNK(p) ((p->sig == SIG_FXSLS) || (p->sig == SIG_FXSKS) || \
(p->sig == SIG_FXSGS) || (p->sig == SIG_PRI))
-#define CANBUSYDETECT(p) (ISTRUNK(p) || (p->sig & (SIG_EM | SIG_EM_E1 | SIG_SF)) /* || (p->sig & __ZT_SIG_FXO) */)
-#define CANPROGRESSDETECT(p) (ISTRUNK(p) || (p->sig & (SIG_EM | SIG_EM_E1 | SIG_SF)) /* || (p->sig & __ZT_SIG_FXO) */)
+#define CANBUSYDETECT(p) (ISTRUNK(p) || (p->sig & (SIG_EM | SIG_EM_E1 | SIG_SF)) /* || (p->sig & __DAHDI_SIG_FXO) */)
+#define CANPROGRESSDETECT(p) (ISTRUNK(p) || (p->sig & (SIG_EM | SIG_EM_E1 | SIG_SF)) /* || (p->sig & __DAHDI_SIG_FXO) */)
-static int zt_get_index(struct ast_channel *ast, struct zt_pvt *p, int nullok)
+static int dahdi_get_index(struct ast_channel *ast, struct dahdi_pvt *p, int nullok)
{
int res;
if (p->subs[0].owner == ast)
}
#ifdef HAVE_PRI
-static void wakeup_sub(struct zt_pvt *p, int a, struct zt_pri *pri)
+static void wakeup_sub(struct dahdi_pvt *p, int a, struct dahdi_pri *pri)
#else
-static void wakeup_sub(struct zt_pvt *p, int a, void *pri)
+static void wakeup_sub(struct dahdi_pvt *p, int a, void *pri)
#endif
{
#ifdef HAVE_PRI
#endif
}
-static void zap_queue_frame(struct zt_pvt *p, struct ast_frame *f, void *data)
+static void dahdi_queue_frame(struct dahdi_pvt *p, struct ast_frame *f, void *data)
{
#ifdef HAVE_PRI
- struct zt_pri *pri = (struct zt_pri*) data;
+ struct dahdi_pri *pri = (struct dahdi_pri*) data;
#endif
#ifdef HAVE_SS7
- struct zt_ss7 *ss7 = (struct zt_ss7*) data;
+ struct dahdi_ss7 *ss7 = (struct dahdi_ss7*) data;
#endif
/* We must unlock the PRI to avoid the possibility of a deadlock */
#if defined(HAVE_PRI) || defined(HAVE_SS7)
#endif
}
-static int restore_gains(struct zt_pvt *p);
+static int restore_gains(struct dahdi_pvt *p);
-static void swap_subs(struct zt_pvt *p, int a, int b)
+static void swap_subs(struct dahdi_pvt *p, int a, int b)
{
int tchan;
int tinthreeway;
wakeup_sub(p, b, NULL);
}
-static int zt_open(char *fn)
+static int dahdi_open(char *fn)
{
int fd;
int isnum;
ast_log(LOG_WARNING, "Invalid channel number '%s'\n", fn);
return -1;
}
- fn = "/dev/zap/channel";
+ fn = "/dev/dahdi/channel";
}
fd = open(fn, O_RDWR | O_NONBLOCK);
if (fd < 0) {
return -1;
}
if (chan) {
- if (ioctl(fd, ZT_SPECIFY, &chan)) {
+ if (ioctl(fd, DAHDI_SPECIFY, &chan)) {
x = errno;
close(fd);
errno = x;
}
}
bs = READ_SIZE;
- if (ioctl(fd, ZT_SET_BLOCKSIZE, &bs) == -1) {
+ if (ioctl(fd, DAHDI_SET_BLOCKSIZE, &bs) == -1) {
ast_log(LOG_WARNING, "Unable to set blocksize '%d': %s\n", bs, strerror(errno));
x = errno;
close(fd);
return fd;
}
-static void zt_close(int fd)
+static void dahdi_close(int fd)
{
if (fd > 0)
close(fd);
}
-static int zt_setlinear(int zfd, int linear)
+static int dahdi_setlinear(int zfd, int linear)
{
int res;
- res = ioctl(zfd, ZT_SETLINEAR, &linear);
+ res = ioctl(zfd, DAHDI_SETLINEAR, &linear);
if (res)
return res;
return 0;
}
-static int alloc_sub(struct zt_pvt *p, int x)
+static int alloc_sub(struct dahdi_pvt *p, int x)
{
- ZT_BUFFERINFO bi;
+ DAHDI_BUFFERINFO bi;
int res;
if (p->subs[x].zfd >= 0) {
ast_log(LOG_WARNING, "%s subchannel of %d already in use\n", subnames[x], p->channel);
return -1;
}
- p->subs[x].zfd = zt_open("/dev/zap/pseudo");
+ p->subs[x].zfd = dahdi_open("/dev/dahdi/pseudo");
if (p->subs[x].zfd <= -1) {
ast_log(LOG_WARNING, "Unable to open pseudo channel: %s\n", strerror(errno));
return -1;
}
- res = ioctl(p->subs[x].zfd, ZT_GET_BUFINFO, &bi);
+ res = ioctl(p->subs[x].zfd, DAHDI_GET_BUFINFO, &bi);
if (!res) {
- bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
- bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
+ bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
+ bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.numbufs = numbufs;
- res = ioctl(p->subs[x].zfd, ZT_SET_BUFINFO, &bi);
+ res = ioctl(p->subs[x].zfd, DAHDI_SET_BUFINFO, &bi);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to set buffer policy on channel %d\n", x);
}
} else
ast_log(LOG_WARNING, "Unable to check buffer policy on channel %d\n", x);
- if (ioctl(p->subs[x].zfd, ZT_CHANNO, &p->subs[x].chan) == 1) {
+ if (ioctl(p->subs[x].zfd, DAHDI_CHANNO, &p->subs[x].chan) == 1) {
ast_log(LOG_WARNING, "Unable to get channel number for pseudo channel on FD %d\n", p->subs[x].zfd);
- zt_close(p->subs[x].zfd);
+ dahdi_close(p->subs[x].zfd);
p->subs[x].zfd = -1;
return -1;
}
return 0;
}
-static int unalloc_sub(struct zt_pvt *p, int x)
+static int unalloc_sub(struct dahdi_pvt *p, int x)
{
if (!x) {
ast_log(LOG_WARNING, "Trying to unalloc the real channel %d?!?\n", p->channel);
}
ast_debug(1, "Released sub %d of channel %d\n", x, p->channel);
if (p->subs[x].zfd > -1) {
- zt_close(p->subs[x].zfd);
+ dahdi_close(p->subs[x].zfd);
}
p->subs[x].zfd = -1;
p->subs[x].linear = 0;
static int digit_to_dtmfindex(char digit)
{
if (isdigit(digit))
- return ZT_TONE_DTMF_BASE + (digit - '0');
+ return DAHDI_TONE_DTMF_BASE + (digit - '0');
else if (digit >= 'A' && digit <= 'D')
- return ZT_TONE_DTMF_A + (digit - 'A');
+ return DAHDI_TONE_DTMF_A + (digit - 'A');
else if (digit >= 'a' && digit <= 'd')
- return ZT_TONE_DTMF_A + (digit - 'a');
+ return DAHDI_TONE_DTMF_A + (digit - 'a');
else if (digit == '*')
- return ZT_TONE_DTMF_s;
+ return DAHDI_TONE_DTMF_s;
else if (digit == '#')
- return ZT_TONE_DTMF_p;
+ return DAHDI_TONE_DTMF_p;
else
return -1;
}
-static int zt_digit_begin(struct ast_channel *chan, char digit)
+static int dahdi_digit_begin(struct ast_channel *chan, char digit)
{
- struct zt_pvt *pvt;
+ struct dahdi_pvt *pvt;
int index;
int dtmf = -1;
ast_mutex_lock(&pvt->lock);
- index = zt_get_index(chan, pvt, 0);
+ index = dahdi_get_index(chan, pvt, 0);
if ((index != SUB_REAL) || !pvt->owner)
goto out;
if ((dtmf = digit_to_dtmfindex(digit)) == -1)
goto out;
- if (pvt->pulse || ioctl(pvt->subs[SUB_REAL].zfd, ZT_SENDTONE, &dtmf)) {
+ if (pvt->pulse || ioctl(pvt->subs[SUB_REAL].zfd, DAHDI_SENDTONE, &dtmf)) {
int res;
- ZT_DIAL_OPERATION zo = {
- .op = ZT_DIAL_OP_APPEND,
+ DAHDI_DIAL_OPERATION zo = {
+ .op = DAHDI_DIAL_OP_APPEND,
};
zo.dialstr[0] = 'T';
zo.dialstr[1] = digit;
zo.dialstr[2] = '\0';
- if ((res = ioctl(pvt->subs[SUB_REAL].zfd, ZT_DIAL, &zo)))
+ if ((res = ioctl(pvt->subs[SUB_REAL].zfd, DAHDI_DIAL, &zo)))
ast_log(LOG_WARNING, "Couldn't dial digit %c\n", digit);
else
pvt->dialing = 1;
return 0;
}
-static int zt_digit_end(struct ast_channel *chan, char digit, unsigned int duration)
+static int dahdi_digit_end(struct ast_channel *chan, char digit, unsigned int duration)
{
- struct zt_pvt *pvt;
+ struct dahdi_pvt *pvt;
int res = 0;
int index;
int x;
ast_mutex_lock(&pvt->lock);
- index = zt_get_index(chan, pvt, 0);
+ index = dahdi_get_index(chan, pvt, 0);
if ((index != SUB_REAL) || !pvt->owner || pvt->pulse)
goto out;
if (pvt->begindigit) {
x = -1;
ast_debug(1, "Ending VLDTMF digit '%c'\n", digit);
- res = ioctl(pvt->subs[SUB_REAL].zfd, ZT_SENDTONE, &x);
+ res = ioctl(pvt->subs[SUB_REAL].zfd, DAHDI_SENDTONE, &x);
pvt->dialing = 0;
pvt->begindigit = 0;
}
int alarm;
char *name;
} alarms[] = {
- { ZT_ALARM_RED, "Red Alarm" },
- { ZT_ALARM_YELLOW, "Yellow Alarm" },
- { ZT_ALARM_BLUE, "Blue Alarm" },
- { ZT_ALARM_RECOVER, "Recovering" },
- { ZT_ALARM_LOOPBACK, "Loopback" },
- { ZT_ALARM_NOTOPEN, "Not Open" },
- { ZT_ALARM_NONE, "None" },
+ { DAHDI_ALARM_RED, "Red Alarm" },
+ { DAHDI_ALARM_YELLOW, "Yellow Alarm" },
+ { DAHDI_ALARM_BLUE, "Blue Alarm" },
+ { DAHDI_ALARM_RECOVER, "Recovering" },
+ { DAHDI_ALARM_LOOPBACK, "Loopback" },
+ { DAHDI_ALARM_NOTOPEN, "Not Open" },
+ { DAHDI_ALARM_NONE, "None" },
};
static char *alarm2str(int alarm)
}
#endif
-static char *zap_sig2str(int sig)
+static char *dahdi_sig2str(int sig)
{
static char buf[256];
switch (sig) {
}
}
-#define sig2str zap_sig2str
+#define sig2str dahdi_sig2str
-static int conf_add(struct zt_pvt *p, struct zt_subchannel *c, int index, int slavechannel)
+static int conf_add(struct dahdi_pvt *p, struct dahdi_subchannel *c, int index, int slavechannel)
{
/* If the conference already exists, and we're already in it
don't bother doing anything */
- ZT_CONFINFO zi;
+ DAHDI_CONFINFO zi;
memset(&zi, 0, sizeof(zi));
zi.chan = 0;
if (slavechannel > 0) {
/* If we have only one slave, do a digital mon */
- zi.confmode = ZT_CONF_DIGITALMON;
+ zi.confmode = DAHDI_CONF_DIGITALMON;
zi.confno = slavechannel;
} else {
if (!index) {
/* Real-side and pseudo-side both participate in conference */
- zi.confmode = ZT_CONF_REALANDPSEUDO | ZT_CONF_TALKER | ZT_CONF_LISTENER |
- ZT_CONF_PSEUDO_TALKER | ZT_CONF_PSEUDO_LISTENER;
+ zi.confmode = DAHDI_CONF_REALANDPSEUDO | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER |
+ DAHDI_CONF_PSEUDO_TALKER | DAHDI_CONF_PSEUDO_LISTENER;
} else
- zi.confmode = ZT_CONF_CONF | ZT_CONF_TALKER | ZT_CONF_LISTENER;
+ zi.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
zi.confno = p->confno;
}
if ((zi.confno == c->curconf.confno) && (zi.confmode == c->curconf.confmode))
return 0;
if (c->zfd < 0)
return 0;
- if (ioctl(c->zfd, ZT_SETCONF, &zi)) {
+ if (ioctl(c->zfd, DAHDI_SETCONF, &zi)) {
ast_log(LOG_WARNING, "Failed to add %d to conference %d/%d\n", c->zfd, zi.confmode, zi.confno);
return -1;
}
return 0;
}
-static int isourconf(struct zt_pvt *p, struct zt_subchannel *c)
+static int isourconf(struct dahdi_pvt *p, struct dahdi_subchannel *c)
{
/* If they're listening to our channel, they're ours */
- if ((p->channel == c->curconf.confno) && (c->curconf.confmode == ZT_CONF_DIGITALMON))
+ if ((p->channel == c->curconf.confno) && (c->curconf.confmode == DAHDI_CONF_DIGITALMON))
return 1;
/* If they're a talker on our (allocated) conference, they're ours */
- if ((p->confno > 0) && (p->confno == c->curconf.confno) && (c->curconf.confmode & ZT_CONF_TALKER))
+ if ((p->confno > 0) && (p->confno == c->curconf.confno) && (c->curconf.confmode & DAHDI_CONF_TALKER))
return 1;
return 0;
}
-static int conf_del(struct zt_pvt *p, struct zt_subchannel *c, int index)
+static int conf_del(struct dahdi_pvt *p, struct dahdi_subchannel *c, int index)
{
- ZT_CONFINFO zi;
+ DAHDI_CONFINFO zi;
if (/* Can't delete if there's no zfd */
(c->zfd < 0) ||
/* Don't delete from the conference if it's not our conference */
zi.chan = 0;
zi.confno = 0;
zi.confmode = 0;
- if (ioctl(c->zfd, ZT_SETCONF, &zi)) {
+ if (ioctl(c->zfd, DAHDI_SETCONF, &zi)) {
ast_log(LOG_WARNING, "Failed to drop %d from conference %d/%d\n", c->zfd, c->curconf.confmode, c->curconf.confno);
return -1;
}
return 0;
}
-static int isslavenative(struct zt_pvt *p, struct zt_pvt **out)
+static int isslavenative(struct dahdi_pvt *p, struct dahdi_pvt **out)
{
int x;
int useslavenative;
- struct zt_pvt *slave = NULL;
+ struct dahdi_pvt *slave = NULL;
/* Start out optimistic */
useslavenative = 1;
/* Update conference state in a stateless fashion */
return useslavenative;
}
-static int reset_conf(struct zt_pvt *p)
+static int reset_conf(struct dahdi_pvt *p)
{
- ZT_CONFINFO zi;
+ DAHDI_CONFINFO zi;
memset(&zi, 0, sizeof(zi));
p->confno = -1;
memset(&p->subs[SUB_REAL].curconf, 0, sizeof(p->subs[SUB_REAL].curconf));
if (p->subs[SUB_REAL].zfd > -1) {
- if (ioctl(p->subs[SUB_REAL].zfd, ZT_SETCONF, &zi))
+ if (ioctl(p->subs[SUB_REAL].zfd, DAHDI_SETCONF, &zi))
ast_log(LOG_WARNING, "Failed to reset conferencing on channel %d!\n", p->channel);
}
return 0;
}
-static int update_conf(struct zt_pvt *p)
+static int update_conf(struct dahdi_pvt *p)
{
int needconf = 0;
int x;
int useslavenative;
- struct zt_pvt *slave = NULL;
+ struct dahdi_pvt *slave = NULL;
useslavenative = isslavenative(p, &slave);
/* Start with the obvious, general stuff */
return 0;
}
-static void zt_enable_ec(struct zt_pvt *p)
+static void dahdi_enable_ec(struct dahdi_pvt *p)
{
int x;
int res;
ast_debug(1, "Echo cancellation isn't required on digital connection\n");
return;
}
-#if defined(HAVE_ZAPTEL_ECHOCANPARAMS)
if (p->echocancel.head.tap_length) {
-#else
- if (p->echocancel) {
-#endif
if ((p->sig == SIG_BRI) || (p->sig == SIG_BRI_PTMP) || (p->sig == SIG_PRI) || (p->sig == SIG_SS7)) {
x = 1;
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_AUDIOMODE, &x);
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_AUDIOMODE, &x);
if (res)
ast_log(LOG_WARNING, "Unable to enable audio mode on channel %d (%s)\n", p->channel, strerror(errno));
}
-#if defined(HAVE_ZAPTEL_ECHOCANPARAMS)
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_ECHOCANCEL_PARAMS, &p->echocancel);
-#else
- x = p->echocancel;
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_ECHOCANCEL, &x);
-#endif
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_ECHOCANCEL_PARAMS, &p->echocancel);
if (res) {
ast_log(LOG_WARNING, "Unable to enable echo cancellation on channel %d (%s)\n", p->channel, strerror(errno));
} else {
ast_debug(1, "No echo cancellation requested\n");
}
-static void zt_train_ec(struct zt_pvt *p)
+static void dahdi_train_ec(struct dahdi_pvt *p)
{
int x;
int res;
if (p && p->echocanon && p->echotraining) {
x = p->echotraining;
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_ECHOTRAIN, &x);
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_ECHOTRAIN, &x);
if (res)
ast_log(LOG_WARNING, "Unable to request echo training on channel %d\n", p->channel);
else
}
}
-static void zt_disable_ec(struct zt_pvt *p)
+static void dahdi_disable_ec(struct dahdi_pvt *p)
{
int res;
if (p->echocanon) {
-#if defined(HAVE_ZAPTEL_ECHOCANPARAMS)
- struct zt_echocanparams ecp = { .tap_length = 0 };
-
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_ECHOCANCEL_PARAMS, &ecp);
-#else
- int x = 0;
+ struct dahdi_echocanparams ecp = { .tap_length = 0 };
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_ECHOCANCEL, &x);
-#endif
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_ECHOCANCEL_PARAMS, &ecp);
if (res)
ast_log(LOG_WARNING, "Unable to disable echo cancellation on channel %d\n", p->channel);
p->echocanon = 0;
}
-static void fill_txgain(struct zt_gains *g, float gain, int law)
+static void fill_txgain(struct dahdi_gains *g, float gain, int law)
{
int j;
int k;
float linear_gain = pow(10.0, gain / 20.0);
switch (law) {
- case ZT_LAW_ALAW:
+ case DAHDI_LAW_ALAW:
for (j = 0; j < (sizeof(g->txgain) / sizeof(g->txgain[0])); j++) {
if (gain) {
k = (int) (((float) AST_ALAW(j)) * linear_gain);
}
}
break;
- case ZT_LAW_MULAW:
+ case DAHDI_LAW_MULAW:
for (j = 0; j < (sizeof(g->txgain) / sizeof(g->txgain[0])); j++) {
if (gain) {
k = (int) (((float) AST_MULAW(j)) * linear_gain);
}
}
-static void fill_rxgain(struct zt_gains *g, float gain, int law)
+static void fill_rxgain(struct dahdi_gains *g, float gain, int law)
{
int j;
int k;
float linear_gain = pow(10.0, gain / 20.0);
switch (law) {
- case ZT_LAW_ALAW:
+ case DAHDI_LAW_ALAW:
for (j = 0; j < (sizeof(g->rxgain) / sizeof(g->rxgain[0])); j++) {
if (gain) {
k = (int) (((float) AST_ALAW(j)) * linear_gain);
}
}
break;
- case ZT_LAW_MULAW:
+ case DAHDI_LAW_MULAW:
for (j = 0; j < (sizeof(g->rxgain) / sizeof(g->rxgain[0])); j++) {
if (gain) {
k = (int) (((float) AST_MULAW(j)) * linear_gain);
static int set_actual_txgain(int fd, int chan, float gain, int law)
{
- struct zt_gains g;
+ struct dahdi_gains g;
int res;
memset(&g, 0, sizeof(g));
g.chan = chan;
- res = ioctl(fd, ZT_GETGAINS, &g);
+ res = ioctl(fd, DAHDI_GETGAINS, &g);
if (res) {
ast_debug(1, "Failed to read gains: %s\n", strerror(errno));
return res;
fill_txgain(&g, gain, law);
- return ioctl(fd, ZT_SETGAINS, &g);
+ return ioctl(fd, DAHDI_SETGAINS, &g);
}
static int set_actual_rxgain(int fd, int chan, float gain, int law)
{
- struct zt_gains g;
+ struct dahdi_gains g;
int res;
memset(&g, 0, sizeof(g));
g.chan = chan;
- res = ioctl(fd, ZT_GETGAINS, &g);
+ res = ioctl(fd, DAHDI_GETGAINS, &g);
if (res) {
ast_debug(1, "Failed to read gains: %s\n", strerror(errno));
return res;
fill_rxgain(&g, gain, law);
- return ioctl(fd, ZT_SETGAINS, &g);
+ return ioctl(fd, DAHDI_SETGAINS, &g);
}
static int set_actual_gain(int fd, int chan, float rxgain, float txgain, int law)
return set_actual_txgain(fd, chan, txgain, law) | set_actual_rxgain(fd, chan, rxgain, law);
}
-static int bump_gains(struct zt_pvt *p)
+static int bump_gains(struct dahdi_pvt *p)
{
int res;
return 0;
}
-static int restore_gains(struct zt_pvt *p)
+static int restore_gains(struct dahdi_pvt *p)
{
int res;
return 0;
}
-static inline int zt_set_hook(int fd, int hs)
+static inline int dahdi_set_hook(int fd, int hs)
{
int x, res;
x = hs;
- res = ioctl(fd, ZT_HOOK, &x);
+ res = ioctl(fd, DAHDI_HOOK, &x);
if (res < 0) {
if (errno == EINPROGRESS)
return 0;
- ast_log(LOG_WARNING, "zt hook failed: %s\n", strerror(errno));
+ ast_log(LOG_WARNING, "DAHDI hook failed: %s\n", strerror(errno));
}
return res;
}
-static inline int zt_confmute(struct zt_pvt *p, int muted)
+static inline int dahdi_confmute(struct dahdi_pvt *p, int muted)
{
int x, y, res;
x = muted;
if ((p->sig == SIG_PRI) || (p->sig == SIG_SS7) || (p->sig == SIG_BRI) || (p->sig == SIG_BRI_PTMP)) {
y = 1;
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_AUDIOMODE, &y);
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_AUDIOMODE, &y);
if (res)
ast_log(LOG_WARNING, "Unable to set audio mode on '%d'\n", p->channel);
}
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_CONFMUTE, &x);
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_CONFMUTE, &x);
if (res < 0)
- ast_log(LOG_WARNING, "zt confmute(%d) failed on channel %d: %s\n", muted, p->channel, strerror(errno));
+ ast_log(LOG_WARNING, "DAHDI confmute(%d) failed on channel %d: %s\n", muted, p->channel, strerror(errno));
return res;
}
-static int save_conference(struct zt_pvt *p)
+static int save_conference(struct dahdi_pvt *p)
{
- struct zt_confinfo c;
+ struct dahdi_confinfo c;
int res;
if (p->saveconf.confmode) {
ast_log(LOG_WARNING, "Can't save conference -- already in use\n");
return -1;
}
p->saveconf.chan = 0;
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_GETCONF, &p->saveconf);
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_GETCONF, &p->saveconf);
if (res) {
ast_log(LOG_WARNING, "Unable to get conference info: %s\n", strerror(errno));
p->saveconf.confmode = 0;
}
c.chan = 0;
c.confno = 0;
- c.confmode = ZT_CONF_NORMAL;
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_SETCONF, &c);
+ c.confmode = DAHDI_CONF_NORMAL;
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_SETCONF, &c);
if (res) {
ast_log(LOG_WARNING, "Unable to set conference info: %s\n", strerror(errno));
return -1;
}
}
-static int restore_conference(struct zt_pvt *p)
+static int restore_conference(struct dahdi_pvt *p)
{
int res;
if (p->saveconf.confmode) {
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_SETCONF, &p->saveconf);
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_SETCONF, &p->saveconf);
p->saveconf.confmode = 0;
if (res) {
ast_log(LOG_WARNING, "Unable to restore conference info: %s\n", strerror(errno));
return 0;
}
-static int send_callerid(struct zt_pvt *p);
+static int send_callerid(struct dahdi_pvt *p);
-static int send_cwcidspill(struct zt_pvt *p)
+static int send_cwcidspill(struct dahdi_pvt *p)
{
p->callwaitcas = 0;
p->cidcwexpire = 0;
return 0;
}
-static int has_voicemail(struct zt_pvt *p)
+static int has_voicemail(struct dahdi_pvt *p)
{
int new_msgs;
struct ast_event *event;
return new_msgs;
}
-static int send_callerid(struct zt_pvt *p)
+static int send_callerid(struct dahdi_pvt *p)
{
/* Assumes spill in p->cidspill, p->cidlen in length and we're p->cidpos into it */
int res;
/* Take out of linear mode if necessary */
if (p->subs[SUB_REAL].linear) {
p->subs[SUB_REAL].linear = 0;
- zt_setlinear(p->subs[SUB_REAL].zfd, 0);
+ dahdi_setlinear(p->subs[SUB_REAL].zfd, 0);
}
while (p->cidpos < p->cidlen) {
res = write(p->subs[SUB_REAL].zfd, p->cidspill + p->cidpos, p->cidlen - p->cidpos);
return 0;
}
-static int zt_callwait(struct ast_channel *ast)
+static int dahdi_callwait(struct ast_channel *ast)
{
- struct zt_pvt *p = ast->tech_pvt;
+ struct dahdi_pvt *p = ast->tech_pvt;
p->callwaitingrepeat = CALLWAITING_REPEAT_SAMPLES;
if (p->cidspill) {
ast_log(LOG_WARNING, "Spill already exists?!?\n");
}
#endif
-static int zt_call(struct ast_channel *ast, char *rdest, int timeout)
+static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout)
{
- struct zt_pvt *p = ast->tech_pvt;
+ struct dahdi_pvt *p = ast->tech_pvt;
int x, res, index,mysig;
char *c, *n, *l;
#ifdef HAVE_PRI
return 0;
}
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
- ast_log(LOG_WARNING, "zt_call called on %s, neither down nor reserved\n", ast->name);
+ ast_log(LOG_WARNING, "dahdi_call called on %s, neither down nor reserved\n", ast->name);
ast_mutex_unlock(&p->lock);
return -1;
}
ast_mutex_unlock(&p->lock);
return 0;
}
- x = ZT_FLUSH_READ | ZT_FLUSH_WRITE;
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_FLUSH, &x);
+ x = DAHDI_FLUSH_READ | DAHDI_FLUSH_WRITE;
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_FLUSH, &x);
if (res)
ast_log(LOG_WARNING, "Unable to flush input on channel %d\n", p->channel);
p->outgoing = 1;
}
/* Choose proper cadence */
if ((p->distinctivering > 0) && (p->distinctivering <= num_cadence)) {
- if (ioctl(p->subs[SUB_REAL].zfd, ZT_SETCADENCE, &cadences[p->distinctivering - 1]))
+ if (ioctl(p->subs[SUB_REAL].zfd, DAHDI_SETCADENCE, &cadences[p->distinctivering - 1]))
ast_log(LOG_WARNING, "Unable to set distinctive ring cadence %d on '%s'\n", p->distinctivering, ast->name);
p->cidrings = cidrings[p->distinctivering - 1];
} else {
- if (ioctl(p->subs[SUB_REAL].zfd, ZT_SETCADENCE, NULL))
+ if (ioctl(p->subs[SUB_REAL].zfd, DAHDI_SETCADENCE, NULL))
ast_log(LOG_WARNING, "Unable to reset default ring on '%s'\n", ast->name);
p->cidrings = p->sendcalleridafter;
}
c = NULL;
}
if (c) {
- p->dop.op = ZT_DIAL_OP_REPLACE;
+ p->dop.op = DAHDI_DIAL_OP_REPLACE;
snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "Tw%s", c);
ast_debug(1, "FXO: setup deferred dialstring: %s\n", c);
} else {
p->dop.dialstr[0] = '\0';
}
- x = ZT_RING;
- if (ioctl(p->subs[SUB_REAL].zfd, ZT_HOOK, &x) && (errno != EINPROGRESS)) {
+ x = DAHDI_RING;
+ if (ioctl(p->subs[SUB_REAL].zfd, DAHDI_HOOK, &x) && (errno != EINPROGRESS)) {
ast_log(LOG_WARNING, "Unable to ring phone: %s\n", strerror(errno));
ast_mutex_unlock(&p->lock);
return -1;
else
p->callwait_name[0] = '\0';
/* Call waiting tone instead */
- if (zt_callwait(ast)) {
+ if (dahdi_callwait(ast)) {
ast_mutex_unlock(&p->lock);
return -1;
}
/* Make ring-back */
- if (tone_zone_play_tone(p->subs[SUB_CALLWAIT].zfd, ZT_TONE_RINGTONE))
+ if (tone_zone_play_tone(p->subs[SUB_CALLWAIT].zfd, DAHDI_TONE_RINGTONE))
ast_log(LOG_WARNING, "Unable to generate call-wait ring-back on channel %s\n", ast->name);
}
else
p->lastcid_name[0] = '\0';
ast_setstate(ast, AST_STATE_RINGING);
- index = zt_get_index(ast, p, 0);
+ index = dahdi_get_index(ast, p, 0);
if (index > -1) {
p->subs[index].needringing = 1;
}
/* Start the trunk, if not GR-303 */
if (!p->pri) {
#endif
- x = ZT_START;
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_HOOK, &x);
+ x = DAHDI_START;
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_HOOK, &x);
if (res < 0) {
if (errno != EINPROGRESS) {
ast_log(LOG_WARNING, "Unable to start channel: %s\n", strerror(errno));
}
#endif
ast_debug(1, "Dialing '%s'\n", c);
- p->dop.op = ZT_DIAL_OP_REPLACE;
+ p->dop.op = DAHDI_DIAL_OP_REPLACE;
c += p->stripmsd;
} else
p->echobreak = 0;
if (!res) {
- if (ioctl(p->subs[SUB_REAL].zfd, ZT_DIAL, &p->dop)) {
- x = ZT_ONHOOK;
- ioctl(p->subs[SUB_REAL].zfd, ZT_HOOK, &x);
+ if (ioctl(p->subs[SUB_REAL].zfd, DAHDI_DIAL, &p->dop)) {
+ x = DAHDI_ONHOOK;
+ ioctl(p->subs[SUB_REAL].zfd, DAHDI_HOOK, &x);
ast_log(LOG_WARNING, "Dialing failed on channel %d: %s\n", p->channel, strerror(errno));
ast_mutex_unlock(&p->lock);
return -1;
return -1;
}
if (mysig != SIG_FXSKS) {
- p->dop.op = ZT_DIAL_OP_REPLACE;
+ p->dop.op = DAHDI_DIAL_OP_REPLACE;
s = strchr(c + p->stripmsd, 'w');
if (s) {
if (strlen(s) > 1)
}
if (!(sr = pri_sr_new())) {
ast_log(LOG_WARNING, "Failed to allocate setup request channel %d\n", p->channel);
- pri_destroycall(p->pri->pri, p->call);
- p->call = NULL;
pri_rel(p->pri);
ast_mutex_unlock(&p->lock);
- return -1;
}
if (p->bearer || (mysig == SIG_FXSKS)) {
if (p->bearer) {
pri_sr_set_channel(sr, p->bearer ? PVT_TO_CHANNEL(p->bearer) : PVT_TO_CHANNEL(p), exclusive, 1);
pri_sr_set_bearer(sr, p->digital ? PRI_TRANS_CAP_DIGITAL : ast->transfercapability,
(p->digital ? -1 :
- ((p->law == ZT_LAW_ALAW) ? PRI_LAYER_1_ALAW : PRI_LAYER_1_ULAW)));
+ ((p->law == DAHDI_LAW_ALAW) ? PRI_LAYER_1_ALAW : PRI_LAYER_1_ULAW)));
if (p->pri->facilityenable)
pri_facility_enable(p->pri->pri);
return 0;
}
-static void destroy_zt_pvt(struct zt_pvt **pvt)
+static void destroy_dahdi_pvt(struct dahdi_pvt **pvt)
{
- struct zt_pvt *p = *pvt;
+ struct dahdi_pvt *p = *pvt;
/* Remove channel from the list */
if (p->prev)
p->prev->next = p->next;
*pvt = NULL;
}
-static int destroy_channel(struct zt_pvt *prev, struct zt_pvt *cur, int now)
+static int destroy_channel(struct dahdi_pvt *prev, struct dahdi_pvt *cur, int now)
{
int owned = 0;
int i = 0;
ifend = NULL;
}
if (cur->subs[SUB_REAL].zfd > -1) {
- zt_close(cur->subs[SUB_REAL].zfd);
+ dahdi_close(cur->subs[SUB_REAL].zfd);
}
- destroy_zt_pvt(&cur);
+ destroy_dahdi_pvt(&cur);
}
} else {
if (prev) {
ifend = NULL;
}
if (cur->subs[SUB_REAL].zfd > -1) {
- zt_close(cur->subs[SUB_REAL].zfd);
+ dahdi_close(cur->subs[SUB_REAL].zfd);
}
- destroy_zt_pvt(&cur);
+ destroy_dahdi_pvt(&cur);
}
return 0;
}
#ifdef HAVE_PRI
-static char *zap_send_keypad_facility_app = "ZapSendKeypadFacility";
+static char *dahdi_send_keypad_facility_app = "DAHDISendKeypadFacility";
-static char *zap_send_keypad_facility_synopsis = "Send digits out of band over a PRI";
+static char *dahdi_send_keypad_facility_synopsis = "Send digits out of band over a PRI";
-static char *zap_send_keypad_facility_descrip =
-" ZapSendKeypadFacility(): This application will send the given string of digits in a Keypad Facility\n"
+static char *dahdi_send_keypad_facility_descrip =
+" DAHDISendKeypadFacility(): This application will send the given string of digits in a Keypad Facility\n"
" IE over the current channel.\n";
-static int zap_send_keypad_facility_exec(struct ast_channel *chan, void *data)
+static int dahdi_send_keypad_facility_exec(struct ast_channel *chan, void *data)
{
/* Data will be our digit string */
- struct zt_pvt *p;
+ struct dahdi_pvt *p;
char *digits = (char *) data;
if (ast_strlen_zero(digits)) {
return -1;
}
- p = (struct zt_pvt *)chan->tech_pvt;
+ p = (struct dahdi_pvt *)chan->tech_pvt;
if (!p) {
ast_debug(1, "Unable to find technology private\n");
return 0;
}
-static int pri_is_up(struct zt_pri *pri)
+static int pri_is_up(struct dahdi_pri *pri)
{
int x;
for (x = 0; x < NUM_DCHANS; x++) {
return 0;
}
-static int pri_assign_bearer(struct zt_pvt *crv, struct zt_pri *pri, struct zt_pvt *bearer)
+static int pri_assign_bearer(struct dahdi_pvt *crv, struct dahdi_pri *pri, struct dahdi_pvt *bearer)
{
bearer->owner = &inuse;
bearer->realcall = crv;
}
/* Returns fd of the active dchan */
-static int pri_active_dchan_fd(struct zt_pri *pri)
+static int pri_active_dchan_fd(struct dahdi_pri *pri)
{
int x = -1;
return pri->fds[x];
}
-static int pri_find_dchan(struct zt_pri *pri)
+static int pri_find_dchan(struct dahdi_pri *pri)
{
int oldslot = -1;
struct pri *old;
}
#endif
-static int zt_hangup(struct ast_channel *ast)
+static int dahdi_hangup(struct ast_channel *ast)
{
int res;
int index,x, law;
- /*static int restore_gains(struct zt_pvt *p);*/
- struct zt_pvt *p = ast->tech_pvt;
- struct zt_pvt *tmp = NULL;
- struct zt_pvt *prev = NULL;
- ZT_PARAMS par;
+ /*static int restore_gains(struct dahdi_pvt *p);*/
+ struct dahdi_pvt *p = ast->tech_pvt;
+ struct dahdi_pvt *tmp = NULL;
+ struct dahdi_pvt *prev = NULL;
+ DAHDI_PARAMS par;
- ast_debug(1, "zt_hangup(%s)\n", ast->name);
+ ast_debug(1, "dahdi_hangup(%s)\n", ast->name);
if (!ast->tech_pvt) {
ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
return 0;
ast_mutex_lock(&p->lock);
- index = zt_get_index(ast, p, 1);
+ index = dahdi_get_index(ast, p, 1);
if ((p->sig == SIG_PRI) || (p->sig == SIG_SS7) || (p->sig == SIG_BRI) || (p->sig == SIG_BRI_PTMP)) {
x = 1;
}
x = 0;
- zt_confmute(p, 0);
+ dahdi_confmute(p, 0);
p->muting = 0;
restore_gains(p);
if (p->origcid_num) {
p->subs[index].linear = 0;
p->subs[index].needcallerid = 0;
p->polarity = POLARITY_IDLE;
- zt_setlinear(p->subs[index].zfd, 0);
+ dahdi_setlinear(p->subs[index].zfd, 0);
if (index == SUB_REAL) {
if ((p->subs[SUB_CALLWAIT].zfd > -1) && (p->subs[SUB_THREEWAY].zfd > -1)) {
ast_debug(1, "Normal call hung up with both three way call and a call waiting call in place?\n");
p->dsp = NULL;
}
- law = ZT_LAW_DEFAULT;
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_SETLAW, &law);
+ law = DAHDI_LAW_DEFAULT;
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_SETLAW, &law);
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 */
}
#endif
if (p->sig && ((p->sig != SIG_PRI) && (p->sig != SIG_SS7) && (p->sig != SIG_BRI) && (p->sig != SIG_BRI_PTMP)))
- res = zt_set_hook(p->subs[SUB_REAL].zfd, ZT_ONHOOK);
+ res = dahdi_set_hook(p->subs[SUB_REAL].zfd, DAHDI_ONHOOK);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to hangup line %s\n", ast->name);
}
case SIG_FXOGS:
case SIG_FXOLS:
case SIG_FXOKS:
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &par);
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_GET_PARAMS, &par);
if (!res) {
#if 0
ast_debug(1, "Hanging up channel %d, offhook = %d\n", p->channel, par.rxisoffhook);
#endif
/* If they're off hook, try playing congestion */
if ((par.rxisoffhook) && (!(p->radio || (p->oprmode < 0))))
- tone_zone_play_tone(p->subs[SUB_REAL].zfd, ZT_TONE_CONGESTION);
+ tone_zone_play_tone(p->subs[SUB_REAL].zfd, DAHDI_TONE_CONGESTION);
else
tone_zone_play_tone(p->subs[SUB_REAL].zfd, -1);
}
if (p->cidspill)
ast_free(p->cidspill);
if (p->sig)
- zt_disable_ec(p);
+ dahdi_disable_ec(p);
x = 0;
ast_channel_setoption(ast,AST_OPTION_TONE_VERIFY,&x,sizeof(char),0);
ast_channel_setoption(ast,AST_OPTION_TDD,&x,sizeof(char),0);
return 0;
}
-static int zt_answer(struct ast_channel *ast)
+static int dahdi_answer(struct ast_channel *ast)
{
- struct zt_pvt *p = ast->tech_pvt;
+ struct dahdi_pvt *p = ast->tech_pvt;
int res = 0;
int index;
int oldstate = ast->_state;
ast_setstate(ast, AST_STATE_UP);
ast_mutex_lock(&p->lock);
- index = zt_get_index(ast, p, 0);
+ index = dahdi_get_index(ast, p, 0);
if (index < 0)
index = SUB_REAL;
/* nothing to do if a radio channel */
if (p->hanguponpolarityswitch) {
p->polaritydelaytv = ast_tvnow();
}
- res = zt_set_hook(p->subs[SUB_REAL].zfd, ZT_OFFHOOK);
+ res = dahdi_set_hook(p->subs[SUB_REAL].zfd, DAHDI_OFFHOOK);
tone_zone_play_tone(p->subs[index].zfd, -1);
p->dialing = 0;
if ((index == SUB_REAL) && p->subs[SUB_THREEWAY].inthreeway) {
p->owner = p->subs[SUB_REAL].owner;
}
}
- if (p->sig & __ZT_SIG_FXS) {
- zt_enable_ec(p);
- zt_train_ec(p);
+ if (p->sig & __DAHDI_SIG_FXS) {
+ dahdi_enable_ec(p);
+ dahdi_train_ec(p);
}
break;
#ifdef HAVE_PRI
return res;
}
-static int zt_setoption(struct ast_channel *chan, int option, void *data, int datalen)
+static int dahdi_setoption(struct ast_channel *chan, int option, void *data, int datalen)
{
char *cp;
signed char *scp;
int x;
int index;
- struct zt_pvt *p = chan->tech_pvt, *pp;
+ struct dahdi_pvt *p = chan->tech_pvt, *pp;
struct oprmode *oprmode;
switch (option) {
case AST_OPTION_TXGAIN:
scp = (signed char *) data;
- index = zt_get_index(chan, p, 0);
+ index = dahdi_get_index(chan, p, 0);
if (index < 0) {
ast_log(LOG_WARNING, "No index in TXGAIN?\n");
return -1;
return set_actual_txgain(p->subs[index].zfd, 0, p->txgain + (float) *scp, p->law);
case AST_OPTION_RXGAIN:
scp = (signed char *) data;
- index = zt_get_index(chan, p, 0);
+ index = dahdi_get_index(chan, p, 0);
if (index < 0) {
ast_log(LOG_WARNING, "No index in RXGAIN?\n");
return -1;
}
ast_debug(1, "Set option TDD MODE, value: %s(%d) on %s\n",
(*cp == 2) ? "MATE" : "ON", (int) *cp, chan->name);
- zt_disable_ec(p);
+ dahdi_disable_ec(p);
/* otherwise, turn it on */
if (!p->didtdd) { /* if havent done it yet */
unsigned char mybuf[41000], *buf;
memset(buf, 0x7f, sizeof(mybuf)); /* set to silence */
ast_tdd_gen_ecdisa(buf + 16000, 16000); /* put in tone */
len = 40000;
- index = zt_get_index(chan, p, 0);
+ index = dahdi_get_index(chan, p, 0);
if (index < 0) {
ast_log(LOG_WARNING, "No index in TDD?\n");
return -1;
if (!*cp) {
ast_debug(1, "Set option AUDIO MODE, value: OFF(0) on %s\n", chan->name);
x = 0;
- zt_disable_ec(p);
+ dahdi_disable_ec(p);
} else {
ast_debug(1, "Set option AUDIO MODE, value: ON(1) on %s\n", chan->name);
x = 1;
}
- if (ioctl(p->subs[SUB_REAL].zfd, ZT_AUDIOMODE, &x) == -1)
+ if (ioctl(p->subs[SUB_REAL].zfd, DAHDI_AUDIOMODE, &x) == -1)
ast_log(LOG_WARNING, "Unable to set audio mode on channel %d to %d\n", p->channel, x);
break;
case AST_OPTION_OPRMODE: /* Operator services mode */
cp = (char *) data;
if (*cp) {
ast_debug(1, "Enabling echo cancelation on %s\n", chan->name);
- zt_enable_ec(p);
+ dahdi_enable_ec(p);
} else {
ast_debug(1, "Disabling echo cancelation on %s\n", chan->name);
- zt_disable_ec(p);
+ dahdi_disable_ec(p);
}
break;
}
return 0;
}
-static int zt_func_read(struct ast_channel *chan, const char *function, char *data, char *buf, size_t len)
+static int dahdi_func_read(struct ast_channel *chan, const char *function, char *data, char *buf, size_t len)
{
- struct zt_pvt *p = chan->tech_pvt;
+ struct dahdi_pvt *p = chan->tech_pvt;
if (!strcasecmp(data, "rxgain")) {
ast_mutex_lock(&p->lock);
}
-static void zt_unlink(struct zt_pvt *slave, struct zt_pvt *master, int needlock)
+static void dahdi_unlink(struct dahdi_pvt *slave, struct dahdi_pvt *master, int needlock)
{
/* Unlink a specific slave or all slaves/masters from a given master */
int x;
}
}
-static void zt_link(struct zt_pvt *slave, struct zt_pvt *master) {
+static void dahdi_link(struct dahdi_pvt *slave, struct dahdi_pvt *master) {
int x;
if (!slave || !master) {
ast_log(LOG_WARNING, "Tried to link to/from NULL??\n");
ast_debug(1, "Making %d slave to master %d at %d\n", slave->channel, master->channel, x);
}
-static void disable_dtmf_detect(struct zt_pvt *p)
+static void disable_dtmf_detect(struct dahdi_pvt *p)
{
-#ifdef ZT_TONEDETECT
+#ifdef DAHDI_TONEDETECT
int val;
#endif
p->ignoredtmf = 1;
-#ifdef ZT_TONEDETECT
+#ifdef DAHDI_TONEDETECT
val = 0;
- ioctl(p->subs[SUB_REAL].zfd, ZT_TONEDETECT, &val);
+ ioctl(p->subs[SUB_REAL].zfd, DAHDI_TONEDETECT, &val);
#endif
if (!p->hardwaredtmf && p->dsp) {
p->dsp_features &= ~DSP_FEATURE_DIGIT_DETECT;
}
}
-static void enable_dtmf_detect(struct zt_pvt *p)
+static void enable_dtmf_detect(struct dahdi_pvt *p)
{
-#ifdef ZT_TONEDETECT
+#ifdef DAHDI_TONEDETECT
int val;
#endif
p->ignoredtmf = 0;
-#ifdef ZT_TONEDETECT
- val = ZT_TONEDETECT_ON | ZT_TONEDETECT_MUTE;
- ioctl(p->subs[SUB_REAL].zfd, ZT_TONEDETECT, &val);
+#ifdef DAHDI_TONEDETECT
+ val = DAHDI_TONEDETECT_ON | DAHDI_TONEDETECT_MUTE;
+ ioctl(p->subs[SUB_REAL].zfd, DAHDI_TONEDETECT, &val);
#endif
if (!p->hardwaredtmf && p->dsp) {
p->dsp_features |= DSP_FEATURE_DIGIT_DETECT;
}
}
-static enum ast_bridge_result zt_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms)
+static enum ast_bridge_result dahdi_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms)
{
struct ast_channel *who;
- struct zt_pvt *p0, *p1, *op0, *op1;
- struct zt_pvt *master = NULL, *slave = NULL;
+ struct dahdi_pvt *p0, *p1, *op0, *op1;
+ struct dahdi_pvt *master = NULL, *slave = NULL;
struct ast_frame *f;
int inconf = 0;
int nothingok = 1;
return AST_BRIDGE_FAILED_NOWARN;
}
- oi0 = zt_get_index(c0, p0, 0);
- oi1 = zt_get_index(c1, p1, 0);
+ oi0 = dahdi_get_index(c0, p0, 0);
+ oi1 = dahdi_get_index(c1, p1, 0);
if ((oi0 < 0) || (oi1 < 0)) {
ast_channel_unlock(c0);
ast_channel_unlock(c1);
p1->subs[SUB_REAL].inthreeway &&
(p1->subs[SUB_REAL].owner->_state == AST_STATE_RINGING)) {
ast_debug(1, "Playing ringback on %s since %s is in a ringing three-way\n", c0->name, c1->name);
- tone_zone_play_tone(p0->subs[oi0].zfd, ZT_TONE_RINGTONE);
+ tone_zone_play_tone(p0->subs[oi0].zfd, DAHDI_TONE_RINGTONE);
os1 = p1->subs[SUB_REAL].owner->_state;
} else {
ast_debug(1, "Stopping tones on %d/%d talking to %d/%d\n", p0->channel, oi0, p1->channel, oi1);
p0->subs[SUB_REAL].inthreeway &&
(p0->subs[SUB_REAL].owner->_state == AST_STATE_RINGING)) {
ast_debug(1, "Playing ringback on %s since %s is in a ringing three-way\n", c1->name, c0->name);
- tone_zone_play_tone(p1->subs[oi1].zfd, ZT_TONE_RINGTONE);
+ tone_zone_play_tone(p1->subs[oi1].zfd, DAHDI_TONE_RINGTONE);
os0 = p0->subs[SUB_REAL].owner->_state;
} else {
ast_debug(1, "Stopping tones on %d/%d talking to %d/%d\n", p1->channel, oi1, p0->channel, oi0);
if ((oi0 == SUB_REAL) && (oi1 == SUB_REAL)) {
if (!p0->echocanbridged || !p1->echocanbridged) {
/* Disable echo cancellation if appropriate */
- zt_disable_ec(p0);
- zt_disable_ec(p1);
+ dahdi_disable_ec(p0);
+ dahdi_disable_ec(p1);
}
}
- zt_link(slave, master);
+ dahdi_link(slave, master);
master->inconference = inconf;
} else if (!nothingok)
ast_log(LOG_WARNING, "Can't link %d/%s with %d/%s\n", p0->channel, subnames[oi0], p1->channel, subnames[oi1]);
/* Native bridge failed */
if ((!master || !slave) && !nothingok) {
- zt_enable_ec(p0);
- zt_enable_ec(p1);
+ dahdi_enable_ec(p0);
+ dahdi_enable_ec(p1);
return AST_BRIDGE_FAILED;
}
p1 = c1->tech_pvt;
if (op0 == p0)
- i0 = zt_get_index(c0, p0, 1);
+ i0 = dahdi_get_index(c0, p0, 1);
if (op1 == p1)
- i1 = zt_get_index(c1, p1, 1);
+ i1 = dahdi_get_index(c1, p1, 1);
ast_channel_unlock(c0);
ast_channel_unlock(c1);
return_from_bridge:
if (op0 == p0)
- zt_enable_ec(p0);
+ dahdi_enable_ec(p0);
if (op1 == p1)
- zt_enable_ec(p1);
+ dahdi_enable_ec(p1);
if (!(flags & AST_BRIDGE_DTMF_CHANNEL_0) && (oi0 == SUB_REAL))
enable_dtmf_detect(op0);
if (!(flags & AST_BRIDGE_DTMF_CHANNEL_1) && (oi1 == SUB_REAL))
enable_dtmf_detect(op1);
- zt_unlink(slave, master, 1);
+ dahdi_unlink(slave, master, 1);
return res;
}
-static int zt_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
+static int dahdi_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
{
- struct zt_pvt *p = newchan->tech_pvt;
+ struct dahdi_pvt *p = newchan->tech_pvt;
int x;
ast_mutex_lock(&p->lock);
ast_debug(1, "New owner for channel %d is %s\n", p->channel, newchan->name);
for (x = 0; x < 3; x++)
if (p->subs[x].owner == oldchan) {
if (!x)
- zt_unlink(NULL, p, 0);
+ dahdi_unlink(NULL, p, 0);
p->subs[x].owner = newchan;
}
if (newchan->_state == AST_STATE_RINGING)
- zt_indicate(newchan, AST_CONTROL_RINGING, NULL, 0);
+ dahdi_indicate(newchan, AST_CONTROL_RINGING, NULL, 0);
update_conf(p);
ast_mutex_unlock(&p->lock);
return 0;
}
-static int zt_ring_phone(struct zt_pvt *p)
+static int dahdi_ring_phone(struct dahdi_pvt *p)
{
int x;
int res;
/* Make sure our transmit state is on hook */
x = 0;
- x = ZT_ONHOOK;
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_HOOK, &x);
+ x = DAHDI_ONHOOK;
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_HOOK, &x);
do {
- x = ZT_RING;
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_HOOK, &x);
+ x = DAHDI_RING;
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_HOOK, &x);
if (res) {
switch (errno) {
case EBUSY:
static void *ss_thread(void *data);
-static struct ast_channel *zt_new(struct zt_pvt *, int, int, int, int, int);
+static struct ast_channel *dahdi_new(struct dahdi_pvt *, int, int, int, int, int);
-static int attempt_transfer(struct zt_pvt *p)
+static int attempt_transfer(struct dahdi_pvt *p)
{
/* In order to transfer, we need at least one of the channels to
actually be in a call bridge. We can't conference two applications
ast_indicate(ast_bridged_channel(p->subs[SUB_REAL].owner), AST_CONTROL_RINGING);
}
if (p->subs[SUB_THREEWAY].owner->_state == AST_STATE_RING) {
- tone_zone_play_tone(p->subs[SUB_THREEWAY].zfd, ZT_TONE_RINGTONE);
+ tone_zone_play_tone(p->subs[SUB_THREEWAY].zfd, DAHDI_TONE_RINGTONE);
}
if (p->subs[SUB_REAL].owner->cdr) {
/* Move CDR from second channel to current one */
ast_indicate(ast_bridged_channel(p->subs[SUB_THREEWAY].owner), AST_CONTROL_RINGING);
}
if (p->subs[SUB_REAL].owner->_state == AST_STATE_RING) {
- tone_zone_play_tone(p->subs[SUB_REAL].zfd, ZT_TONE_RINGTONE);
+ tone_zone_play_tone(p->subs[SUB_REAL].zfd, DAHDI_TONE_RINGTONE);
}
if (p->subs[SUB_THREEWAY].owner->cdr) {
/* Move CDR from second channel to current one */
return 0;
}
-static int check_for_conference(struct zt_pvt *p)
+static int check_for_conference(struct dahdi_pvt *p)
{
- ZT_CONFINFO ci;
+ DAHDI_CONFINFO ci;
/* Fine if we already have a master, etc */
if (p->master || (p->confno > -1))
return 0;
memset(&ci, 0, sizeof(ci));
- if (ioctl(p->subs[SUB_REAL].zfd, ZT_GETCONF, &ci)) {
+ if (ioctl(p->subs[SUB_REAL].zfd, DAHDI_GETCONF, &ci)) {
ast_log(LOG_WARNING, "Failed to get conference info on channel %d\n", p->channel);
return 0;
}
* \returns the alarms on the span to which the channel belongs, or alarms on
* the channel if no span alarms.
*/
-static int get_alarms(struct zt_pvt *p)
+static int get_alarms(struct dahdi_pvt *p)
{
int res;
- ZT_SPANINFO zi;
-#if defined(HAVE_ZAPTEL_CHANALARMS)
- struct zt_params params;
-#endif
+ DAHDI_SPANINFO zi;
+ struct dahdi_params params;
memset(&zi, 0, sizeof(zi));
zi.spanno = p->span;
- if ((res = ioctl(p->subs[SUB_REAL].zfd, ZT_SPANSTAT, &zi)) >= 0) {
- if (zi.alarms != ZT_ALARM_NONE)
+ if ((res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_SPANSTAT, &zi)) >= 0) {
+ if (zi.alarms != DAHDI_ALARM_NONE)
return zi.alarms;
}
-#if defined(HAVE_ZAPTEL_CHANALARMS)
/* No alarms on the span. Check for channel alarms. */
- if ((res = ioctl(p->subs[SUB_REAL].zfd, ZT_GET_PARAMS, ¶ms)) >= 0)
+ if ((res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_GET_PARAMS, ¶ms)) >= 0)
return params.chan_alarms;
-#endif
ast_log(LOG_WARNING, "Unable to determine alarm on channel %d\n", p->channel);
- return ZT_ALARM_NONE;
+ return DAHDI_ALARM_NONE;
}
-static void zt_handle_dtmfup(struct ast_channel *ast, int index, struct ast_frame **dest)
+static void dahdi_handle_dtmfup(struct ast_channel *ast, int index, struct ast_frame **dest)
{
- struct zt_pvt *p = ast->tech_pvt;
+ struct dahdi_pvt *p = ast->tech_pvt;
struct ast_frame *f = *dest;
ast_debug(1, "DTMF digit: %c on %s\n", f->subclass, ast->name);
ast_debug(1, "Already in a fax extension, not redirecting\n");
} else
ast_debug(1, "Fax already handled\n");
- zt_confmute(p, 0);
+ dahdi_confmute(p, 0);
p->subs[index].f.frametype = AST_FRAME_NULL;
p->subs[index].f.subclass = 0;
*dest = &p->subs[index].f;
}
}
-static struct ast_frame *zt_handle_event(struct ast_channel *ast)
+static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
{
int res, x;
int index, mysig;
char *c;
- struct zt_pvt *p = ast->tech_pvt;
+ struct dahdi_pvt *p = ast->tech_pvt;
pthread_t threadid;
struct ast_channel *chan;
struct ast_frame *f;
- index = zt_get_index(ast, p, 0);
+ index = dahdi_get_index(ast, p, 0);
mysig = p->sig;
if (p->outsigmod > -1)
mysig = p->outsigmod;
p->subs[index].f.samples = 0;
p->subs[index].f.mallocd = 0;
p->subs[index].f.offset = 0;
- p->subs[index].f.src = "zt_handle_event";
+ p->subs[index].f.src = "dahdi_handle_event";
p->subs[index].f.data.ptr = NULL;
f = &p->subs[index].f;
res = p->fake_event;
p->fake_event = 0;
} else
- res = zt_get_event(p->subs[index].zfd);
+ res = dahdi_get_event(p->subs[index].zfd);
ast_debug(1, "Got event %s(%d) on channel %d (index %d)\n", event2str(res), res, p->channel, index);
- if (res & (ZT_EVENT_PULSEDIGIT | ZT_EVENT_DTMFUP)) {
- p->pulsedial = (res & ZT_EVENT_PULSEDIGIT) ? 1 : 0;
+ if (res & (DAHDI_EVENT_PULSEDIGIT | DAHDI_EVENT_DTMFUP)) {
+ p->pulsedial = (res & DAHDI_EVENT_PULSEDIGIT) ? 1 : 0;
ast_debug(1, "Detected %sdigit '%c'\n", p->pulsedial ? "pulse ": "", res & 0xff);
#ifdef HAVE_PRI
- if (!p->proceeding && ((p->sig == SIG_PRI) || (p->sig == SIG_BRI) || (p->sig == SIG_BRI_PTMP)) && p->pri && (p->pri->overlapdial & ZAP_OVERLAPDIAL_INCOMING)) {
+ if (!p->proceeding && ((p->sig == SIG_PRI) || (p->sig == SIG_BRI) || (p->sig == SIG_BRI_PTMP)) && p->pri && (p->pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING)) {
/* absorb event */
} else {
#endif
#ifdef HAVE_PRI
}
#endif
- zt_handle_dtmfup(ast, index, &f);
+ dahdi_handle_dtmfup(ast, index, &f);
return f;
}
- if (res & ZT_EVENT_DTMFDOWN) {
+ if (res & DAHDI_EVENT_DTMFDOWN) {
ast_debug(1, "DTMF Down '%c'\n", res & 0xff);
/* Mute conference */
- zt_confmute(p, 1);
+ dahdi_confmute(p, 1);
p->subs[index].f.frametype = AST_FRAME_DTMF_BEGIN;
p->subs[index].f.subclass = res & 0xff;
return &p->subs[index].f;
}
switch (res) {
-#ifdef ZT_EVENT_EC_DISABLED
- case ZT_EVENT_EC_DISABLED:
+#ifdef DAHDI_EVENT_EC_DISABLED
+ case DAHDI_EVENT_EC_DISABLED:
ast_verb(3, "Channel %d echo canceler disabled due to CED detection\n", p->channel);
p->echocanon = 0;
break;
#endif
- case ZT_EVENT_BITSCHANGED:
+ case DAHDI_EVENT_BITSCHANGED:
ast_log(LOG_WARNING, "Recieved bits changed on %s signalling?\n", sig2str(p->sig));
- case ZT_EVENT_PULSE_START:
+ case DAHDI_EVENT_PULSE_START:
/* Stop tone if there's a pulse start and the PBX isn't started */
if (!ast->pbx)
tone_zone_play_tone(p->subs[index].zfd, -1);
break;
- case ZT_EVENT_DIALCOMPLETE:
+ case DAHDI_EVENT_DIALCOMPLETE:
if (p->inalarm) break;
if ((p->radio || (p->oprmode < 0))) break;
- if (ioctl(p->subs[index].zfd,ZT_DIALING,&x) == -1) {
- ast_debug(1, "ZT_DIALING ioctl failed on %s\n",ast->name);
+ if (ioctl(p->subs[index].zfd,DAHDI_DIALING,&x) == -1) {
+ ast_debug(1, "DAHDI_DIALING ioctl failed on %s\n",ast->name);
return NULL;
}
if (!x) { /* if not still dialing in driver */
- zt_enable_ec(p);
+ dahdi_enable_ec(p);
if (p->echobreak) {
- zt_train_ec(p);
+ dahdi_train_ec(p);
ast_copy_string(p->dop.dialstr, p->echorest, sizeof(p->dop.dialstr));
- p->dop.op = ZT_DIAL_OP_REPLACE;
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_DIAL, &p->dop);
+ p->dop.op = DAHDI_DIAL_OP_REPLACE;
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_DIAL, &p->dop);
p->echobreak = 0;
} else {
p->dialing = 0;
}
}
break;
- case ZT_EVENT_ALARM:
+ case DAHDI_EVENT_ALARM:
#ifdef HAVE_PRI
if ((p->sig == SIG_PRI) || (p->sig == SIG_BRI) || (p->sig == SIG_BRI_PTMP)) {
if (!p->pri || !p->pri->pri || (pri_get_timer(p->pri->pri, PRI_TIMER_T309) < 0)) {
if (p->sig == SIG_SS7)
break;
#endif
- case ZT_EVENT_ONHOOK:
+ case DAHDI_EVENT_ONHOOK:
if (p->radio) {
p->subs[index].f.frametype = AST_FRAME_CONTROL;
p->subs[index].f.subclass = AST_CONTROL_RADIO_UNKEY;
if ((p->sig == SIG_FXOLS) || (p->sig == SIG_FXOKS) || (p->sig == SIG_FXOGS))
{
/* Make sure it starts ringing */
- zt_set_hook(p->subs[SUB_REAL].zfd, ZT_RINGOFF);
- zt_set_hook(p->subs[SUB_REAL].zfd, ZT_RING);
+ dahdi_set_hook(p->subs[SUB_REAL].zfd, DAHDI_RINGOFF);
+ dahdi_set_hook(p->subs[SUB_REAL].zfd, DAHDI_RING);
save_conference(p->oprpeer);
- tone_zone_play_tone(p->oprpeer->subs[SUB_REAL].zfd, ZT_TONE_RINGTONE);
+ tone_zone_play_tone(p->oprpeer->subs[SUB_REAL].zfd, DAHDI_TONE_RINGTONE);
}
break;
}
/* Don't start streaming audio yet if the incoming call isn't up yet */
if (p->subs[SUB_REAL].owner->_state != AST_STATE_UP)
p->dialing = 1;
- zt_ring_phone(p);
+ dahdi_ring_phone(p);
} else if (p->subs[SUB_THREEWAY].owner) {
unsigned int mssinceflash;
/* Here we have to retain the lock on both the main channel, the 3-way channel, and
swap_subs(p, SUB_THREEWAY, SUB_REAL);
p->owner = NULL;
/* Ring the phone */
- zt_ring_phone(p);
+ dahdi_ring_phone(p);
} else {
if ((res = attempt_transfer(p)) < 0) {
p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV;
swap_subs(p, SUB_THREEWAY, SUB_REAL);
p->owner = NULL;
/* Ring the phone */
- zt_ring_phone(p);
+ dahdi_ring_phone(p);
}
}
} else {
}
/* Fall through */
default:
- zt_disable_ec(p);
+ dahdi_disable_ec(p);
return NULL;
}
break;
- case ZT_EVENT_RINGOFFHOOK:
+ case DAHDI_EVENT_RINGOFFHOOK:
if (p->inalarm) break;
if (p->oprmode < 0)
{
if ((p->sig == SIG_FXOLS) || (p->sig == SIG_FXOKS) || (p->sig == SIG_FXOGS))
{
/* Make sure it stops ringing */
- zt_set_hook(p->subs[SUB_REAL].zfd, ZT_RINGOFF);
+ dahdi_set_hook(p->subs[SUB_REAL].zfd, DAHDI_RINGOFF);
tone_zone_play_tone(p->oprpeer->subs[SUB_REAL].zfd, -1);
restore_conference(p->oprpeer);
}
p->dop.dialstr[strlen(p->dop.dialstr)-2] = '\0';
} else
p->echobreak = 0;
- if (ioctl(p->subs[SUB_REAL].zfd, ZT_DIAL, &p->dop)) {
- x = ZT_ONHOOK;
- ioctl(p->subs[SUB_REAL].zfd, ZT_HOOK, &x);
+ if (ioctl(p->subs[SUB_REAL].zfd, DAHDI_DIAL, &p->dop)) {
+ x = DAHDI_ONHOOK;
+ ioctl(p->subs[SUB_REAL].zfd, DAHDI_HOOK, &x);
ast_log(LOG_WARNING, "Dialing failed on channel %d: %s\n", p->channel, strerror(errno));
return NULL;
}
case SIG_FXOKS:
switch (ast->_state) {
case AST_STATE_RINGING:
- zt_enable_ec(p);
- zt_train_ec(p);
+ dahdi_enable_ec(p);
+ dahdi_train_ec(p);
p->subs[index].f.frametype = AST_FRAME_CONTROL;
p->subs[index].f.subclass = AST_CONTROL_ANSWER;
/* Make sure it stops ringing */
- zt_set_hook(p->subs[index].zfd, ZT_OFFHOOK);
+ dahdi_set_hook(p->subs[index].zfd, DAHDI_OFFHOOK);
ast_debug(1, "channel %d answered\n", p->channel);
if (p->cidspill) {
/* Cancel any running CallerID spill */
p->subs[index].f.subclass = 0;
} else if (!ast_strlen_zero(p->dop.dialstr)) {
/* nick@dccinc.com 4/3/03 - fxo should be able to do deferred dialing */
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_DIAL, &p->dop);
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_DIAL, &p->dop);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to initiate dialing on trunk channel %d\n", p->channel);
p->dop.dialstr[0] = '\0';
return &p->subs[index].f;
case AST_STATE_UP:
/* Make sure it stops ringing */
- zt_set_hook(p->subs[index].zfd, ZT_OFFHOOK);
+ dahdi_set_hook(p->subs[index].zfd, DAHDI_OFFHOOK);
/* Okay -- probably call waiting*/
if (ast_bridged_channel(p->owner))
ast_queue_control(p->owner, AST_CONTROL_UNHOLD);
case AST_STATE_RESERVED:
/* Start up dialtone */
if (has_voicemail(p))
- res = tone_zone_play_tone(p->subs[SUB_REAL].zfd, ZT_TONE_STUTTER);
+ res = tone_zone_play_tone(p->subs[SUB_REAL].zfd, DAHDI_TONE_STUTTER);
else
- res = tone_zone_play_tone(p->subs[SUB_REAL].zfd, ZT_TONE_DIALTONE);
+ res = tone_zone_play_tone(p->subs[SUB_REAL].zfd, DAHDI_TONE_DIALTONE);
break;
default:
ast_log(LOG_WARNING, "FXO phone off hook in weird state %d??\n", ast->_state);
ast_log(LOG_WARNING, "Don't know how to handle ring/off hook for signalling %d\n", p->sig);
}
break;
-#ifdef ZT_EVENT_RINGBEGIN
- case ZT_EVENT_RINGBEGIN:
+#ifdef DAHDI_EVENT_RINGBEGIN
+ case DAHDI_EVENT_RINGBEGIN:
switch (p->sig) {
case SIG_FXSLS:
case SIG_FXSGS:
}
break;
#endif
- case ZT_EVENT_RINGEROFF:
+ case DAHDI_EVENT_RINGEROFF:
if (p->inalarm) break;
if ((p->radio || (p->oprmode < 0))) break;
ast->rings++;
p->subs[index].f.frametype = AST_FRAME_CONTROL;
p->subs[index].f.subclass = AST_CONTROL_RINGING;
break;
- case ZT_EVENT_RINGERON:
+ case DAHDI_EVENT_RINGERON:
break;
- case ZT_EVENT_NOALARM:
+ case DAHDI_EVENT_NOALARM:
p->inalarm = 0;
#ifdef HAVE_PRI
/* Extremely unlikely but just in case */
manager_event(EVENT_FLAG_SYSTEM, "AlarmClear",
"Channel: %d\r\n", p->channel);
break;
- case ZT_EVENT_WINKFLASH:
+ case DAHDI_EVENT_WINKFLASH:
if (p->inalarm) break;
if (p->radio) break;
if (p->oprmode < 0) break;
if (p->oprmode > 1)
{
- struct zt_params par;
+ struct dahdi_params par;
- if (ioctl(p->oprpeer->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &par) != -1)
+ if (ioctl(p->oprpeer->subs[SUB_REAL].zfd, DAHDI_GET_PARAMS, &par) != -1)
{
if (!par.rxisoffhook)
{
/* Make sure it stops ringing */
- zt_set_hook(p->oprpeer->subs[SUB_REAL].zfd, ZT_RINGOFF);
- zt_set_hook(p->oprpeer->subs[SUB_REAL].zfd, ZT_RING);
+ dahdi_set_hook(p->oprpeer->subs[SUB_REAL].zfd, DAHDI_RINGOFF);
+ dahdi_set_hook(p->oprpeer->subs[SUB_REAL].zfd, DAHDI_RING);
save_conference(p);
- tone_zone_play_tone(p->subs[SUB_REAL].zfd, ZT_TONE_RINGTONE);
+ tone_zone_play_tone(p->subs[SUB_REAL].zfd, DAHDI_TONE_RINGTONE);
}
}
break;
p->subs[SUB_REAL].needflash = 1;
goto winkflashdone;
} else if (!check_for_conference(p)) {
- if (p->zaptrcallerid && p->owner) {
+ if (p->dahditrcallerid && p->owner) {
if (p->owner->cid.cid_num)
ast_copy_string(cid_num, p->owner->cid.cid_num, sizeof(cid_num));
if (p->owner->cid.cid_name)
goto winkflashdone;
}
/* Make new channel */
- chan = zt_new(p, AST_STATE_RESERVED, 0, SUB_THREEWAY, 0, 0);
- if (p->zaptrcallerid) {
+ chan = dahdi_new(p, AST_STATE_RESERVED, 0, SUB_THREEWAY, 0, 0);
+ if (p->dahditrcallerid) {
if (!p->origcid_num)
p->origcid_num = ast_strdup(p->cid_num);
if (!p->origcid_name)
/* Swap things around between the three-way and real call */
swap_subs(p, SUB_THREEWAY, SUB_REAL);
/* Disable echo canceller for better dialing */
- zt_disable_ec(p);
- res = tone_zone_play_tone(p->subs[SUB_REAL].zfd, ZT_TONE_DIALRECALL);
+ dahdi_disable_ec(p);
+ res = tone_zone_play_tone(p->subs[SUB_REAL].zfd, DAHDI_TONE_DIALRECALL);
if (res)
ast_log(LOG_WARNING, "Unable to start dial recall tone on channel %d\n", p->channel);
p->owner = chan;
ast_log(LOG_WARNING, "Cannot allocate new structure on channel %d\n", p->channel);
} else if (ast_pthread_create_detached(&threadid, NULL, ss_thread, chan)) {
ast_log(LOG_WARNING, "Unable to start simple switch on channel %d\n", p->channel);
- res = tone_zone_play_tone(p->subs[SUB_REAL].zfd, ZT_TONE_CONGESTION);
- zt_enable_ec(p);
+ res = tone_zone_play_tone(p->subs[SUB_REAL].zfd, DAHDI_TONE_CONGESTION);
+ dahdi_enable_ec(p);
ast_hangup(chan);
} else {
ast_verb(3, "Started three way call on channel %d\n", p->channel);
p->owner = p->subs[SUB_REAL].owner;
if (ast->_state == AST_STATE_RINGING) {
ast_debug(1, "Enabling ringtone on real and threeway\n");
- res = tone_zone_play_tone(p->subs[SUB_REAL].zfd, ZT_TONE_RINGTONE);
- res = tone_zone_play_tone(p->subs[SUB_THREEWAY].zfd, ZT_TONE_RINGTONE);
+ res = tone_zone_play_tone(p->subs[SUB_REAL].zfd, DAHDI_TONE_RINGTONE);
+ res = tone_zone_play_tone(p->subs[SUB_THREEWAY].zfd, DAHDI_TONE_RINGTONE);
}
} else {
ast_verb(3, "Dumping incomplete call on on %s\n", p->subs[SUB_THREEWAY].owner->name);
if (p->subs[SUB_REAL].owner && ast_bridged_channel(p->subs[SUB_REAL].owner))
ast_queue_control(p->subs[SUB_REAL].owner, AST_CONTROL_UNHOLD);
p->subs[SUB_REAL].needunhold = 1;
- zt_enable_ec(p);
+ dahdi_enable_ec(p);
}
}
case SIG_SF_FEATB:
/* FGD MF *Must* wait for wink */
if (!ast_strlen_zero(p->dop.dialstr)) {
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_DIAL, &p->dop);
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_DIAL, &p->dop);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to initiate dialing on trunk channel %d\n", p->channel);
p->dop.dialstr[0] = '\0';
ast_log(LOG_WARNING, "Don't know how to handle ring/off hoook for signalling %d\n", p->sig);
}
break;
- case ZT_EVENT_HOOKCOMPLETE:
+ case DAHDI_EVENT_HOOKCOMPLETE:
if (p->inalarm) break;
if ((p->radio || (p->oprmode < 0))) break;
switch (mysig) {
case SIG_SFWINK:
case SIG_SF_FEATD:
if (!ast_strlen_zero(p->dop.dialstr)) {
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_DIAL, &p->dop);
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_DIAL, &p->dop);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to initiate dialing on trunk channel %d\n", p->channel);
p->dop.dialstr[0] = '\0';
ast_debug(1, "Sent deferred digit string: %s\n", p->dop.dialstr);
}
p->dop.dialstr[0] = '\0';
- p->dop.op = ZT_DIAL_OP_REPLACE;
+ p->dop.op = DAHDI_DIAL_OP_REPLACE;
break;
case SIG_FEATDMF:
case SIG_FEATDMF_TA:
break;
}
break;
- case ZT_EVENT_POLARITY:
+ case DAHDI_EVENT_POLARITY:
/*
* If we get a Polarity Switch event, check to see
* if we should change the polarity state and
return &p->subs[index].f;
}
-static struct ast_frame *__zt_exception(struct ast_channel *ast)
+static struct ast_frame *__dahdi_exception(struct ast_channel *ast)
{
- struct zt_pvt *p = ast->tech_pvt;
+ struct dahdi_pvt *p = ast->tech_pvt;
int res;
int usedindex=-1;
int index;
struct ast_frame *f;
- index = zt_get_index(ast, p, 1);
+ index = dahdi_get_index(ast, p, 1);
p->subs[index].f.frametype = AST_FRAME_NULL;
p->subs[index].f.datalen = 0;
p->subs[index].f.offset = 0;
p->subs[index].f.subclass = 0;
p->subs[index].f.delivery = ast_tv(0,0);
- p->subs[index].f.src = "zt_exception";
+ p->subs[index].f.src = "dahdi_exception";
p->subs[index].f.data.ptr = NULL;
res = p->fake_event;
p->fake_event = 0;
} else
- res = zt_get_event(p->subs[SUB_REAL].zfd);
+ res = dahdi_get_event(p->subs[SUB_REAL].zfd);
/* Switch to real if there is one and this isn't something really silly... */
- if ((res != ZT_EVENT_RINGEROFF) && (res != ZT_EVENT_RINGERON) &&
- (res != ZT_EVENT_HOOKCOMPLETE)) {
+ if ((res != DAHDI_EVENT_RINGEROFF) && (res != DAHDI_EVENT_RINGERON) &&
+ (res != DAHDI_EVENT_HOOKCOMPLETE)) {
ast_debug(1, "Restoring owner of channel %d on event %d\n", p->channel, res);
p->owner = p->subs[SUB_REAL].owner;
if (p->owner && ast_bridged_channel(p->owner))
p->subs[SUB_REAL].needunhold = 1;
}
switch (res) {
- case ZT_EVENT_ONHOOK:
- zt_disable_ec(p);
+ case DAHDI_EVENT_ONHOOK:
+ dahdi_disable_ec(p);
if (p->owner) {
ast_verb(3, "Channel %s still has call, ringing phone\n", p->owner->name);
- zt_ring_phone(p);
+ dahdi_ring_phone(p);
p->callwaitingrepeat = 0;
p->cidcwexpire = 0;
} else
ast_log(LOG_WARNING, "Absorbed on hook, but nobody is left!?!?\n");
update_conf(p);
break;
- case ZT_EVENT_RINGOFFHOOK:
- zt_enable_ec(p);
- zt_set_hook(p->subs[SUB_REAL].zfd, ZT_OFFHOOK);
+ case DAHDI_EVENT_RINGOFFHOOK:
+ dahdi_enable_ec(p);
+ dahdi_set_hook(p->subs[SUB_REAL].zfd, DAHDI_OFFHOOK);
if (p->owner && (p->owner->_state == AST_STATE_RINGING)) {
p->subs[SUB_REAL].needanswer = 1;
p->dialing = 0;
}
break;
- case ZT_EVENT_HOOKCOMPLETE:
- case ZT_EVENT_RINGERON:
- case ZT_EVENT_RINGEROFF:
+ case DAHDI_EVENT_HOOKCOMPLETE:
+ case DAHDI_EVENT_RINGERON:
+ case DAHDI_EVENT_RINGEROFF:
/* Do nothing */
break;
- case ZT_EVENT_WINKFLASH:
+ case DAHDI_EVENT_WINKFLASH:
p->flashtime = ast_tvnow();
if (p->owner) {
ast_verb(3, "Channel %d flashed to other channel %s\n", p->channel, p->owner->name);
if (p->owner->_state != AST_STATE_UP) {
/* Answer if necessary */
- usedindex = zt_get_index(p->owner, p, 0);
+ usedindex = dahdi_get_index(p->owner, p, 0);
if (usedindex > -1) {
p->subs[usedindex].needanswer = 1;
}
f = &p->subs[index].f;
return f;
}
- f = zt_handle_event(ast);
+ f = dahdi_handle_event(ast);
return f;
}
-static struct ast_frame *zt_exception(struct ast_channel *ast)
+static struct ast_frame *dahdi_exception(struct ast_channel *ast)
{
- struct zt_pvt *p = ast->tech_pvt;
+ struct dahdi_pvt *p = ast->tech_pvt;
struct ast_frame *f;
ast_mutex_lock(&p->lock);
- f = __zt_exception(ast);
+ f = __dahdi_exception(ast);
ast_mutex_unlock(&p->lock);
return f;
}
-static struct ast_frame *zt_read(struct ast_channel *ast)
+static struct ast_frame *dahdi_read(struct ast_channel *ast)
{
- struct zt_pvt *p = ast->tech_pvt;
+ struct dahdi_pvt *p = ast->tech_pvt;
int res;
int index;
void *readbuf;
ast_mutex_lock(&p->lock);
- index = zt_get_index(ast, p, 0);
+ index = dahdi_get_index(ast, p, 0);
/* Hang up if we don't really exist */
if (index < 0) {
p->subs[index].f.offset = 0;
p->subs[index].f.subclass = 0;
p->subs[index].f.delivery = ast_tv(0,0);
- p->subs[index].f.src = "zt_read";
+ p->subs[index].f.src = "dahdi_read";
p->subs[index].f.data.ptr = NULL;
/* make sure it sends initial key state as first frame */
if ((p->radio || (p->oprmode < 0)) && (!p->firstradio))
{
- ZT_PARAMS ps;
+ DAHDI_PARAMS ps;
ps.channo = p->channel;
- if (ioctl(p->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &ps) < 0) {
+ if (ioctl(p->subs[SUB_REAL].zfd, DAHDI_GET_PARAMS, &ps) < 0) {
ast_mutex_unlock(&p->lock);
return NULL;
}
if (ast->rawreadformat == AST_FORMAT_SLINEAR) {
if (!p->subs[index].linear) {
p->subs[index].linear = 1;
- res = zt_setlinear(p->subs[index].zfd, p->subs[index].linear);
+ res = dahdi_setlinear(p->subs[index].zfd, p->subs[index].linear);
if (res)
ast_log(LOG_WARNING, "Unable to set channel %d (index %d) to linear mode.\n", p->channel, index);
}
(ast->rawreadformat == AST_FORMAT_ALAW)) {
if (p->subs[index].linear) {
p->subs[index].linear = 0;
- res = zt_setlinear(p->subs[index].zfd, p->subs[index].linear);
+ res = dahdi_setlinear(p->subs[index].zfd, p->subs[index].linear);
if (res)
ast_log(LOG_WARNING, "Unable to set channel %d (index %d) to companded mode.\n", p->channel, index);
}
ast_mutex_unlock(&p->lock);
return &p->subs[index].f;
} else if (errno == ELAST) {
- f = __zt_exception(ast);
+ f = __dahdi_exception(ast);
} else
- ast_log(LOG_WARNING, "zt_rec: %s\n", strerror(errno));
+ ast_log(LOG_WARNING, "dahdi_rec: %s\n", strerror(errno));
}
ast_mutex_unlock(&p->lock);
return f;
}
if (res != (p->subs[index].linear ? READ_SIZE * 2 : READ_SIZE)) {
ast_debug(1, "Short read (%d/%d), must be an event...\n", res, p->subs[index].linear ? READ_SIZE * 2 : READ_SIZE);
- f = __zt_exception(ast);
+ f = __dahdi_exception(ast);
ast_mutex_unlock(&p->lock);
return f;
}
}
}
/* Ensure the CW timer decrements only on a single subchannel */
- if (p->callwaitingrepeat && zt_get_index(ast, p, 1) == SUB_REAL) {
+ if (p->callwaitingrepeat && dahdi_get_index(ast, p, 1) == SUB_REAL) {
p->callwaitingrepeat--;
}
if (p->cidcwexpire)
/* Repeat callwaiting */
if (p->callwaitingrepeat == 1) {
p->callwaitrings++;
- zt_callwait(ast);
+ dahdi_callwait(ast);
}
/* Expire CID/CW */
if (p->cidcwexpire == 1) {
p->subs[index].f.datalen= 0;
}
if (p->dsp && (!p->ignoredtmf || p->callwaitcas || p->busydetect || p->callprogress) && !index) {
- /* Perform busy detection. etc on the zap line */
+ /* Perform busy detection. etc on the dahdi line */
int mute;
f = ast_dsp_process(ast, p->dsp, &p->subs[index].f);
mute = ast_dsp_was_muted(p->dsp);
if (p->muting != mute) {
p->muting = mute;
- zt_confmute(p, mute);
+ dahdi_confmute(p, mute);
}
if (f) {
} else if (f->frametype == AST_FRAME_DTMF) {
#ifdef HAVE_PRI
if (!p->proceeding && ((p->sig == SIG_PRI) || (p->sig == SIG_BRI) || (p->sig == SIG_BRI_PTMP)) && p->pri &&
- ((!p->outgoing && (p->pri->overlapdial & ZAP_OVERLAPDIAL_INCOMING)) ||
- (p->outgoing && (p->pri->overlapdial & ZAP_OVERLAPDIAL_OUTGOING)))) {
+ ((!p->outgoing && (p->pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING)) ||
+ (p->outgoing && (p->pri->overlapdial & DAHDI_OVERLAPDIAL_OUTGOING)))) {
/* Don't accept in-band DTMF when in overlap dial mode */
f->frametype = AST_FRAME_NULL;
f->subclass = 0;
f = &p->subs[index].f;
if (f && (f->frametype == AST_FRAME_DTMF))
- zt_handle_dtmfup(ast, index, &f);
+ dahdi_handle_dtmfup(ast, index, &f);
/* If we have a fake_event, trigger exception to handle it */
if (p->fake_event)
return f;
}
-static int my_zt_write(struct zt_pvt *p, unsigned char *buf, int len, int index, int linear)
+static int my_dahdi_write(struct dahdi_pvt *p, unsigned char *buf, int len, int index, int linear)
{
int sent=0;
int size;
return sent;
}
-static int zt_write(struct ast_channel *ast, struct ast_frame *frame)
+static int dahdi_write(struct ast_channel *ast, struct ast_frame *frame)
{
- struct zt_pvt *p = ast->tech_pvt;
+ struct dahdi_pvt *p = ast->tech_pvt;
int res;
int index;
- index = zt_get_index(ast, p, 0);
+ index = dahdi_get_index(ast, p, 0);
if (index < 0) {
ast_log(LOG_WARNING, "%s doesn't really exist?\n", ast->name);
return -1;
if (frame->subclass == AST_FORMAT_SLINEAR) {
if (!p->subs[index].linear) {
p->subs[index].linear = 1;
- res = zt_setlinear(p->subs[index].zfd, p->subs[index].linear);
+ res = dahdi_setlinear(p->subs[index].zfd, p->subs[index].linear);
if (res)
ast_log(LOG_WARNING, "Unable to set linear mode on channel %d\n", p->channel);
}
- res = my_zt_write(p, (unsigned char *)frame->data.ptr, frame->datalen, index, 1);
+ res = my_dahdi_write(p, (unsigned char *)frame->data.ptr, frame->datalen, index, 1);
} else {
/* x-law already */
if (p->subs[index].linear) {
p->subs[index].linear = 0;
- res = zt_setlinear(p->subs[index].zfd, p->subs[index].linear);
+ res = dahdi_setlinear(p->subs[index].zfd, p->subs[index].linear);
if (res)
ast_log(LOG_WARNING, "Unable to set companded mode on channel %d\n", p->channel);
}
- res = my_zt_write(p, (unsigned char *)frame->data.ptr, frame->datalen, index, 0);
+ res = my_dahdi_write(p, (unsigned char *)frame->data.ptr, frame->datalen, index, 0);
}
if (res < 0) {
ast_log(LOG_WARNING, "write failed: %s\n", strerror(errno));
return 0;
}
-static int zt_indicate(struct ast_channel *chan, int condition, const void *data, size_t datalen)
+static int dahdi_indicate(struct ast_channel *chan, int condition, const void *data, size_t datalen)
{
- struct zt_pvt *p = chan->tech_pvt;
+ struct dahdi_pvt *p = chan->tech_pvt;
int res=-1;
int index;
- int func = ZT_FLASH;
+ int func = DAHDI_FLASH;
ast_mutex_lock(&p->lock);
- index = zt_get_index(chan, p, 0);
+ index = dahdi_get_index(chan, p, 0);
ast_debug(1, "Requested indication %d on channel %s\n", condition, chan->name);
if (index == SUB_REAL) {
switch (condition) {
ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
}
p->progress = 1;
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_BUSY);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_BUSY);
} else
#endif
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_BUSY);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_BUSY);
break;
case AST_CONTROL_RINGING:
#ifdef HAVE_PRI
}
#endif
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_RINGTONE);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_RINGTONE);
if (chan->_state != AST_STATE_UP) {
if ((chan->_state != AST_STATE_RING) ||
p->progress = 1;
ss7_rel(p->ss7);
/* enable echo canceler here on SS7 calls */
- zt_enable_ec(p);
+ dahdi_enable_ec(p);
}
}
ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
}
p->progress = 1;
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_CONGESTION);
} else
#endif
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_CONGESTION);
break;
case AST_CONTROL_HOLD:
#ifdef HAVE_PRI
break;
case AST_CONTROL_RADIO_KEY:
if (p->radio)
- res = zt_set_hook(p->subs[index].zfd, ZT_OFFHOOK);
+ res = dahdi_set_hook(p->subs[index].zfd, DAHDI_OFFHOOK);
res = 0;
break;
case AST_CONTROL_RADIO_UNKEY:
if (p->radio)
- res = zt_set_hook(p->subs[index].zfd, ZT_RINGOFF);
+ res = dahdi_set_hook(p->subs[index].zfd, DAHDI_RINGOFF);
res = 0;
break;
case AST_CONTROL_FLASH:
if (ISTRUNK(p) && (p->sig != SIG_PRI)) {
/* Clear out the dial buffer */
p->dop.dialstr[0] = '\0';
- if ((ioctl(p->subs[SUB_REAL].zfd,ZT_HOOK,&func) == -1) && (errno != EINPROGRESS)) {
+ if ((ioctl(p->subs[SUB_REAL].zfd,DAHDI_HOOK,&func) == -1) && (errno != EINPROGRESS)) {
ast_log(LOG_WARNING, "Unable to flash external trunk on channel %s: %s\n",
chan->name, strerror(errno));
} else
return res;
}
-static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int index, int law, int transfercapability)
+static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpbx, int index, int law, int transfercapability)
{
struct ast_channel *tmp;
int deflaw;
int features;
struct ast_str *chan_name;
struct ast_variable *v;
- ZT_PARAMS ps;
+ DAHDI_PARAMS ps;
if (i->subs[index].owner) {
ast_log(LOG_WARNING, "Channel %d already has a %s call\n", i->channel,subnames[index]);
return NULL;
}
y++;
} while (x < 3);
- tmp = ast_channel_alloc(0, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, i->amaflags, "Zap/%s", chan_name->str);
+ tmp = ast_channel_alloc(0, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, i->amaflags, "DAHDI/%s", chan_name->str);
if (!tmp)
return NULL;
- tmp->tech = &zap_tech;
+ tmp->tech = &dahdi_tech;
ps.channo = i->channel;
- res = ioctl(i->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &ps);
+ res = ioctl(i->subs[SUB_REAL].zfd, DAHDI_GET_PARAMS, &ps);
if (res) {
ast_log(LOG_WARNING, "Unable to get parameters, assuming MULAW\n");
- ps.curlaw = ZT_LAW_MULAW;
+ ps.curlaw = DAHDI_LAW_MULAW;
}
- if (ps.curlaw == ZT_LAW_ALAW)
+ if (ps.curlaw == DAHDI_LAW_ALAW)
deflaw = AST_FORMAT_ALAW;
else
deflaw = AST_FORMAT_ULAW;
if (law) {
- if (law == ZT_LAW_ALAW)
+ if (law == DAHDI_LAW_ALAW)
deflaw = AST_FORMAT_ALAW;
else
deflaw = AST_FORMAT_ULAW;
tmp->rawwriteformat = deflaw;
tmp->writeformat = deflaw;
i->subs[index].linear = 0;
- zt_setlinear(i->subs[index].zfd, i->subs[index].linear);
+ dahdi_setlinear(i->subs[index].zfd, i->subs[index].linear);
features = 0;
if (index == SUB_REAL) {
if (i->busydetect && CANBUSYDETECT(i))
(i->outgoing && (i->callprogress & CALLPROGRESS_FAX_OUTGOING))) {
features |= DSP_FEATURE_FAX_DETECT;
}
-#ifdef ZT_TONEDETECT
- x = ZT_TONEDETECT_ON | ZT_TONEDETECT_MUTE;
- if (ioctl(i->subs[index].zfd, ZT_TONEDETECT, &x)) {
+#ifdef DAHDI_TONEDETECT
+ x = DAHDI_TONEDETECT_ON | DAHDI_TONEDETECT_MUTE;
+ if (ioctl(i->subs[index].zfd, DAHDI_TONEDETECT, &x)) {
#endif
i->hardwaredtmf = 0;
features |= DSP_FEATURE_DIGIT_DETECT;
-#ifdef ZT_TONEDETECT
+#ifdef DAHDI_TONEDETECT
} else if (NEED_MFDETECT(i)) {
i->hardwaredtmf = 1;
features |= DSP_FEATURE_DIGIT_DETECT;
/* clear the fake event in case we posted one before we had ast_channel */
i->fake_event = 0;
/* Assure there is no confmute on this channel */
- zt_confmute(i, 0);
+ dahdi_confmute(i, 0);
i->muting = 0;
/* Configure the new channel jb */
ast_jb_configure(tmp, &global_jbconf);
}
}
-static int zt_wink(struct zt_pvt *p, int index)
+static int dahdi_wink(struct dahdi_pvt *p, int index)
{
int j;
- zt_set_hook(p->subs[index].zfd, ZT_WINK);
+ dahdi_set_hook(p->subs[index].zfd, DAHDI_WINK);
for (;;)
{
/* set bits of interest */
- j = ZT_IOMUX_SIGEVENT;
+ j = DAHDI_IOMUX_SIGEVENT;
/* wait for some happening */
- if (ioctl(p->subs[index].zfd,ZT_IOMUX,&j) == -1) return(-1);
+ if (ioctl(p->subs[index].zfd,DAHDI_IOMUX,&j) == -1) return(-1);
/* exit loop if we have it */
- if (j & ZT_IOMUX_SIGEVENT) break;
+ if (j & DAHDI_IOMUX_SIGEVENT) break;
}
/* get the event info */
- if (ioctl(p->subs[index].zfd,ZT_GETEVENT,&j) == -1) return(-1);
+ if (ioctl(p->subs[index].zfd,DAHDI_GETEVENT,&j) == -1) return(-1);
return 0;
}
-/*! \brief enable or disable the chan_zap Do-Not-Disturb mode for a Zaptel channel
- * \param zapchan "Physical" Zaptel channel (e.g: Zap/5)
+/*! \brief enable or disable the chan_dahdi Do-Not-Disturb mode for a DAHDI channel
+ * \param dahdichan "Physical" DAHDI channel (e.g: DAHDI/5)
* \param on 1 to enable, 0 to disable
*
- * chan_zap has a DND (Do Not Disturb) mode for each zapchan (physical
- * zaptel channel). Use this to enable or disable it.
+ * chan_dahdi has a DND (Do Not Disturb) mode for each dahdichan (physical
+ * DAHDI channel). Use this to enable or disable it.
*
- * \bug the use of the word "channel" for those zapchans is really confusing.
+ * \bug the use of the word "channel" for those dahdichans is really confusing.
*/
-static void zap_dnd(struct zt_pvt *zapchan, int on)
+static void dahdi_dnd(struct dahdi_pvt *dahdichan, int on)
{
/* Do not disturb */
- zapchan->dnd = on;
+ dahdichan->dnd = on;
ast_verb(3, "%s DND on channel %d\n",
on? "Enabled" : "Disabled",
- zapchan->channel);
+ dahdichan->channel);
manager_event(EVENT_FLAG_SYSTEM, "DNDState",
- "Channel: Zap/%d\r\n"
- "Status: %s\r\n", zapchan->channel,
+ "Channel: DAHDI/%d\r\n"
+ "Status: %s\r\n", dahdichan->channel,
on? "enabled" : "disabled");
}
static void *ss_thread(void *data)
{
struct ast_channel *chan = data;
- struct zt_pvt *p = chan->tech_pvt;
+ struct dahdi_pvt *p = chan->tech_pvt;
char exten[AST_MAX_EXTENSION] = "";
char exten2[AST_MAX_EXTENSION] = "";
unsigned char buf[256];
}
ast_verb(3, "Starting simple switch on '%s'\n", chan->name);
- index = zt_get_index(chan, p, 1);
+ index = dahdi_get_index(chan, p, 1);
if (index < 0) {
ast_log(LOG_WARNING, "Huh?\n");
ast_hangup(chan);
if (len && !ast_ignore_pattern(chan->context, exten))
tone_zone_play_tone(p->subs[index].zfd, -1);
else
- tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALTONE);
+ tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALTONE);
if (ast_exists_extension(chan, chan->context, exten, 1, p->cid_num))
timeout = matchdigittimeout;
else
/* Start the real PBX */
ast_copy_string(chan->exten, exten, sizeof(chan->exten));
if (p->dsp) ast_dsp_digitreset(p->dsp);
- zt_enable_ec(p);
+ dahdi_enable_ec(p);
ast_setstate(chan, AST_STATE_RING);
res = ast_pbx_run(chan);
if (res) {
case SIG_SF_FEATDMF:
case SIG_SF_FEATB:
case SIG_SFWINK:
- if (zt_wink(p, index))
+ if (dahdi_wink(p, index))
return NULL;
/* Fall through */
case SIG_EM:
case SIG_FEATDMF_TA:
res = my_getsigstr(chan, dtmfbuf + 1, "#", 3000);
if ((res < 1) && (p->dsp)) ast_dsp_digitreset(p->dsp);
- if (zt_wink(p, index)) return NULL;
+ if (dahdi_wink(p, index)) return NULL;
dtmfbuf[0] = 0;
/* Wait for the first digit (up to 5 seconds). */
res = ast_waitfordigit(chan, 5000);
/* if international caca, do it again to get real ANO */
if ((p->sig == SIG_FEATDMF) && (dtmfbuf[1] != '0') && (strlen(dtmfbuf) != 14))
{
- if (zt_wink(p, index)) return NULL;
+ if (dahdi_wink(p, index)) return NULL;
dtmfbuf[0] = 0;
/* Wait for the first digit (up to 5 seconds). */
res = ast_waitfordigit(chan, 5000);
if (res > 0) {
/* if E911, take off hook */
if (p->sig == SIG_E911)
- zt_set_hook(p->subs[SUB_REAL].zfd, ZT_OFFHOOK);
+ dahdi_set_hook(p->subs[SUB_REAL].zfd, DAHDI_OFFHOOK);
res = my_getsigstr(chan, dtmfbuf + strlen(dtmfbuf), "#", 3000);
}
if ((res < 1) && (p->dsp)) ast_dsp_digitreset(p->dsp);
ast_hangup(chan);
return NULL;
}
- zt_set_hook(p->subs[SUB_REAL].zfd, ZT_OFFHOOK);
+ dahdi_set_hook(p->subs[SUB_REAL].zfd, DAHDI_OFFHOOK);
ast_dsp_set_digitmode(p->dsp, DSP_DIGITMODE_MF | p->dtmfrelax);
res = my_getsigstr(chan, anibuf, "#", 10000);
if ((res > 0) && (strlen(anibuf) > 2)) {
ast_log(LOG_WARNING, "Got a non-Feature Group B input on channel %d. Assuming E&M Wink instead\n", p->channel);
}
if ((p->sig == SIG_FEATDMF) || (p->sig == SIG_FEATDMF_TA)) {
- zt_wink(p, index);
+ dahdi_wink(p, index);
/* some switches require a minimum guard time between
the last FGD wink and something that answers
immediately. This ensures it */
if (ast_safe_sleep(chan,100)) return NULL;
}
- zt_enable_ec(p);
+ dahdi_enable_ec(p);
if (NEED_MFDETECT(p)) {
if (p->dsp) {
if (!p->hardwaredtmf)
res = ast_pbx_run(chan);
if (res) {
ast_log(LOG_WARNING, "PBX exited non-zero\n");
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_CONGESTION);
}
return NULL;
} else {
ast_verb(2, "Unknown extension '%s' in context '%s' requested\n", exten, chan->context);
sleep(2);
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_INFO);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_INFO);
if (res < 0)
ast_log(LOG_WARNING, "Unable to start special tone on %d\n", p->channel);
else
res = ast_streamfile(chan, "ss-noservice", chan->language);
if (res >= 0)
ast_waitstream(chan, "");
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_CONGESTION);
ast_hangup(chan);
return NULL;
}
if (!ast_ignore_pattern(chan->context, exten))
tone_zone_play_tone(p->subs[index].zfd, -1);
else
- tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALTONE);
+ tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALTONE);
if (ast_exists_extension(chan, chan->context, exten, 1, p->cid_num) && strcmp(exten, ast_parking_ext())) {
if (!res || !ast_matchmore_extension(chan, chan->context, exten, 1, p->cid_num)) {
if (getforward) {
/* Record this as the forwarding extension */
ast_copy_string(p->call_forward, exten, sizeof(p->call_forward));
ast_verb(3, "Setting call forward to '%s' on channel %d\n", p->call_forward, p->channel);
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);
if (res)
break;
usleep(500000);
res = tone_zone_play_tone(p->subs[index].zfd, -1);
sleep(1);
memset(exten, 0, sizeof(exten));
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALTONE);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALTONE);
len = 0;
getforward = 0;
} else {
ast_set_callerid(chan, NULL, p->cid_name, NULL);
}
ast_setstate(chan, AST_STATE_RING);
- zt_enable_ec(p);
+ dahdi_enable_ec(p);
res = ast_pbx_run(chan);
if (res) {
ast_log(LOG_WARNING, "PBX exited non-zero\n");
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_CONGESTION);
}
return NULL;
}
}
} else if (res == 0) {
ast_debug(1, "not enough digits (and no ambiguous match)...\n");
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);
- zt_wait_event(p->subs[index].zfd);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_CONGESTION);
+ dahdi_wait_event(p->subs[index].zfd);
ast_hangup(chan);
return NULL;
} else if (p->callwaiting && !strcmp(exten, "*70")) {
ast_verb(3, "Disabling call waiting on %s\n", chan->name);
/* Disable call waiting if enabled */
p->callwaiting = 0;
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);
if (res) {
ast_log(LOG_WARNING, "Unable to do dial recall on channel %s: %s\n",
chan->name, strerror(errno));
}
len = 0;
- ioctl(p->subs[index].zfd,ZT_CONFDIAG,&len);
+ ioctl(p->subs[index].zfd,DAHDI_CONFDIAG,&len);
memset(exten, 0, sizeof(exten));
timeout = firstdigittimeout;
swap_subs(p, SUB_CALLWAIT, SUB_THREEWAY);
unalloc_sub(p, SUB_THREEWAY);
}
- zt_enable_ec(p);
+ dahdi_enable_ec(p);
if (ast_pickup_call(chan)) {
ast_debug(1, "No call pickup possible...\n");
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);
- zt_wait_event(p->subs[index].zfd);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_CONGESTION);
+ dahdi_wait_event(p->subs[index].zfd);
}
ast_hangup(chan);
return NULL;
if (chan->cid.cid_name)
ast_free(chan->cid.cid_name);
chan->cid.cid_name = NULL;
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);
if (res) {
ast_log(LOG_WARNING, "Unable to do dial recall on channel %s: %s\n",
chan->name, strerror(errno));
res = ast_say_digit_str(chan, p->lastcid_num, "", chan->language);
}
if (!res)
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);
break;
} else if (!strcmp(exten, "*78")) {
- zap_dnd(p, 1);
+ dahdi_dnd(p, 1);
/* Do not disturb */
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);
getforward = 0;
memset(exten, 0, sizeof(exten));
len = 0;
} else if (!strcmp(exten, "*79")) {
- zap_dnd(p, 0);
+ dahdi_dnd(p, 0);
/* Do not disturb */
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);
getforward = 0;
memset(exten, 0, sizeof(exten));
len = 0;
} else if (p->cancallforward && !strcmp(exten, "*72")) {
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);
getforward = 1;
memset(exten, 0, sizeof(exten));
len = 0;
} else if (p->cancallforward && !strcmp(exten, "*73")) {
ast_verb(3, "Cancelling call forwarding on channel %d\n", p->channel);
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);
memset(p->call_forward, 0, sizeof(p->call_forward));
getforward = 0;
memset(exten, 0, sizeof(exten));
ast_verb(3, "Blacklisting number %s\n", p->lastcid_num);
res = ast_db_put("blacklist", p->lastcid_num, "1");
if (!res) {
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);
memset(exten, 0, sizeof(exten));
len = 0;
}
ast_free(chan->cid.cid_name);
chan->cid.cid_name = NULL;
ast_set_callerid(chan, p->cid_num, p->cid_name, NULL);
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);
if (res) {
ast_log(LOG_WARNING, "Unable to do dial recall on channel %s: %s\n",
chan->name, strerror(errno));
} else if (!strcmp(exten, "*0")) {
struct ast_channel *nbridge =
p->subs[SUB_THREEWAY].owner;
- struct zt_pvt *pbridge = NULL;
+ struct dahdi_pvt *pbridge = NULL;
/* set up the private struct of the bridged one, if any */
if (nbridge && ast_bridged_channel(nbridge))
pbridge = ast_bridged_channel(nbridge)->tech_pvt;
if (nbridge && pbridge &&
- (nbridge->tech == &zap_tech) &&
- (ast_bridged_channel(nbridge)->tech == &zap_tech) &&
+ (nbridge->tech == &dahdi_tech) &&
+ (ast_bridged_channel(nbridge)->tech == &dahdi_tech) &&
ISTRUNK(pbridge)) {
- int func = ZT_FLASH;
+ int func = DAHDI_FLASH;
/* Clear out the dial buffer */
p->dop.dialstr[0] = '\0';
/* flash hookswitch */
- if ((ioctl(pbridge->subs[SUB_REAL].zfd,ZT_HOOK,&func) == -1) && (errno != EINPROGRESS)) {
+ if ((ioctl(pbridge->subs[SUB_REAL].zfd,DAHDI_HOOK,&func) == -1) && (errno != EINPROGRESS)) {
ast_log(LOG_WARNING, "Unable to flash external trunk on channel %s: %s\n",
nbridge->name, strerror(errno));
}
ast_hangup(chan);
return NULL;
} else {
- tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);
- zt_wait_event(p->subs[index].zfd);
+ tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_CONGESTION);
+ dahdi_wait_event(p->subs[index].zfd);
tone_zone_play_tone(p->subs[index].zfd, -1);
swap_subs(p, SUB_REAL, SUB_THREEWAY);
unalloc_sub(p, SUB_THREEWAY);
cs = NULL;
ast_debug(1, "Receiving DTMF cid on "
"channel %s\n", chan->name);
- zt_setlinear(p->subs[index].zfd, 0);
+ dahdi_setlinear(p->subs[index].zfd, 0);
res = 2000;
for (;;) {
struct ast_frame *f;
break; /* Got ring */
}
dtmfbuf[i] = '\0';
- zt_setlinear(p->subs[index].zfd, p->subs[index].linear);
+ dahdi_setlinear(p->subs[index].zfd, p->subs[index].linear);
/* Got cid and ring. */
ast_debug(1, "CID got string '%s'\n", dtmfbuf);
callerid_get_dtmf(dtmfbuf, dtmfcid, &flags);
bump_gains(p);
#endif
/* Take out of linear mode for Caller*ID processing */
- zt_setlinear(p->subs[index].zfd, 0);
+ dahdi_setlinear(p->subs[index].zfd, 0);
/* First we wait and listen for the Caller*ID */
for (;;) {
- i = ZT_IOMUX_READ | ZT_IOMUX_SIGEVENT;
- if ((res = ioctl(p->subs[index].zfd, ZT_IOMUX, &i))) {
+ i = DAHDI_IOMUX_READ | DAHDI_IOMUX_SIGEVENT;
+ if ((res = ioctl(p->subs[index].zfd, DAHDI_IOMUX, &i))) {
ast_log(LOG_WARNING, "I/O MUX failed: %s\n", strerror(errno));
callerid_free(cs);
ast_hangup(chan);
return NULL;
}
- if (i & ZT_IOMUX_SIGEVENT) {
- res = zt_get_event(p->subs[index].zfd);
+ if (i & DAHDI_IOMUX_SIGEVENT) {
+ res = dahdi_get_event(p->subs[index].zfd);
ast_log(LOG_NOTICE, "Got event %d (%s)...\n", res, event2str(res));
if (p->cid_signalling == CID_SIG_V23_JP) {
-#ifdef ZT_EVENT_RINGBEGIN
- if (res == ZT_EVENT_RINGBEGIN) {
- res = zt_set_hook(p->subs[SUB_REAL].zfd, ZT_OFFHOOK);
+#ifdef DAHDI_EVENT_RINGBEGIN
+ if (res == DAHDI_EVENT_RINGBEGIN) {
+ res = dahdi_set_hook(p->subs[SUB_REAL].zfd, DAHDI_OFFHOOK);
usleep(1);
}
#endif
res = 0;
break;
}
- } else if (i & ZT_IOMUX_READ) {
+ } else if (i & DAHDI_IOMUX_READ) {
res = read(p->subs[index].zfd, buf, sizeof(buf));
if (res < 0) {
if (errno != ELAST) {
}
if (p->cid_signalling == CID_SIG_V23_JP) {
- res = zt_set_hook(p->subs[SUB_REAL].zfd, ZT_ONHOOK);
+ res = dahdi_set_hook(p->subs[SUB_REAL].zfd, DAHDI_ONHOOK);
usleep(1);
res = 4000;
} else {
}
for (;;) {
- i = ZT_IOMUX_READ | ZT_IOMUX_SIGEVENT;
- if ((res = ioctl(p->subs[index].zfd, ZT_IOMUX, &i))) {
+ i = DAHDI_IOMUX_READ | DAHDI_IOMUX_SIGEVENT;
+ if ((res = ioctl(p->subs[index].zfd, DAHDI_IOMUX, &i))) {
ast_log(LOG_WARNING, "I/O MUX failed: %s\n", strerror(errno));
callerid_free(cs);
ast_hangup(chan);
return NULL;
}
- if (i & ZT_IOMUX_SIGEVENT) {
- res = zt_get_event(p->subs[index].zfd);
+ if (i & DAHDI_IOMUX_SIGEVENT) {
+ res = dahdi_get_event(p->subs[index].zfd);
ast_log(LOG_NOTICE, "Got event %d (%s)...\n", res, event2str(res));
res = 0;
/* Let us detect distinctive ring */
if (p->ringt < p->ringt_base/2)
break;
/* Increment the ringT counter so we can match it against
- values in zapata.conf for distinctive ring */
+ values in chan_dahdi.conf for distinctive ring */
if (++receivedRingT == (sizeof(curRingData) / sizeof(curRingData[0])))
break;
- } else if (i & ZT_IOMUX_READ) {
+ } else if (i & DAHDI_IOMUX_READ) {
res = read(p->subs[index].zfd, buf, sizeof(buf));
if (res < 0) {
if (errno != ELAST) {
/* this only shows up if you have n of the dring patterns filled in */
ast_verb(3, "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
for (counter = 0; counter < 3; counter++) {
- /* Check to see if the rings we received match any of the ones in zapata.conf for this
+ /* Check to see if the rings we received match any of the ones in chan_dahdi.conf for this
channel */
distMatches = 0;
for (counter1 = 0; counter1 < 3; counter1++) {
}
}
/* Restore linear mode (if appropriate) for Caller*ID processing */
- zt_setlinear(p->subs[index].zfd, p->subs[index].linear);
+ dahdi_setlinear(p->subs[index].zfd, p->subs[index].linear);
#if 1
restore_gains(p);
#endif
if (p->cid_signalling == CID_SIG_DTMF) {
int i = 0;
cs = NULL;
- zt_setlinear(p->subs[index].zfd, 0);
+ dahdi_setlinear(p->subs[index].zfd, 0);
res = 2000;
for (;;) {
struct ast_frame *f;
}
dtmfbuf[i] = '\0';
- zt_setlinear(p->subs[index].zfd, p->subs[index].linear);
+ dahdi_setlinear(p->subs[index].zfd, p->subs[index].linear);
/* Got cid and ring. */
callerid_get_dtmf(dtmfbuf, dtmfcid, &flags);
ast_log(LOG_DEBUG, "CID is '%s', flags %d\n",
}
/* Take out of linear mode for Caller*ID processing */
- zt_setlinear(p->subs[index].zfd, 0);
+ dahdi_setlinear(p->subs[index].zfd, 0);
for (;;) {
- i = ZT_IOMUX_READ | ZT_IOMUX_SIGEVENT;
- if ((res = ioctl(p->subs[index].zfd, ZT_IOMUX, &i))) {
+ i = DAHDI_IOMUX_READ | DAHDI_IOMUX_SIGEVENT;
+ if ((res = ioctl(p->subs[index].zfd, DAHDI_IOMUX, &i))) {
ast_log(LOG_WARNING, "I/O MUX failed: %s\n", strerror(errno));
callerid_free(cs);
ast_hangup(chan);
return NULL;
}
- if (i & ZT_IOMUX_SIGEVENT) {
- res = zt_get_event(p->subs[index].zfd);
+ if (i & DAHDI_IOMUX_SIGEVENT) {
+ res = dahdi_get_event(p->subs[index].zfd);
ast_log(LOG_NOTICE, "Got event %d (%s)...\n", res, event2str(res));
/* If we get a PR event, they hung up while processing calerid */
- if ( res == ZT_EVENT_POLARITY && p->hanguponpolarityswitch && p->polarity == POLARITY_REV) {
+ if ( res == DAHDI_EVENT_POLARITY && p->hanguponpolarityswitch && p->polarity == POLARITY_REV) {
ast_log(LOG_DEBUG, "Hanging up due to polarity reversal on channel %d while detecting callerid\n", p->channel);
p->polarity = POLARITY_IDLE;
callerid_free(cs);
if (p->ringt < p->ringt_base/2)
break;
/* Increment the ringT counter so we can match it against
- values in zapata.conf for distinctive ring */
+ values in chan_dahdi.conf for distinctive ring */
if (++receivedRingT == (sizeof(curRingData) / sizeof(curRingData[0])))
break;
- } else if (i & ZT_IOMUX_READ) {
+ } else if (i & DAHDI_IOMUX_READ) {
res = read(p->subs[index].zfd, buf, sizeof(buf));
if (res < 0) {
if (errno != ELAST) {
receivedRingT = 0;
ast_verb(3, "Detecting post-CID distinctive ring\n");
for (;;) {
- i = ZT_IOMUX_READ | ZT_IOMUX_SIGEVENT;
- if ((res = ioctl(p->subs[index].zfd, ZT_IOMUX, &i))) {
+ i = DAHDI_IOMUX_READ | DAHDI_IOMUX_SIGEVENT;
+ if ((res = ioctl(p->subs[index].zfd, DAHDI_IOMUX, &i))) {
ast_log(LOG_WARNING, "I/O MUX failed: %s\n", strerror(errno));
callerid_free(cs);
ast_hangup(chan);
return NULL;
}
- if (i & ZT_IOMUX_SIGEVENT) {
- res = zt_get_event(p->subs[index].zfd);
+ if (i & DAHDI_IOMUX_SIGEVENT) {
+ res = dahdi_get_event(p->subs[index].zfd);
ast_log(LOG_NOTICE, "Got event %d (%s)...\n", res, event2str(res));
res = 0;
/* Let us detect callerid when the telco uses distinctive ring */
if (p->ringt < p->ringt_base/2)
break;
/* Increment the ringT counter so we can match it against
- values in zapata.conf for distinctive ring */
+ values in chan_dahdi.conf for distinctive ring */
if (++receivedRingT == (sizeof(curRingData) / sizeof(curRingData[0])))
break;
- } else if (i & ZT_IOMUX_READ) {
+ } else if (i & DAHDI_IOMUX_READ) {
res = read(p->subs[index].zfd, buf, sizeof(buf));
if (res < 0) {
if (errno != ELAST) {
ast_verb(3, "Detected ring pattern: %d,%d,%d\n",curRingData[0],curRingData[1],curRingData[2]);
for (counter = 0; counter < 3; counter++) {
- /* Check to see if the rings we received match any of the ones in zapata.conf for this
+ /* Check to see if the rings we received match any of the ones in chan_dahdi.conf for this
channel */
/* this only shows up if you have n of the dring patterns filled in */
ast_verb(3, "Checking %d,%d,%d\n",
}
}
/* Restore linear mode (if appropriate) for Caller*ID processing */
- zt_setlinear(p->subs[index].zfd, p->subs[index].linear);
+ dahdi_setlinear(p->subs[index].zfd, p->subs[index].linear);
#if 1
restore_gains(p);
#endif
return NULL;
default:
ast_log(LOG_WARNING, "Don't know how to handle simple switch with signalling %s on channel %d\n", sig2str(p->sig), p->channel);
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_CONGESTION);
if (res < 0)
ast_log(LOG_WARNING, "Unable to play congestion tone on channel %d\n", p->channel);
}
- res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);
+ res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_CONGESTION);
if (res < 0)
ast_log(LOG_WARNING, "Unable to play congestion tone on channel %d\n", p->channel);
ast_hangup(chan);
}
struct mwi_thread_data {
- struct zt_pvt *pvt;
+ struct dahdi_pvt *pvt;
unsigned char buf[READ_SIZE];
size_t len;
};
bump_gains(mtd->pvt);
for (;;) {
- i = ZT_IOMUX_READ | ZT_IOMUX_SIGEVENT;
- if ((res = ioctl(mtd->pvt->subs[SUB_REAL].zfd, ZT_IOMUX, &i))) {
+ i = DAHDI_IOMUX_READ | DAHDI_IOMUX_SIGEVENT;
+ if ((res = ioctl(mtd->pvt->subs[SUB_REAL].zfd, DAHDI_IOMUX, &i))) {
ast_log(LOG_WARNING, "I/O MUX failed: %s\n", strerror(errno));
goto quit;
}
- if (i & ZT_IOMUX_SIGEVENT) {
+ if (i & DAHDI_IOMUX_SIGEVENT) {
struct ast_channel *chan;
/* If we get an event, screen out events that we do not act on.
* Otherwise, cancel and go to the simple switch to let it deal with it.
*/
- res = zt_get_event(mtd->pvt->subs[SUB_REAL].zfd);
+ res = dahdi_get_event(mtd->pvt->subs[SUB_REAL].zfd);
switch (res) {
-#ifdef HAVE_ZAPTEL_NEONMWI
- case ZT_EVENT_NEONMWI_ACTIVE:
- case ZT_EVENT_NEONMWI_INACTIVE:
+#ifdef HAVE_DAHDI_NEONMWI
+ case DAHDI_EVENT_NEONMWI_ACTIVE:
+ case DAHDI_EVENT_NEONMWI_INACTIVE:
#endif
- case ZT_EVENT_NONE:
- case ZT_EVENT_BITSCHANGED:
+ case DAHDI_EVENT_NONE:
+ case DAHDI_EVENT_BITSCHANGED:
break;
- case ZT_EVENT_NOALARM:
+ case DAHDI_EVENT_NOALARM:
mtd->pvt->inalarm = 0;
ast_log(LOG_NOTICE, "Alarm cleared on channel %d\n", mtd->pvt->channel);
manager_event(EVENT_FLAG_SYSTEM, "AlarmClear",
"Channel: %d\r\n", mtd->pvt->channel);
break;
- case ZT_EVENT_ALARM:
+ case DAHDI_EVENT_ALARM:
mtd->pvt->inalarm = 1;
res = get_alarms(mtd->pvt);
ast_log(LOG_WARNING, "Detected alarm on channel %d: %s\n", mtd->pvt->channel, alarm2str(res));
restore_gains(mtd->pvt);
mtd->pvt->ringt = mtd->pvt->ringt_base;
- if ((chan = zt_new(mtd->pvt, AST_STATE_RING, 0, SUB_REAL, 0, 0))) {
+ if ((chan = dahdi_new(mtd->pvt, AST_STATE_RING, 0, SUB_REAL, 0, 0))) {
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
if (ast_pthread_create(&threadid, &attr, ss_thread, chan)) {
ast_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", mtd->pvt->channel);
- res = tone_zone_play_tone(mtd->pvt->subs[SUB_REAL].zfd, ZT_TONE_CONGESTION);
+ res = tone_zone_play_tone(mtd->pvt->subs[SUB_REAL].zfd, DAHDI_TONE_CONGESTION);
if (res < 0)
ast_log(LOG_WARNING, "Unable to play congestion tone on channel %d\n", mtd->pvt->channel);
ast_hangup(chan);
ast_log(LOG_WARNING, "Could not create channel to handle call\n");
}
}
- } else if (i & ZT_IOMUX_READ) {
+ } else if (i & DAHDI_IOMUX_READ) {
if ((res = read(mtd->pvt->subs[SUB_REAL].zfd, mtd->buf, sizeof(mtd->buf))) < 0) {
if (errno != ELAST) {
ast_log(LOG_WARNING, "read returned error: %s\n", strerror(errno));
return NULL;
}
-/* destroy a Zaptel channel, identified by its number */
-static int zap_destroy_channel_bynum(int channel)
+/* destroy a DAHDI channel, identified by its number */
+static int dahdi_destroy_channel_bynum(int channel)
{
- struct zt_pvt *tmp = NULL;
- struct zt_pvt *prev = NULL;
+ struct dahdi_pvt *tmp = NULL;
+ struct dahdi_pvt *prev = NULL;
tmp = iflist;
while (tmp) {
return RESULT_FAILURE;
}
-static int handle_init_event(struct zt_pvt *i, int event)
+static int handle_init_event(struct dahdi_pvt *i, int event)
{
int res;
pthread_t threadid;
/* Handle an event on a given channel for the monitor thread. */
switch (event) {
- case ZT_EVENT_NONE:
- case ZT_EVENT_BITSCHANGED:
+ case DAHDI_EVENT_NONE:
+ case DAHDI_EVENT_BITSCHANGED:
break;
- case ZT_EVENT_WINKFLASH:
- case ZT_EVENT_RINGOFFHOOK:
+ case DAHDI_EVENT_WINKFLASH:
+ case DAHDI_EVENT_RINGOFFHOOK:
if (i->inalarm) break;
if (i->radio) break;
/* Got a ring/answer. What kind of channel are we? */
case SIG_FXOLS:
case SIG_FXOGS:
case SIG_FXOKS:
- res = zt_set_hook(i->subs[SUB_REAL].zfd, ZT_OFFHOOK);
+ res = dahdi_set_hook(i->subs[SUB_REAL].zfd, DAHDI_OFFHOOK);
if (res && (errno == EBUSY))
break;
if (i->cidspill) {
i->cidspill = NULL;
}
if (i->immediate) {
- zt_enable_ec(i);
+ dahdi_enable_ec(i);
/* The channel is immediately up. Start right away */
- res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, ZT_TONE_RINGTONE);
- chan = zt_new(i, AST_STATE_RING, 1, SUB_REAL, 0, 0);
+ res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, DAHDI_TONE_RINGTONE);
+ chan = dahdi_new(i, AST_STATE_RING, 1, SUB_REAL, 0, 0);
if (!chan) {
ast_log(LOG_WARNING, "Unable to start PBX on channel %d\n", i->channel);
- res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, ZT_TONE_CONGESTION);
+ res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, DAHDI_TONE_CONGESTION);
if (res < 0)
ast_log(LOG_WARNING, "Unable to play congestion tone on channel %d\n", i->channel);
}
} else {
/* Check for callerid, digits, etc */
- chan = zt_new(i, AST_STATE_RESERVED, 0, SUB_REAL, 0, 0);
+ chan = dahdi_new(i, AST_STATE_RESERVED, 0, SUB_REAL, 0, 0);
if (chan) {
if (has_voicemail(i))
- res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, ZT_TONE_STUTTER);
+ res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, DAHDI_TONE_STUTTER);
else
- res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, ZT_TONE_DIALTONE);
+ res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, DAHDI_TONE_DIALTONE);
if (res < 0)
ast_log(LOG_WARNING, "Unable to play dialtone on channel %d, do you have defaultzone and loadzone defined?\n", i->channel);
if (ast_pthread_create_detached(&threadid, NULL, ss_thread, chan)) {
ast_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
- res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, ZT_TONE_CONGESTION);
+ res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, DAHDI_TONE_CONGESTION);
if (res < 0)
ast_log(LOG_WARNING, "Unable to play congestion tone on channel %d\n", i->channel);
ast_hangup(chan);
case SIG_SF:
/* Check for callerid, digits, etc */
if (i->cid_start == CID_START_POLARITY_IN) {
- chan = zt_new(i, AST_STATE_PRERING, 0, SUB_REAL, 0, 0);
+ chan = dahdi_new(i, AST_STATE_PRERING, 0, SUB_REAL, 0, 0);
} else {
- chan = zt_new(i, AST_STATE_RING, 0, SUB_REAL, 0, 0);
+ chan = dahdi_new(i, AST_STATE_RING, 0, SUB_REAL, 0, 0);
}
if (chan && ast_pthread_create_detached(&threadid, NULL, ss_thread, chan)) {
ast_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
- res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, ZT_TONE_CONGESTION);
+ res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, DAHDI_TONE_CONGESTION);
if (res < 0)
ast_log(LOG_WARNING, "Unable to play congestion tone on channel %d\n", i->channel);
ast_hangup(chan);
break;
default:
ast_log(LOG_WARNING, "Don't know how to handle ring/answer with signalling %s on channel %d\n", sig2str(i->sig), i->channel);
- res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, ZT_TONE_CONGESTION);
+ res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, DAHDI_TONE_CONGESTION);
if (res < 0)
ast_log(LOG_WARNING, "Unable to play congestion tone on channel %d\n", i->channel);
return -1;
}
break;
- case ZT_EVENT_NOALARM:
+ case DAHDI_EVENT_NOALARM:
i->inalarm = 0;
ast_log(LOG_NOTICE, "Alarm cleared on channel %d\n", i->channel);
manager_event(EVENT_FLAG_SYSTEM, "AlarmClear",
"Channel: %d\r\n", i->channel);
break;
- case ZT_EVENT_ALARM:
+ case DAHDI_EVENT_ALARM:
i->inalarm = 1;
res = get_alarms(i);
ast_log(LOG_WARNING, "Detected alarm on channel %d: %s\n", i->channel, alarm2str(res));
"Channel: %d\r\n",
alarm2str(res), i->channel);
/* fall thru intentionally */
- case ZT_EVENT_ONHOOK:
+ case DAHDI_EVENT_ONHOOK:
if (i->radio)
break;
/* Back on hook. Hang up. */
case SIG_FXSGS:
case SIG_FXSKS:
case SIG_GR303FXSKS:
- zt_disable_ec(i);
+ dahdi_disable_ec(i);
res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, -1);
- zt_set_hook(i->subs[SUB_REAL].zfd, ZT_ONHOOK);
+ dahdi_set_hook(i->subs[SUB_REAL].zfd, DAHDI_ONHOOK);
break;
case SIG_GR303FXOKS:
case SIG_FXOKS:
- zt_disable_ec(i);
+ dahdi_disable_ec(i);
/* Diddle the battery for the zhone */
#ifdef ZHONE_HACK
- zt_set_hook(i->subs[SUB_REAL].zfd, ZT_OFFHOOK);
+ dahdi_set_hook(i->subs[SUB_REAL].zfd, DAHDI_OFFHOOK);
usleep(1);
#endif
res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, -1);
- zt_set_hook(i->subs[SUB_REAL].zfd, ZT_ONHOOK);
+ dahdi_set_hook(i->subs[SUB_REAL].zfd, DAHDI_ONHOOK);
break;
case SIG_PRI:
case SIG_SS7:
case SIG_BRI:
case SIG_BRI_PTMP:
- zt_disable_ec(i);
+ dahdi_disable_ec(i);
res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, -1);
break;
default:
return -1;
}
break;
- case ZT_EVENT_POLARITY:
+ case DAHDI_EVENT_POLARITY:
switch (i->sig) {
case SIG_FXSLS:
case SIG_FXSKS:
ast_verb(2, "Starting post polarity "
"CID detection on channel %d\n",
i->channel);
- chan = zt_new(i, AST_STATE_PRERING, 0, SUB_REAL, 0, 0);
+ chan = dahdi_new(i, AST_STATE_PRERING, 0, SUB_REAL, 0, 0);
if (chan && ast_pthread_create_detached(&threadid, NULL, ss_thread, chan)) {
ast_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
}
"interface %d\n", i->channel);
}
break;
- case ZT_EVENT_REMOVED: /* destroy channel */
+ case DAHDI_EVENT_REMOVED: /* destroy channel */
ast_log(LOG_NOTICE,
- "Got ZT_EVENT_REMOVED. Destroying channel %d\n",
+ "Got DAHDI_EVENT_REMOVED. Destroying channel %d\n",
i->channel);
- zap_destroy_channel_bynum(i->channel);
+ dahdi_destroy_channel_bynum(i->channel);
break;
-#ifdef HAVE_ZAPTEL_NEONMWI
- case ZT_EVENT_NEONMWI_ACTIVE:
+#ifdef HAVE_DAHDI_NEONMWI
+ case DAHDI_EVENT_NEONMWI_ACTIVE:
if (i->mwimonitor_neon) {
notify_message(i->mailbox, 1);
ast_log(LOG_NOTICE, "NEON MWI set for channel %d, mailbox %s \n", i->channel, i->mailbox);
}
break;
- case ZT_EVENT_NEONMWI_INACTIVE:
+ case DAHDI_EVENT_NEONMWI_INACTIVE:
if (i->mwimonitor_neon) {
notify_message(i->mailbox, 0);
ast_log(LOG_NOTICE, "NEON MWI cleared for channel %d, mailbox %s\n", i->channel, i->mailbox);
static void *do_monitor(void *data)
{
int count, res, res2, spoint, pollres=0;
- struct zt_pvt *i;
- struct zt_pvt *last = NULL;
+ struct dahdi_pvt *i;
+ struct dahdi_pvt *last = NULL;
time_t thispass = 0, lastpass = 0;
int found;
char buf[1024];
lastalloc = ifcount;
}
/* Build the stuff we're going to poll on, that is the socket of every
- zt_pvt that does not have an associated owner channel */
+ dahdi_pvt that does not have an associated owner channel */
count = 0;
i = iflist;
while (i) {
last = i;
if (last) {
if (!last->cidspill && !last->owner && !ast_strlen_zero(last->mailbox) && (thispass - last->onhooktime > 3) &&
- (last->sig & __ZT_SIG_FXO)) {
+ (last->sig & __DAHDI_SIG_FXO)) {
res = has_voicemail(last);
if (last->msgstate != res) {
int x;
ast_debug(1, "Message status for %s changed from %d to %d on %d\n", last->mailbox, last->msgstate, res, last->channel);
-#ifdef ZT_VMWI
- res2 = ioctl(last->subs[SUB_REAL].zfd, ZT_VMWI, res);
+#ifdef DAHDI_VMWI
+ res2 = ioctl(last->subs[SUB_REAL].zfd, DAHDI_VMWI, res);
if (res2)
ast_log(LOG_DEBUG, "Unable to control message waiting led on channel %d\n", last->channel);
#endif
- x = ZT_FLUSH_BOTH;
- res2 = ioctl(last->subs[SUB_REAL].zfd, ZT_FLUSH, &x);
+ x = DAHDI_FLUSH_BOTH;
+ res2 = ioctl(last->subs[SUB_REAL].zfd, DAHDI_FLUSH, &x);
if (res2)
ast_log(LOG_WARNING, "Unable to flush input on channel %d\n", last->channel);
if ((last->cidspill = ast_calloc(1, MAX_CALLERID_SIZE))) {
/* Turn on on hook transfer for 4 seconds */
x = 4000;
- ioctl(last->subs[SUB_REAL].zfd, ZT_ONHOOKTRANSFER, &x);
+ ioctl(last->subs[SUB_REAL].zfd, DAHDI_ONHOOKTRANSFER, &x);
last->cidlen = vmwi_generate(last->cidspill, res, 1, AST_LAW(last));
last->cidpos = 0;
last->msgstate = res;
if ((i->subs[SUB_REAL].zfd > -1) && i->sig) {
if (i->radio && !i->owner)
{
- res = zt_get_event(i->subs[SUB_REAL].zfd);
+ res = dahdi_get_event(i->subs[SUB_REAL].zfd);
if (res)
{
ast_debug(1, "Monitor doohicky got event %s on radio channel %d\n", event2str(res), i->channel);
i = i->next;
continue;
}
- res = zt_get_event(i->subs[SUB_REAL].zfd);
+ res = dahdi_get_event(i->subs[SUB_REAL].zfd);
ast_debug(1, "Monitor doohicky got event %s on channel %d\n", event2str(res), i->channel);
/* Don't hold iflock while handling init events */
ast_mutex_unlock(&iflock);
}
#ifdef HAVE_PRI
-static int pri_resolve_span(int *span, int channel, int offset, struct zt_spaninfo *si)
+static int pri_resolve_span(int *span, int channel, int offset, struct dahdi_spaninfo *si)
{
int x;
int trunkgroup;
static int pri_create_trunkgroup(int trunkgroup, int *channels)
{
- struct zt_spaninfo si;
- ZT_PARAMS p;
+ struct dahdi_spaninfo si;
+ DAHDI_PARAMS p;
int fd;
int span;
int ospan=0;
break;
memset(&si, 0, sizeof(si));
memset(&p, 0, sizeof(p));
- fd = open("/dev/zap/channel", O_RDWR);
+ fd = open("/dev/dahdi/channel", O_RDWR);
if (fd < 0) {
ast_log(LOG_WARNING, "Failed to open channel: %s\n", strerror(errno));
return -1;
}
x = channels[y];
- if (ioctl(fd, ZT_SPECIFY, &x)) {
+ if (ioctl(fd, DAHDI_SPECIFY, &x)) {
ast_log(LOG_WARNING, "Failed to specify channel %d: %s\n", channels[y], strerror(errno));
- zt_close(fd);
+ dahdi_close(fd);
return -1;
}
- if (ioctl(fd, ZT_GET_PARAMS, &p)) {
+ if (ioctl(fd, DAHDI_GET_PARAMS, &p)) {
ast_log(LOG_WARNING, "Failed to get channel parameters for channel %d: %s\n", channels[y], strerror(errno));
return -1;
}
- if (ioctl(fd, ZT_SPANSTAT, &si)) {
+ if (ioctl(fd, DAHDI_SPANSTAT, &si)) {
ast_log(LOG_WARNING, "Failed go get span information on channel %d (span %d)\n", channels[y], p.spanno);
- zt_close(fd);
+ dahdi_close(fd);
return -1;
}
span = p.spanno - 1;
if (pris[span].trunkgroup) {
ast_log(LOG_WARNING, "Span %d is already provisioned for trunk group %d\n", span + 1, pris[span].trunkgroup);
- zt_close(fd);
+ dahdi_close(fd);
return -1;
}
if (pris[span].pvts[0]) {
ast_log(LOG_WARNING, "Span %d is already provisioned with channels (implicit PRI maybe?)\n", span + 1);
- zt_close(fd);
+ dahdi_close(fd);
return -1;
}
if (!y) {
pris[ospan].dchannels[y] = channels[y];
pris[ospan].dchanavail[y] |= DCHAN_PROVISIONED;
pris[span].span = span + 1;
- zt_close(fd);
+ dahdi_close(fd);
}
return 0;
}
return 0;
}
-static struct zt_ss7 * ss7_resolve_linkset(int linkset)
+static struct dahdi_ss7 * ss7_resolve_linkset(int linkset)
{
if ((linkset < 0) || (linkset >= NUM_SPANS))
return NULL;
}
#endif /* HAVE_SS7 */
-/* converts a Zaptel sigtype to signalling as can be configured from
- * zapata.conf.
+/* converts a DAHDI sigtype to signalling as can be configured from
+ * chan_dahdi.conf.
* While both have basically the same values, this will later be the
* place to add filters and sanity checks
*/
return sigtype;
}
-static struct zt_pvt *mkintf(int channel, const struct zt_chan_conf *conf, struct zt_pri *pri, int reloading)
+static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf, struct dahdi_pri *pri, int reloading)
{
- /* Make a zt_pvt structure for this interface (or CRV if "pri" is specified) */
- struct zt_pvt *tmp = NULL, *tmp2, *prev = NULL;
+ /* Make a dahdi_pvt structure for this interface (or CRV if "pri" is specified) */
+ struct dahdi_pvt *tmp = NULL, *tmp2, *prev = NULL;
char fn[80];
#if 1
- struct zt_bufferinfo bi;
+ struct dahdi_bufferinfo bi;
#endif
- struct zt_spaninfo si;
+ struct dahdi_spaninfo si;
int res;
int span = 0;
int here = 0;
int x;
- struct zt_pvt **wlist;
- struct zt_pvt **wend;
- ZT_PARAMS p;
+ struct dahdi_pvt **wlist;
+ struct dahdi_pvt **wend;
+ DAHDI_PARAMS p;
wlist = &iflist;
wend = &ifend;
if (!here && !reloading) {
if (!(tmp = ast_calloc(1, sizeof(*tmp)))) {
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
ast_mutex_init(&tmp->lock);
snprintf(fn, sizeof(fn), "%d", channel);
/* Open non-blocking */
if (!here)
- tmp->subs[SUB_REAL].zfd = zt_open(fn);
- /* Allocate a zapata structure */
+ tmp->subs[SUB_REAL].zfd = dahdi_open(fn);
+ /* Allocate a dahdi structure */
if (tmp->subs[SUB_REAL].zfd < 0) {
ast_log(LOG_ERROR, "Unable to open channel %d: %s\nhere = %d, tmp->channel = %d, channel = %d\n", channel, strerror(errno), here, tmp->channel, channel);
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
memset(&p, 0, sizeof(p));
- res = ioctl(tmp->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &p);
+ res = ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_GET_PARAMS, &p);
if (res < 0) {
ast_log(LOG_ERROR, "Unable to get parameters\n");
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
if (conf->is_sig_auto)
chan_sig = sigtype_to_signalling(p.sigtype);
if (p.sigtype != (conf->chan.sig & 0x3ffff)) {
ast_log(LOG_ERROR, "Signalling requested on channel %d is %s but line is in %s signalling\n", channel, sig2str(conf->chan.sig), sig2str(p.sigtype));
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
tmp->law = p.curlaw;
}
}
#ifdef HAVE_SS7
- if (chan_sig == SIG_SS7) {
- struct zt_ss7 *ss7;
+ if (conf->chan.sig == SIG_SS7) {
+ struct dahdi_ss7 *ss7;
int clear = 0;
- if (ioctl(tmp->subs[SUB_REAL].zfd, ZT_AUDIOMODE, &clear)) {
+ if (ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_AUDIOMODE, &clear)) {
ast_log(LOG_ERROR, "Unable to set clear mode on clear channel %d of span %d: %s\n", channel, p.spanno, strerror(errno));
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
ss7 = ss7_resolve_linkset(cur_linkset);
if (!ss7) {
ast_log(LOG_ERROR, "Unable to find linkset %d\n", cur_linkset);
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
if (cur_cicbeginswith < 0) {
ast_log(LOG_ERROR, "Need to set cicbeginswith for the channels!\n");
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
}
#endif
#ifdef HAVE_PRI
- if ((chan_sig == SIG_PRI) || (chan_sig == SIG_BRI) || (chan_sig == SIG_BRI_PTMP) || (chan_sig == SIG_GR303FXOKS) || (chan_sig == SIG_GR303FXSKS)) {
+ if ((conf->chan.sig == SIG_PRI) || (conf->chan.sig == SIG_BRI) || (conf->chan.sig == SIG_BRI_PTMP) || (conf->chan.sig == SIG_GR303FXOKS) || (conf->chan.sig == SIG_GR303FXSKS)) {
int offset;
int myswitchtype;
int matchesdchan;
int x,y;
offset = 0;
- if (((chan_sig == SIG_PRI) || (chan_sig == SIG_BRI) || (chan_sig == SIG_BRI_PTMP))
- && ioctl(tmp->subs[SUB_REAL].zfd, ZT_AUDIOMODE, &offset)) {
+ if (((conf->chan.sig == SIG_PRI) || (conf->chan.sig == SIG_BRI) || (conf->chan.sig == SIG_BRI_PTMP))
+ && ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_AUDIOMODE, &offset)) {
ast_log(LOG_ERROR, "Unable to set clear mode on clear channel %d of span %d: %s\n", channel, p.spanno, strerror(errno));
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
if (span >= NUM_SPANS) {
ast_log(LOG_ERROR, "Channel %d does not lie on a span I know of (%d)\n", channel, span);
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
} else {
si.spanno = 0;
- if (ioctl(tmp->subs[SUB_REAL].zfd,ZT_SPANSTAT,&si) == -1) {
+ if (ioctl(tmp->subs[SUB_REAL].zfd,DAHDI_SPANSTAT,&si) == -1) {
ast_log(LOG_ERROR, "Unable to get span status: %s\n", strerror(errno));
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
/* Store the logical span first based upon the real span */
pri_resolve_span(&span, channel, (channel - p.chanpos), &si);
if (span < 0) {
ast_log(LOG_WARNING, "Channel %d: Unable to find locate channel/trunk group!\n", channel);
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
- if ((chan_sig == SIG_PRI) ||
- (chan_sig == SIG_BRI) ||
- (chan_sig == SIG_BRI_PTMP))
+ if ((conf->chan.sig == SIG_PRI) ||
+ (conf->chan.sig == SIG_BRI) ||
+ (conf->chan.sig == SIG_BRI_PTMP))
myswitchtype = conf->pri.switchtype;
else
myswitchtype = PRI_SWITCH_GR303_TMC;
if (!matchesdchan) {
if (pris[span].nodetype && (pris[span].nodetype != conf->pri.nodetype)) {
ast_log(LOG_ERROR, "Span %d is already a %s node\n", span + 1, pri_node2str(pris[span].nodetype));
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
if (pris[span].switchtype && (pris[span].switchtype != myswitchtype)) {
ast_log(LOG_ERROR, "Span %d is already a %s switch\n", span + 1, pri_switch2str(pris[span].switchtype));
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
if ((pris[span].dialplan) && (pris[span].dialplan != conf->pri.dialplan)) {
ast_log(LOG_ERROR, "Span %d is already a %s dialing plan\n", span + 1, dialplan2str(pris[span].dialplan));
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
if (!ast_strlen_zero(pris[span].idledial) && strcmp(pris[span].idledial, conf->pri.idledial)) {
ast_log(LOG_ERROR, "Span %d already has idledial '%s'.\n", span + 1, conf->pri.idledial);
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
if (!ast_strlen_zero(pris[span].idleext) && strcmp(pris[span].idleext, conf->pri.idleext)) {
ast_log(LOG_ERROR, "Span %d already has idleext '%s'.\n", span + 1, conf->pri.idleext);
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
if (pris[span].minunused && (pris[span].minunused != conf->pri.minunused)) {
ast_log(LOG_ERROR, "Span %d already has minunused of %d.\n", span + 1, conf->pri.minunused);
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
if (pris[span].minidle && (pris[span].minidle != conf->pri.minidle)) {
ast_log(LOG_ERROR, "Span %d already has minidle of %d.\n", span + 1, conf->pri.minidle);
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
if (pris[span].numchans >= MAX_CHANNELS) {
ast_log(LOG_ERROR, "Unable to add channel %d: Too many channels in trunk group %d!\n", channel,
pris[span].trunkgroup);
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
tmp->call = NULL;
} else {
ast_log(LOG_ERROR, "Channel %d is reserved for D-channel.\n", offset);
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
}
chan_sig = tmp->sig;
memset(&p, 0, sizeof(p));
if (tmp->subs[SUB_REAL].zfd > -1)
- res = ioctl(tmp->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &p);
+ res = ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_GET_PARAMS, &p);
}
/* Adjust starttime on loopstart and kewlstart trunks to reasonable values */
switch (chan_sig) {
/* dont set parms on a pseudo-channel (or CRV) */
if (tmp->subs[SUB_REAL].zfd >= 0)
{
- res = ioctl(tmp->subs[SUB_REAL].zfd, ZT_SET_PARAMS, &p);
+ res = ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_SET_PARAMS, &p);
if (res < 0) {
ast_log(LOG_ERROR, "Unable to set parameters\n");
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
}
#if 1
if (!here && (tmp->subs[SUB_REAL].zfd > -1)) {
memset(&bi, 0, sizeof(bi));
- res = ioctl(tmp->subs[SUB_REAL].zfd, ZT_GET_BUFINFO, &bi);
+ res = ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_GET_BUFINFO, &bi);
if (!res) {
- bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
- bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
+ bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
+ bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.numbufs = numbufs;
- res = ioctl(tmp->subs[SUB_REAL].zfd, ZT_SET_BUFINFO, &bi);
+ res = ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_SET_BUFINFO, &bi);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to set buffer policy on channel %d\n", channel);
}
#endif
tmp->immediate = conf->chan.immediate;
tmp->transfertobusy = conf->chan.transfertobusy;
- if (conf->chan.sig & __ZT_SIG_FXS) {
+ if (conf->chan.sig & __DAHDI_SIG_FXS) {
tmp->mwimonitor_fsk = conf->chan.mwimonitor_fsk;
tmp->mwimonitor_neon = conf->chan.mwimonitor_neon;
}
tmp->echocancel = conf->chan.echocancel;
tmp->echotraining = conf->chan.echotraining;
tmp->pulse = conf->chan.pulse;
-#if defined(HAVE_ZAPTEL_ECHOCANPARAMS)
if (tmp->echocancel.head.tap_length) {
-#else
- if (tmp->echocancel) {
-#endif
tmp->echocanbridged = conf->chan.echocanbridged;
} else {
if (conf->chan.echocanbridged)
tmp->use_callerid = conf->chan.use_callerid;
tmp->cid_signalling = conf->chan.cid_signalling;
tmp->cid_start = conf->chan.cid_start;
- tmp->zaptrcallerid = conf->chan.zaptrcallerid;
+ tmp->dahditrcallerid = conf->chan.dahditrcallerid;
tmp->restrictcid = conf->chan.restrictcid;
tmp->use_callingpres = conf->chan.use_callingpres;
tmp->priindication_oob = conf->chan.priindication_oob;
if (!here) {
if ((chan_sig != SIG_BRI) && (chan_sig != SIG_BRI_PTMP) && (chan_sig != SIG_PRI) && (chan_sig != SIG_SS7))
/* Hang it up to be sure it's good */
- zt_set_hook(tmp->subs[SUB_REAL].zfd, ZT_ONHOOK);
+ dahdi_set_hook(tmp->subs[SUB_REAL].zfd, DAHDI_ONHOOK);
}
- ioctl(tmp->subs[SUB_REAL].zfd,ZT_SETTONEZONE,&tmp->tonezone);
+ ioctl(tmp->subs[SUB_REAL].zfd,DAHDI_SETTONEZONE,&tmp->tonezone);
#ifdef HAVE_PRI
/* the dchannel is down so put the channel in alarm */
if (tmp->pri && !pri_is_up(tmp->pri))
tmp->inalarm = 0;
#endif
memset(&si, 0, sizeof(si));
- if (ioctl(tmp->subs[SUB_REAL].zfd,ZT_SPANSTAT,&si) == -1) {
+ if (ioctl(tmp->subs[SUB_REAL].zfd,DAHDI_SPANSTAT,&si) == -1) {
ast_log(LOG_ERROR, "Unable to get span status: %s\n", strerror(errno));
- destroy_zt_pvt(&tmp);
+ destroy_dahdi_pvt(&tmp);
return NULL;
}
if (si.alarms) tmp->inalarm = 1;
*wend = tmp;
} else {
/* at least one member on the iflist */
- struct zt_pvt *working = *wlist;
+ struct dahdi_pvt *working = *wlist;
/* check if we maybe have to put it on the begining */
if (working->channel > tmp->channel) {
return tmp;
}
-static inline int available(struct zt_pvt *p, int channelmatch, ast_group_t groupmatch, int *busy, int *channelmatched, int *groupmatched)
+static inline int available(struct dahdi_pvt *p, int channelmatch, ast_group_t groupmatch, int *busy, int *channelmatched, int *groupmatched)
{
int res;
- ZT_PARAMS par;
+ DAHDI_PARAMS par;
/* First, check group matching */
if (groupmatch) {
return 1;
/* Check hook state */
if (p->subs[SUB_REAL].zfd > -1)
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &par);
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_GET_PARAMS, &par);
else {
/* Assume not off hook on CVRS */
res = 0;
if (par.rxisoffhook)
return 1;
else
-#ifdef ZAP_CHECK_HOOKSTATE
+#ifdef DAHDI_CHECK_HOOKSTATE
return 0;
#else
return 1;
return 1;
}
-static struct zt_pvt *chandup(struct zt_pvt *src)
+static struct dahdi_pvt *chandup(struct dahdi_pvt *src)
{
- struct zt_pvt *p;
- ZT_BUFFERINFO bi;
+ struct dahdi_pvt *p;
+ DAHDI_BUFFERINFO bi;
int res;
if ((p = ast_malloc(sizeof(*p)))) {
- memcpy(p, src, sizeof(struct zt_pvt));
+ memcpy(p, src, sizeof(struct dahdi_pvt));
ast_mutex_init(&p->lock);
- p->subs[SUB_REAL].zfd = zt_open("/dev/zap/pseudo");
- /* Allocate a zapata structure */
+ p->subs[SUB_REAL].zfd = dahdi_open("/dev/dahdi/pseudo");
+ /* Allocate a dahdi structure */
if (p->subs[SUB_REAL].zfd < 0) {
ast_log(LOG_ERROR, "Unable to dup channel: %s\n", strerror(errno));
- destroy_zt_pvt(&p);
+ destroy_dahdi_pvt(&p);
return NULL;
}
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_GET_BUFINFO, &bi);
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_GET_BUFINFO, &bi);
if (!res) {
- bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
- bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
+ bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
+ bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.numbufs = numbufs;
- res = ioctl(p->subs[SUB_REAL].zfd, ZT_SET_BUFINFO, &bi);
+ res = ioctl(p->subs[SUB_REAL].zfd, DAHDI_SET_BUFINFO, &bi);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to set buffer policy on dup channel\n");
}
#ifdef HAVE_PRI
-static int pri_find_empty_chan(struct zt_pri *pri, int backwards)
+static int pri_find_empty_chan(struct dahdi_pri *pri, int backwards)
{
int x;
if (backwards)
}
#endif
-static struct ast_channel *zt_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *dahdi_request(const char *type, int format, void *data, int *cause)
{
ast_group_t groupmatch = 0;
int channelmatch = -1;
int roundrobin = 0;
int callwait = 0;
int busy = 0;
- struct zt_pvt *p;
+ struct dahdi_pvt *p;
struct ast_channel *tmp = NULL;
char *dest=NULL;
int x;
int crv;
int bearer = -1;
int trunkgroup;
- struct zt_pri *pri=NULL;
+ struct dahdi_pri *pri=NULL;
#endif
- struct zt_pvt *exit, *start, *end;
+ struct dahdi_pvt *exit, *start, *end;
ast_mutex_t *lock;
int channelmatched = 0;
int groupmatched = 0;
}
}
p->outgoing = 1;
- tmp = zt_new(p, AST_STATE_RESERVED, 0, p->owner ? SUB_CALLWAIT : SUB_REAL, 0, 0);
+ tmp = dahdi_new(p, AST_STATE_RESERVED, 0, p->owner ? SUB_CALLWAIT : SUB_REAL, 0, 0);
#ifdef HAVE_PRI
if (p->bearer) {
/* Log owner to bearer channel, too */
}
#if defined(HAVE_PRI) || defined(HAVE_SS7)
-static int zt_setlaw(int zfd, int law)
+static int dahdi_setlaw(int zfd, int law)
{
- return ioctl(zfd, ZT_SETLAW, &law);
+ return ioctl(zfd, DAHDI_SETLAW, &law);
}
#endif
#ifdef HAVE_SS7
-static int ss7_find_cic(struct zt_ss7 *linkset, int cic, unsigned int dpc)
+static int ss7_find_cic(struct dahdi_ss7 *linkset, int cic, unsigned int dpc)
{
int i;
int winner = -1;
return winner;
}
-static void ss7_handle_cqm(struct zt_ss7 *linkset, int startcic, int endcic, unsigned int dpc)
+static void ss7_handle_cqm(struct dahdi_ss7 *linkset, int startcic, int endcic, unsigned int dpc)
{
unsigned char status[32];
- struct zt_pvt *p = NULL;
+ struct dahdi_pvt *p = NULL;
int i, offset;
for (i = 0; i < linkset->numchans; i++) {
}
-static inline void ss7_block_cics(struct zt_ss7 *linkset, int startcic, int endcic, unsigned int dpc, unsigned char state[], int block)
+static inline void ss7_block_cics(struct dahdi_ss7 *linkset, int startcic, int endcic, unsigned int dpc, unsigned char state[], int block)
{
int i;
}
}
-static void ss7_inservice(struct zt_ss7 *linkset, int startcic, int endcic, unsigned int dpc)
+static void ss7_inservice(struct dahdi_ss7 *linkset, int startcic, int endcic, unsigned int dpc)
{
int i;
}
}
-static void ss7_reset_linkset(struct zt_ss7 *linkset)
+static void ss7_reset_linkset(struct dahdi_ss7 *linkset)
{
int i, startcic = -1, endcic, dpc;
}
}
-static void zt_loopback(struct zt_pvt *p, int enable)
+static void dahdi_loopback(struct dahdi_pvt *p, int enable)
{
if (p->loopedback != enable) {
- if (ioctl(p->subs[SUB_REAL].zfd, ZT_LOOPBACK, &enable)) {
+ if (ioctl(p->subs[SUB_REAL].zfd, DAHDI_LOOPBACK, &enable)) {
ast_log(LOG_WARNING, "Unable to set loopback on channel %d\n", p->channel);
return;
}
}
/* XXX: This function is assumed to be called with the private channel lock and linkset lock held */
-static void ss7_start_call(struct zt_pvt *p, struct zt_ss7 *linkset)
+static void ss7_start_call(struct dahdi_pvt *p, struct dahdi_ss7 *linkset)
{
struct ss7 *ss7 = linkset->ss7;
int res;
struct ast_channel *c;
char tmp[256];
- if (ioctl(p->subs[SUB_REAL].zfd, ZT_AUDIOMODE, &law) == -1)
+ if (ioctl(p->subs[SUB_REAL].zfd, DAHDI_AUDIOMODE, &law) == -1)
ast_log(LOG_WARNING, "Unable to set audio mode on channel %d to %d\n", p->channel, law);
if (linkset->type == SS7_ITU)
- law = ZT_LAW_ALAW;
+ law = DAHDI_LAW_ALAW;
else
- law = ZT_LAW_MULAW;
+ law = DAHDI_LAW_MULAW;
- res = zt_setlaw(p->subs[SUB_REAL].zfd, law);
+ res = dahdi_setlaw(p->subs[SUB_REAL].zfd, law);
if (res < 0)
ast_log(LOG_WARNING, "Unable to set law on channel %d\n", p->channel);
isup_acm(ss7, p->ss7call);
ast_mutex_unlock(&linkset->lock);
- c = zt_new(p, AST_STATE_RING, 1, SUB_REAL, law, 0);
+ c = dahdi_new(p, AST_STATE_RING, 1, SUB_REAL, law, 0);
if (!c) {
ast_log(LOG_WARNING, "Unable to start PBX on CIC %d\n", p->cic);
} else
ast_verb(3, "Accepting call to '%s' on CIC %d\n", p->exten, p->cic);
- zt_enable_ec(p);
+ dahdi_enable_ec(p);
/* We only reference these variables in the context of the ss7_linkset function
* when receiving either and IAM or a COT message. Since they are only accessed
ast_mutex_lock(&linkset->lock);
}
-static void ss7_apply_plan_to_number(char *buf, size_t size, const struct zt_ss7 *ss7, const char *number, const unsigned nai)
+static void ss7_apply_plan_to_number(char *buf, size_t size, const struct dahdi_ss7 *ss7, const char *number, const unsigned nai)
{
switch (nai) {
case SS7_NAI_INTERNATIONAL:
{
int res, i;
struct timeval *next = NULL, tv;
- struct zt_ss7 *linkset = (struct zt_ss7 *) data;
+ struct dahdi_ss7 *linkset = (struct dahdi_ss7 *) data;
struct ss7 *ss7 = linkset->ss7;
ss7_event *e = NULL;
- struct zt_pvt *p;
+ struct dahdi_pvt *p;
int chanpos;
struct pollfd pollers[NUM_DCHANS];
int cic;
for (i = 0; i < linkset->numsigchans; i++) {
if (pollers[i].revents & POLLPRI) {
int x;
- if (ioctl(pollers[i].fd, ZT_GETEVENT, &x)) {
+ if (ioctl(pollers[i].fd, DAHDI_GETEVENT, &x)) {
ast_log(LOG_ERROR, "Error in exception retrieval!\n");
}
switch (x) {
- case ZT_EVENT_OVERRUN:
+ case DAHDI_EVENT_OVERRUN:
ast_debug(1, "Overrun detected!\n");
break;
- case ZT_EVENT_BADFCS:
+ case DAHDI_EVENT_BADFCS:
ast_debug(1, "Bad FCS\n");
break;
- case ZT_EVENT_ABORT:
+ case DAHDI_EVENT_ABORT:
ast_debug(1, "HDLC Abort\n");
break;
- case ZT_EVENT_ALARM:
+ case DAHDI_EVENT_ALARM:
ast_log(LOG_ERROR, "Alarm on link!\n");
linkset->linkstate[i] |= (LINKSTATE_DOWN | LINKSTATE_INALARM);
linkset->linkstate[i] &= ~LINKSTATE_UP;
ss7_link_alarm(ss7, pollers[i].fd);
break;
- case ZT_EVENT_NOALARM:
+ case DAHDI_EVENT_NOALARM:
ast_log(LOG_ERROR, "Alarm cleared on link\n");
linkset->linkstate[i] &= ~(LINKSTATE_INALARM | LINKSTATE_DOWN);
linkset->linkstate[i] |= LINKSTATE_STARTING;
ast_verbose("--- SS7 Down ---\n");
linkset->state = LINKSET_STATE_DOWN;
for (i = 0; i < linkset->numchans; i++) {
- struct zt_pvt *p = linkset->pvts[i];
+ struct dahdi_pvt *p = linkset->pvts[i];
if (p)
p->inalarm = 1;
}
{
struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_PROGRESS, };
ast_debug(1, "Queuing frame PROGRESS on CIC %d\n", p->cic);
- zap_queue_frame(p, &f, linkset);
+ dahdi_queue_frame(p, &f, linkset);
p->progress = 1;
if (p->dsp && p->dsp_features) {
ast_dsp_set_features(p->dsp, p->dsp_features);
}
p = linkset->pvts[chanpos];
ast_mutex_lock(&p->lock);
-
p->inservice = 1;
p->remotelyblocked = 0;
dpc = p->dpc;
isup_set_call_dpc(e->rsc.call, dpc);
- if (p->ss7call)
- p->ss7call = NULL;
- if (p->owner)
- p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
-
ast_mutex_unlock(&p->lock);
-
isup_rlc(ss7, e->rsc.call);
break;
case ISUP_EVENT_GRS:
if (ast_exists_extension(NULL, p->context, p->exten, 1, p->cid_num)) {
if (e->iam.cot_check_required) {
- zt_loopback(p, 1);
+ dahdi_loopback(p, 1);
} else
ss7_start_call(p, linkset);
} else {
ast_mutex_lock(&p->lock);
if (p->loopedback) {
- zt_loopback(p, 0);
+ dahdi_loopback(p, 0);
ss7_start_call(p, linkset);
}
p = linkset->pvts[chanpos];
ast_mutex_lock(&p->lock);
- zt_loopback(p, 1);
+ dahdi_loopback(p, 1);
ast_mutex_unlock(&p->lock);
isup_lpa(linkset->ss7, e->ccr.cic, p->dpc);
p = linkset->pvts[chanpos];
ast_mutex_lock(&p->lock);
- zt_loopback(p, 1);
+ dahdi_loopback(p, 1);
ast_mutex_unlock(&p->lock);
isup_cvr(linkset->ss7, e->cvt.cic, p->dpc);
ast_log(LOG_WARNING, "REL on channel (CIC %d) without owner!\n", p->cic);
/* End the loopback if we have one */
- zt_loopback(p, 0);
+ dahdi_loopback(p, 0);
isup_rlc(ss7, e->rel.call);
p->ss7call = NULL;
}
ast_mutex_lock(&p->lock);
- zap_queue_frame(p, &f, linkset);
+ dahdi_queue_frame(p, &f, linkset);
p->proceeding = 1;
/* Send alerting if subscriber is free */
if (e->acm.called_party_status_ind == 1) {
ast_dsp_set_features(p->dsp, p->dsp_features);
p->dsp_features = 0;
}
- zt_enable_ec(p);
+ dahdi_enable_ec(p);
ast_mutex_unlock(&p->lock);
}
break;
return 0;
}
-static void zt_ss7_message(struct ss7 *ss7, char *s)
+static void dahdi_ss7_message(struct ss7 *ss7, char *s)
{
#if 0
int i;
#endif
}
-static void zt_ss7_error(struct ss7 *ss7, char *s)
+static void dahdi_ss7_error(struct ss7 *ss7, char *s)
{
#if 0
int i;
#endif /* HAVE_SS7 */
#ifdef HAVE_PRI
-static struct zt_pvt *pri_find_crv(struct zt_pri *pri, int crv)
+static struct dahdi_pvt *pri_find_crv(struct dahdi_pri *pri, int crv)
{
- struct zt_pvt *p;
+ struct dahdi_pvt *p;
p = pri->crvs;
while (p) {
if (p->channel == crv)
}
-static int pri_find_principle(struct zt_pri *pri, int channel)
+static int pri_find_principle(struct dahdi_pri *pri, int channel)
{
int x;
int span = PRI_SPAN(channel);
int spanfd;
- ZT_PARAMS param;
+ DAHDI_PARAMS param;
int principle = -1;
int explicit = PRI_EXPLICIT(channel);
channel = PRI_CHANNEL(channel);
if (!explicit) {
spanfd = pri_active_dchan_fd(pri);
- if (ioctl(spanfd, ZT_GET_PARAMS, ¶m))
+ if (ioctl(spanfd, DAHDI_GET_PARAMS, ¶m))
return -1;
span = pris[param.spanno - 1].prilogicalspan;
}
return principle;
}
-static int pri_fixup_principle(struct zt_pri *pri, int principle, q931_call *c)
+static int pri_fixup_principle(struct dahdi_pri *pri, int principle, q931_call *c)
{
int x;
- struct zt_pvt *crv;
+ struct dahdi_pvt *crv;
if (!c) {
if (principle < 0)
return -1;
if (pri->pvts[x]->call == c) {
/* Found our call */
if (principle != x) {
- struct zt_pvt *new = pri->pvts[principle], *old = pri->pvts[x];
+ struct dahdi_pvt *new = pri->pvts[principle], *old = pri->pvts[x];
ast_verb(3, "Moving call from channel %d to channel %d\n",
old->channel, new->channel);
old->owner = NULL;
if (new->owner) {
ast_string_field_build(new->owner, name,
- "Zap/%d:%d-%d", pri->trunkgroup,
+ "DAHDI/%d:%d-%d", pri->trunkgroup,
new->channel, 1);
new->owner->tech_pvt = new;
ast_channel_set_fd(new->owner, 0, new->subs[SUB_REAL].zfd);
else {
/* Looks good. Drop the pseudo channel now, clear up the assignment, and
wakeup the potential sleeper */
- zt_close(crv->subs[SUB_REAL].zfd);
+ dahdi_close(crv->subs[SUB_REAL].zfd);
pri->pvts[principle]->call = crv->call;
pri_assign_bearer(crv, pri, pri->pvts[principle]);
ast_debug(1, "Assigning bearer %d/%d to CRV %d:%d\n",
static void *do_idle_thread(void *vchan)
{
struct ast_channel *chan = vchan;
- struct zt_pvt *pvt = chan->tech_pvt;
+ struct dahdi_pvt *pvt = chan->tech_pvt;
struct ast_frame *f;
char ex[80];
/* Wait up to 30 seconds for an answer */
#ifndef PRI_RESTART
#error "Upgrade your libpri"
#endif
-static void zt_pri_message(struct pri *pri, char *s)
+static void dahdi_pri_message(struct pri *pri, char *s)
{
int x, y;
int dchan = -1, span = -1;
ast_mutex_unlock(&pridebugfdlock);
}
-static void zt_pri_error(struct pri *pri, char *s)
+static void dahdi_pri_error(struct pri *pri, char *s)
{
int x, y;
int dchan = -1, span = -1;
ast_mutex_unlock(&pridebugfdlock);
}
-static int pri_check_restart(struct zt_pri *pri)
+static int pri_check_restart(struct dahdi_pri *pri)
{
do {
pri->resetpos++;
return 0;
}
-static int pri_hangup_all(struct zt_pvt *p, struct zt_pri *pri)
+static int pri_hangup_all(struct dahdi_pvt *p, struct dahdi_pri *pri)
{
int x;
int redo;
}
}
-static void apply_plan_to_number(char *buf, size_t size, const struct zt_pri *pri, const char *number, const int plan)
+static void apply_plan_to_number(char *buf, size_t size, const struct dahdi_pri *pri, const char *number, const int plan)
{
if (pri->dialplan == -2) { /* autodetect the TON but leave the number untouched */
snprintf(buf, size, "%s", number);
static void *pri_dchannel(void *vpri)
{
- struct zt_pri *pri = vpri;
+ struct dahdi_pri *pri = vpri;
pri_event *e;
struct pollfd fds[NUM_DCHANS];
int res;
int i, which=-1;
int numdchans;
int cause=0;
- struct zt_pvt *crv;
+ struct dahdi_pvt *crv;
pthread_t threadid;
char ani2str[6];
char plancallingnum[256];
if (ast_tvdiff_ms(ast_tvnow(), lastidle) > 1000) {
/* Don't create a new idle call more than once per second */
snprintf(idlen, sizeof(idlen), "%d/%s", pri->pvts[nextidle]->channel, pri->idledial);
- idle = zt_request("Zap", AST_FORMAT_ULAW, idlen, &cause);
+ idle = dahdi_request("DAHDI", AST_FORMAT_ULAW, idlen, &cause);
if (idle) {
pri->pvts[nextidle]->isidlecall = 1;
if (ast_pthread_create_background(&p, NULL, do_idle_thread, idle)) {
ast_log(LOG_WARNING, "Unable to start new thread for idle channel '%s'\n", idle->name);
- zt_hangup(idle);
+ dahdi_hangup(idle);
}
} else
- ast_log(LOG_WARNING, "Unable to request channel 'Zap/%s' for idle call\n", idlen);
+ ast_log(LOG_WARNING, "Unable to request channel 'DAHDI/%s' for idle call\n", idlen);
lastidle = ast_tvnow();
}
} else if ((haveidles < pri->minunused) &&
if (fds[which].revents & POLLPRI) {
/* Check for an event */
x = 0;
- res = ioctl(pri->fds[which], ZT_GETEVENT, &x);
+ res = ioctl(pri->fds[which], DAHDI_GETEVENT, &x);
if (x) {
ast_log(LOG_NOTICE, "PRI got event: %s (%d) on %s D-channel of span %d\n", event2str(x), x, pri_order(which), pri->span);
manager_event(EVENT_FLAG_SYSTEM, "PRIEvent",
);
}
/* Keep track of alarm state */
- if (x == ZT_EVENT_ALARM) {
+ if (x == DAHDI_EVENT_ALARM) {
pri->dchanavail[which] &= ~(DCHAN_NOTINALARM | DCHAN_UP);
pri_find_dchan(pri);
- } else if (x == ZT_EVENT_NOALARM) {
+ } else if (x == DAHDI_EVENT_NOALARM) {
pri->dchanavail[which] |= DCHAN_NOTINALARM;
pri_restart(pri->dchans[which]);
}
pri->resetting = 0;
/* Hangup active channels and put them in alarm mode */
for (i = 0; i < pri->numchans; i++) {
- struct zt_pvt *p = pri->pvts[i];
+ struct dahdi_pvt *p = pri->pvts[i];
if (p) {
if (!p->pri || !p->pri->pri || pri_get_timer(p->pri->pri, PRI_TIMER_T309) < 0) {
/* T309 is not enabled : hangup calls when alarm occurs */
if (chanpos > -1) {
ast_mutex_lock(&pri->pvts[chanpos]->lock);
/* queue DTMF frame if the PBX for this call was already started (we're forwarding KEYPAD_DIGITs further on */
- if ((pri->overlapdial & ZAP_OVERLAPDIAL_INCOMING) && pri->pvts[chanpos]->call==e->digit.call && pri->pvts[chanpos]->owner) {
+ if ((pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING) && pri->pvts[chanpos]->call==e->digit.call && pri->pvts[chanpos]->owner) {
/* how to do that */
int digitlen = strlen(e->digit.digits);
char digit;
digit = e->digit.digits[i];
{
struct ast_frame f = { AST_FRAME_DTMF, digit, };
- zap_queue_frame(pri->pvts[chanpos], &f, pri);
+ dahdi_queue_frame(pri->pvts[chanpos], &f, pri);
}
}
}
if (chanpos > -1) {
ast_mutex_lock(&pri->pvts[chanpos]->lock);
/* queue DTMF frame if the PBX for this call was already started (we're forwarding INFORMATION further on */
- if ((pri->overlapdial & ZAP_OVERLAPDIAL_INCOMING) && pri->pvts[chanpos]->call==e->ring.call && pri->pvts[chanpos]->owner) {
+ if ((pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING) && pri->pvts[chanpos]->call==e->ring.call && pri->pvts[chanpos]->owner) {
/* how to do that */
int digitlen = strlen(e->ring.callednum);
char digit;
digit = e->ring.callednum[i];
{
struct ast_frame f = { AST_FRAME_DTMF, digit, };
- zap_queue_frame(pri->pvts[chanpos], &f, pri);
+ dahdi_queue_frame(pri->pvts[chanpos], &f, pri);
}
}
}
pri->pvts[chanpos]->exten[1] = '\0';
}
/* Make sure extension exists (or in overlap dial mode, can exist) */
- if (((pri->overlapdial & ZAP_OVERLAPDIAL_INCOMING) && ast_canmatch_extension(NULL, pri->pvts[chanpos]->context, pri->pvts[chanpos]->exten, 1, pri->pvts[chanpos]->cid_num)) ||
+ if (((pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING) && ast_canmatch_extension(NULL, pri->pvts[chanpos]->context, pri->pvts[chanpos]->exten, 1, pri->pvts[chanpos]->cid_num)) ||
ast_exists_extension(NULL, pri->pvts[chanpos]->context, pri->pvts[chanpos]->exten, 1, pri->pvts[chanpos]->cid_num)) {
/* Setup law */
int law;
if (pri->switchtype != PRI_SWITCH_GR303_TMC) {
/* Set to audio mode at this point */
law = 1;
- if (ioctl(pri->pvts[chanpos]->subs[SUB_REAL].zfd, ZT_AUDIOMODE, &law) == -1)
+ if (ioctl(pri->pvts[chanpos]->subs[SUB_REAL].zfd, DAHDI_AUDIOMODE, &law) == -1)
ast_log(LOG_WARNING, "Unable to set audio mode on channel %d to %d\n", pri->pvts[chanpos]->channel, law);
}
if (e->ring.layer1 == PRI_LAYER_1_ALAW)
- law = ZT_LAW_ALAW;
+ law = DAHDI_LAW_ALAW;
else
- law = ZT_LAW_MULAW;
- res = zt_setlaw(pri->pvts[chanpos]->subs[SUB_REAL].zfd, law);
+ law = DAHDI_LAW_MULAW;
+ res = dahdi_setlaw(pri->pvts[chanpos]->subs[SUB_REAL].zfd, law);
if (res < 0)
ast_log(LOG_WARNING, "Unable to set law on channel %d\n", pri->pvts[chanpos]->channel);
res = set_actual_gain(pri->pvts[chanpos]->subs[SUB_REAL].zfd, 0, pri->pvts[chanpos]->rxgain, pri->pvts[chanpos]->txgain, law);
if (res < 0)
ast_log(LOG_WARNING, "Unable to set gains on channel %d\n", pri->pvts[chanpos]->channel);
- if (e->ring.complete || !(pri->overlapdial & ZAP_OVERLAPDIAL_INCOMING)) {
+ if (e->ring.complete || !(pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING)) {
/* Just announce proceeding */
pri->pvts[chanpos]->proceeding = 1;
pri_proceeding(pri->pri, e->ring.call, PVT_TO_CHANNEL(pri->pvts[chanpos]), 0);
pri->pvts[chanpos]->callingpres = e->ring.callingpres;
/* Start PBX */
- if (!e->ring.complete && (pri->overlapdial & ZAP_OVERLAPDIAL_INCOMING) && ast_matchmore_extension(NULL, pri->pvts[chanpos]->context, pri->pvts[chanpos]->exten, 1, pri->pvts[chanpos]->cid_num)) {
+ if (!e->ring.complete && (pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING) && ast_matchmore_extension(NULL, pri->pvts[chanpos]->context, pri->pvts[chanpos]->exten, 1, pri->pvts[chanpos]->cid_num)) {
/* Release the PRI lock while we create the channel */
ast_mutex_unlock(&pri->lock);
if (crv) {
/* Set bearer and such */
pri_assign_bearer(crv, pri, pri->pvts[chanpos]);
- c = zt_new(crv, AST_STATE_RESERVED, 0, SUB_REAL, law, e->ring.ctype);
+ c = dahdi_new(crv, AST_STATE_RESERVED, 0, SUB_REAL, law, e->ring.ctype);
pri->pvts[chanpos]->owner = &inuse;
ast_debug(1, "Started up crv %d:%d on bearer channel %d\n", pri->trunkgroup, crv->channel, crv->bearer->channel);
} else {
- c = zt_new(pri->pvts[chanpos], AST_STATE_RESERVED, 0, SUB_REAL, law, e->ring.ctype);
+ c = dahdi_new(pri->pvts[chanpos], AST_STATE_RESERVED, 0, SUB_REAL, law, e->ring.ctype);
}
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
} else {
ast_mutex_unlock(&pri->lock);
/* Release PRI lock while we create the channel */
- c = zt_new(pri->pvts[chanpos], AST_STATE_RING, 1, SUB_REAL, law, e->ring.ctype);
+ c = dahdi_new(pri->pvts[chanpos], AST_STATE_RING, 1, SUB_REAL, law, e->ring.ctype);
if (c) {
char calledtonstr[10];
plancallingnum, pri->pvts[chanpos]->exten,
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span);
- zt_enable_ec(pri->pvts[chanpos]);
+ dahdi_enable_ec(pri->pvts[chanpos]);
} else {
ast_mutex_lock(&pri->lock);
} else {
ast_mutex_lock(&pri->pvts[chanpos]->lock);
if (ast_strlen_zero(pri->pvts[chanpos]->dop.dialstr)) {
- zt_enable_ec(pri->pvts[chanpos]);
+ dahdi_enable_ec(pri->pvts[chanpos]);
pri->pvts[chanpos]->subs[SUB_REAL].needringing = 1;
pri->pvts[chanpos]->alerting = 1;
} else
ast_mutex_lock(&pri->pvts[chanpos]->lock);
ast_debug(1, "Queuing frame from PRI_EVENT_PROGRESS on channel %d/%d span %d\n",
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset,pri->span);
- zap_queue_frame(pri->pvts[chanpos], &f, pri);
+ dahdi_queue_frame(pri->pvts[chanpos], &f, pri);
#ifdef PRI_PROGRESS_MASK
if (e->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE) {
#else
ast_mutex_lock(&pri->pvts[chanpos]->lock);
ast_debug(1, "Queuing frame from PRI_EVENT_PROCEEDING on channel %d/%d span %d\n",
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset,pri->span);
- zap_queue_frame(pri->pvts[chanpos], &f, pri);
+ dahdi_queue_frame(pri->pvts[chanpos], &f, pri);
#ifdef PRI_PROGRESS_MASK
if (e->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE) {
#else
}
/* Bring voice path up */
f.subclass = AST_CONTROL_PROGRESS;
- zap_queue_frame(pri->pvts[chanpos], &f, pri);
+ dahdi_queue_frame(pri->pvts[chanpos], &f, pri);
}
pri->pvts[chanpos]->proceeding = 1;
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
ast_copy_string(pri->pvts[chanpos]->lastcid_num, e->facname.callingnum, sizeof(pri->pvts[chanpos]->lastcid_num));
ast_copy_string(pri->pvts[chanpos]->lastcid_name, e->facname.callingname, sizeof(pri->pvts[chanpos]->lastcid_name));
pri->pvts[chanpos]->subs[SUB_REAL].needcallerid =1;
- zt_enable_ec(pri->pvts[chanpos]);
+ dahdi_enable_ec(pri->pvts[chanpos]);
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
}
}
}
if (pri->pvts[chanpos]->realcall && (pri->pvts[chanpos]->realcall->sig == SIG_FXSKS)) {
ast_debug(1, "Starting up GR-303 trunk now that we got CONNECT...\n");
- x = ZT_START;
- res = ioctl(pri->pvts[chanpos]->subs[SUB_REAL].zfd, ZT_HOOK, &x);
+ x = DAHDI_START;
+ res = ioctl(pri->pvts[chanpos]->subs[SUB_REAL].zfd, DAHDI_HOOK, &x);
if (res < 0) {
if (errno != EINPROGRESS) {
ast_log(LOG_WARNING, "Unable to start channel: %s\n", strerror(errno));
} else if (!ast_strlen_zero(pri->pvts[chanpos]->dop.dialstr)) {
pri->pvts[chanpos]->dialing = 1;
/* Send any "w" waited stuff */
- res = ioctl(pri->pvts[chanpos]->subs[SUB_REAL].zfd, ZT_DIAL, &pri->pvts[chanpos]->dop);
+ res = ioctl(pri->pvts[chanpos]->subs[SUB_REAL].zfd, DAHDI_DIAL, &pri->pvts[chanpos]->dop);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to initiate dialing on trunk channel %d\n", pri->pvts[chanpos]->channel);
pri->pvts[chanpos]->dop.dialstr[0] = '\0';
} else {
pri->pvts[chanpos]->subs[SUB_REAL].needanswer =1;
/* Enable echo cancellation if it's not on already */
- zt_enable_ec(pri->pvts[chanpos]);
+ dahdi_enable_ec(pri->pvts[chanpos]);
}
#ifdef SUPPORT_USERUSER
if (chanpos > -1) {
ast_mutex_lock(&pri->pvts[chanpos]->lock);
if (!pri->pvts[chanpos]->alreadyhungup) {
- /* we're calling here zt_hangup so once we get there we need to clear p->call after calling pri_hangup */
+ /* we're calling here dahdi_hangup so once we get there we need to clear p->call after calling pri_hangup */
pri->pvts[chanpos]->alreadyhungup = 1;
if (pri->pvts[chanpos]->realcall)
pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
switch (e->notify.info) {
case PRI_NOTIFY_REMOTE_HOLD:
f.subclass = AST_CONTROL_HOLD;
- zap_queue_frame(pri->pvts[chanpos], &f, pri);
+ dahdi_queue_frame(pri->pvts[chanpos], &f, pri);
break;
case PRI_NOTIFY_REMOTE_RETRIEVAL:
f.subclass = AST_CONTROL_UNHOLD;
- zap_queue_frame(pri->pvts[chanpos], &f, pri);
+ dahdi_queue_frame(pri->pvts[chanpos], &f, pri);
break;
}
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
return NULL;
}
-static int start_pri(struct zt_pri *pri)
+static int start_pri(struct dahdi_pri *pri)
{
int res, x;
- ZT_PARAMS p;
- ZT_BUFFERINFO bi;
- struct zt_spaninfo si;
+ DAHDI_PARAMS p;
+ DAHDI_BUFFERINFO bi;
+ struct dahdi_spaninfo si;
int i;
for (i = 0; i < NUM_DCHANS; i++) {
if (!pri->dchannels[i])
break;
- pri->fds[i] = open("/dev/zap/channel", O_RDWR);
+ pri->fds[i] = open("/dev/dahdi/channel", O_RDWR);
x = pri->dchannels[i];
- if ((pri->fds[i] < 0) || (ioctl(pri->fds[i],ZT_SPECIFY,&x) == -1)) {
+ if ((pri->fds[i] < 0) || (ioctl(pri->fds[i],DAHDI_SPECIFY,&x) == -1)) {
ast_log(LOG_ERROR, "Unable to open D-channel %d (%s)\n", x, strerror(errno));
return -1;
}
- res = ioctl(pri->fds[i], ZT_GET_PARAMS, &p);
+ res = ioctl(pri->fds[i], DAHDI_GET_PARAMS, &p);
if (res) {
- zt_close(pri->fds[i]);
+ dahdi_close(pri->fds[i]);
pri->fds[i] = -1;
ast_log(LOG_ERROR, "Unable to get parameters for D-channel %d (%s)\n", x, strerror(errno));
return -1;
}
- if ((p.sigtype != ZT_SIG_HDLCFCS) && (p.sigtype != ZT_SIG_HARDHDLC)) {
- zt_close(pri->fds[i]);
+ if ((p.sigtype != DAHDI_SIG_HDLCFCS) && (p.sigtype != DAHDI_SIG_HARDHDLC)) {
+ dahdi_close(pri->fds[i]);
pri->fds[i] = -1;
- ast_log(LOG_ERROR, "D-channel %d is not in HDLC/FCS mode. See /etc/zaptel.conf\n", x);
+ ast_log(LOG_ERROR, "D-channel %d is not in HDLC/FCS mode. See /etc/dahdi.conf\n", x);
return -1;
}
memset(&si, 0, sizeof(si));
- res = ioctl(pri->fds[i], ZT_SPANSTAT, &si);
+ res = ioctl(pri->fds[i], DAHDI_SPANSTAT, &si);
if (res) {
- zt_close(pri->fds[i]);
+ dahdi_close(pri->fds[i]);
pri->fds[i] = -1;
ast_log(LOG_ERROR, "Unable to get span state for D-channel %d (%s)\n", x, strerror(errno));
}
pri->dchanavail[i] |= DCHAN_NOTINALARM;
else
pri->dchanavail[i] &= ~DCHAN_NOTINALARM;
- bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
- bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
+ bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
+ bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.numbufs = 32;
bi.bufsize = 1024;
- if (ioctl(pri->fds[i], ZT_SET_BUFINFO, &bi)) {
+ if (ioctl(pri->fds[i], DAHDI_SET_BUFINFO, &bi)) {
ast_log(LOG_ERROR, "Unable to set appropriate buffering on channel %d\n", x);
- zt_close(pri->fds[i]);
+ dahdi_close(pri->fds[i]);
pri->fds[i] = -1;
return -1;
}
}
/* Force overlap dial if we're doing GR-303! */
if (pri->switchtype == PRI_SWITCH_GR303_TMC)
- pri->overlapdial |= ZAP_OVERLAPDIAL_BOTH;
- pri_set_overlapdial(pri->dchans[i],(pri->overlapdial & ZAP_OVERLAPDIAL_OUTGOING)?1:0);
+ pri->overlapdial |= DAHDI_OVERLAPDIAL_BOTH;
+ pri_set_overlapdial(pri->dchans[i],(pri->overlapdial & DAHDI_OVERLAPDIAL_OUTGOING)?1:0);
/* Enslave to master if appropriate */
if (i)
pri_enslave(pri->dchans[0], pri->dchans[i]);
if (!pri->dchans[i]) {
- zt_close(pri->fds[i]);
+ dahdi_close(pri->fds[i]);
pri->fds[i] = -1;
ast_log(LOG_ERROR, "Unable to create PRI structure\n");
return -1;
for (i = 0; i < NUM_DCHANS; i++) {
if (!pri->dchannels[i])
break;
- zt_close(pri->fds[i]);
+ dahdi_close(pri->fds[i]);
pri->fds[i] = -1;
}
ast_log(LOG_ERROR, "Unable to spawn D-channel: %s\n", strerror(errno));
#else
pri_dump_info(pris[span-1].pri);
#endif
- ast_cli(a->fd, "Overlap Recv: %s\n\n", (pris[span-1].overlapdial & ZAP_OVERLAPDIAL_INCOMING)?"Yes":"No");
+ ast_cli(a->fd, "Overlap Recv: %s\n\n", (pris[span-1].overlapdial & DAHDI_OVERLAPDIAL_INCOMING)?"Yes":"No");
}
}
return CLI_SUCCESS;
return CLI_SUCCESS;
}
-static struct ast_cli_entry zap_pri_cli[] = {
+static struct ast_cli_entry dahdi_pri_cli[] = {
AST_CLI_DEFINE(handle_pri_debug, "Enables PRI debugging on a span"),
AST_CLI_DEFINE(handle_pri_no_debug, "Disables PRI debugging on a span"),
AST_CLI_DEFINE(handle_pri_really_debug, "Enables REALLY INTENSE PRI debugging"),
#endif /* HAVE_PRI */
-static char *zap_destroy_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *dahdi_destroy_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int channel;
int ret;
switch (cmd) {
case CLI_INIT:
- e->command = "zap destroy channel";
+ e->command = "dahdi destroy channel";
e->usage =
- "Usage: zap destroy channel <chan num>\n"
+ "Usage: dahdi destroy channel <chan num>\n"
" DON'T USE THIS UNLESS YOU KNOW WHAT YOU ARE DOING. Immediately removes a given channel, whether it is in use or not\n";
return NULL;
case CLI_GENERATE:
return CLI_SHOWUSAGE;
channel = atoi(a->argv[3]);
- ret = zap_destroy_channel_bynum(channel);
+ ret = dahdi_destroy_channel_bynum(channel);
return ( RESULT_SUCCESS == ret ) ? CLI_SUCCESS : CLI_FAILURE;
}
-static int setup_zap(int reload);
-static int zap_restart(void)
+static char *handle_cli_zap_destroy_channel_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- ast_verb(1, "Destroying channels and reloading Zaptel configuration.\n");
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "zap destroy channel";
+ e->usage =
+ "Usage: zap destroy channel <chan num>\n"
+ " DON'T USE THIS UNLESS YOU KNOW WHAT YOU ARE DOING. Immediately removes a given channel, whether it is in use or not\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ case CLI_HANDLER:
+ return dahdi_destroy_channel(e, cmd, a);
+ }
+
+ return CLI_FAILURE;
+}
+
+static int setup_dahdi(int reload);
+static int dahdi_restart(void)
+{
+ ast_verb(1, "Destroying channels and reloading DAHDI configuration.\n");
while (iflist) {
- ast_debug(1, "Destroying Zaptel channel no. %d\n", iflist->channel);
+ ast_debug(1, "Destroying DAHDI channel no. %d\n", iflist->channel);
/* Also updates iflist: */
destroy_channel(NULL, iflist, 1);
}
ast_debug(1, "Channels destroyed. Now re-reading config.\n");
- if (setup_zap(2) != 0) {
- ast_log(LOG_WARNING, "Reload channels from zap config failed!\n");
+ if (setup_dahdi(2) != 0) {
+ ast_log(LOG_WARNING, "Reload channels from dahdi config failed!\n");
return 1;
}
return 0;
}
-static char *zap_restart_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *dahdi_restart_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
case CLI_INIT:
- e->command = "zap restart";
+ e->command = "dahdi restart";
e->usage =
- "Usage: zap restart\n"
- " Restarts the Zaptel channels: destroys them all and then\n"
- " re-reads them from zapata.conf.\n"
- " Note that this will STOP any running CALL on Zaptel channels.\n"
+ "Usage: dahdi restart\n"
+ " Restarts the DAHDI channels: destroys them all and then\n"
+ " re-reads them from chan_dahdi.conf.\n"
+ " Note that this will STOP any running CALL on DAHDI channels.\n"
"";
return NULL;
case CLI_GENERATE:
if (a->argc != 2)
return CLI_SHOWUSAGE;
- if (zap_restart() != 0)
+ if (dahdi_restart() != 0)
return CLI_FAILURE;
return CLI_SUCCESS;
}
-static int action_zaprestart(struct mansession *s, const struct message *m)
+static char *handle_cli_zap_restart_cmd_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "zap restart";
+ e->usage =
+ "Usage: zap restart\n"
+ " Restarts the zap channels: destroys them all and then\n"
+ " re-reads them from chan_dahdi.conf.\n"
+ " Note that this will STOP any running CALL on zap channels.\n"
+ "";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ case CLI_HANDLER:
+ return dahdi_restart_cmd(e, cmd, a);
+ }
+
+ return CLI_FAILURE;
+}
+
+static int action_dahdirestart(struct mansession *s, const struct message *m)
{
- if (zap_restart() != 0) {
- astman_send_error(s, m, "Failed rereading Zaptel configuration");
+ if (dahdi_restart() != 0) {
+ astman_send_error(s, m, "Failed rereading DAHDI configuration");
return 1;
}
- astman_send_ack(s, m, "ZapRestart: Success");
+ astman_send_ack(s, m, "DAHDIRestart: Success");
return 0;
}
-static char *zap_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *dahdi_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
#define FORMAT "%7s %-10.10s %-15.15s %-10.10s %-20.20s %-10.10s %-10.10s\n"
#define FORMAT2 "%7s %-10.10s %-15.15s %-10.10s %-20.20s %-10.10s %-10.10s\n"
unsigned int targetnum = 0;
int filtertype = 0;
- struct zt_pvt *tmp = NULL;
+ struct dahdi_pvt *tmp = NULL;
char tmps[20] = "";
char statestr[20] = "";
char blockstr[20] = "";
ast_mutex_t *lock;
- struct zt_pvt *start;
+ struct dahdi_pvt *start;
#ifdef HAVE_PRI
int trunkgroup;
- struct zt_pri *pri = NULL;
+ struct dahdi_pri *pri = NULL;
int x;
#endif
switch (cmd) {
case CLI_INIT:
- e->command = "zap show channels [trunkgroup|group|context]";
+ e->command = "dahdi show channels [trunkgroup|group|context]";
e->usage =
- "Usage: zap show channels [ trunkgroup <trunkgroup> | group <group> | context <context> ]\n"
+ "Usage: dahdi show channels [ trunkgroup <trunkgroup> | group <group> | context <context> ]\n"
" Shows a list of available channels with optional filtering\n"
" <group> must be a number between 0 and 63\n";
return NULL;
lock = &iflock;
start = iflist;
- /* syntax: zap show channels [ group <group> | context <context> | trunkgroup <trunkgroup> ] */
+ /* syntax: dahdi show channels [ group <group> | context <context> | trunkgroup <trunkgroup> ] */
if (!((a->argc == 3) || (a->argc == 5)))
return CLI_SHOWUSAGE;
while (tmp) {
if (filtertype) {
switch(filtertype) {
- case 1: /* zap show channels group <group> */
+ case 1: /* dahdi show channels group <group> */
if (tmp->group != targetnum) {
tmp = tmp->next;
continue;
}
break;
- case 2: /* zap show channels context <context> */
+ case 2: /* dahdi show channels context <context> */
if (strcasecmp(tmp->context, a->argv[4])) {
tmp = tmp->next;
continue;
#undef FORMAT2
}
-static char *zap_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_zap_show_channels_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "zap show channels [trunkgroup|group|context]";
+ e->usage =
+ "Usage: zap show channels [ trunkgroup <trunkgroup> | group <group> | context <context> ]\n"
+ " Shows a list of available channels with optional filtering\n"
+ " <group> must be a number between 0 and 63\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ case CLI_HANDLER:
+ return dahdi_show_channels(e, cmd, a);
+ }
+
+ return CLI_FAILURE;
+}
+
+static char *dahdi_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int channel;
- struct zt_pvt *tmp = NULL;
- ZT_CONFINFO ci;
- ZT_PARAMS ps;
+ struct dahdi_pvt *tmp = NULL;
+ DAHDI_CONFINFO ci;
+ DAHDI_PARAMS ps;
int x;
ast_mutex_t *lock;
- struct zt_pvt *start;
+ struct dahdi_pvt *start;
#ifdef HAVE_PRI
char *c;
int trunkgroup;
- struct zt_pri *pri=NULL;
+ struct dahdi_pri *pri=NULL;
#endif
switch (cmd) {
case CLI_INIT:
- e->command = "zap show channel";
+ e->command = "dahdi show channel";
e->usage =
- "Usage: zap show channel <chan num>\n"
+ "Usage: dahdi show channel <chan num>\n"
" Detailed information about a given channel\n";
return NULL;
case CLI_GENERATE:
ast_cli(a->fd, "TDD: %s\n", tmp->tdd ? "yes" : "no");
ast_cli(a->fd, "Relax DTMF: %s\n", tmp->dtmfrelax ? "yes" : "no");
ast_cli(a->fd, "Dialing/CallwaitCAS: %d/%d\n", tmp->dialing, tmp->callwaitcas);
- ast_cli(a->fd, "Default law: %s\n", tmp->law == ZT_LAW_MULAW ? "ulaw" : tmp->law == ZT_LAW_ALAW ? "alaw" : "unknown");
+ ast_cli(a->fd, "Default law: %s\n", tmp->law == DAHDI_LAW_MULAW ? "ulaw" : tmp->law == DAHDI_LAW_ALAW ? "alaw" : "unknown");
ast_cli(a->fd, "Fax Handled: %s\n", tmp->faxhandled ? "yes" : "no");
ast_cli(a->fd, "Pulse phone: %s\n", tmp->pulsedial ? "yes" : "no");
ast_cli(a->fd, "DND: %s\n", tmp->dnd ? "yes" : "no");
ast_cli(a->fd, "Echo Cancellation:\n");
-#if defined(HAVE_ZAPTEL_ECHOCANPARAMS)
+
if (tmp->echocancel.head.tap_length) {
ast_cli(a->fd, "\t%d taps\n", tmp->echocancel.head.tap_length);
for (x = 0; x < tmp->echocancel.head.param_count; x++) {
} else {
ast_cli(a->fd, "\tnone\n");
}
-#else
- if (tmp->echocancel) {
- ast_cli(a->fd, "\t%d taps\n", tmp->echocancel);
- ast_cli(a->fd, "\t%scurrently %s\n", tmp->echocanbridged ? "" : "(unless TDM bridged) ", tmp->echocanon ? "ON" : "OFF");
- }
- else
- ast_cli(a->fd, "\tnone\n");
-#endif
if (tmp->master)
ast_cli(a->fd, "Master Channel: %d\n", tmp->master->channel);
for (x = 0; x < MAX_SLAVES; x++) {
memset(&ci, 0, sizeof(ci));
ps.channo = tmp->channel;
if (tmp->subs[SUB_REAL].zfd > -1) {
- if (!ioctl(tmp->subs[SUB_REAL].zfd, ZT_GETCONF, &ci)) {
+ if (!ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_GETCONF, &ci)) {
ast_cli(a->fd, "Actual Confinfo: Num/%d, Mode/0x%04x\n", ci.confno, ci.confmode);
}
-#ifdef ZT_GETCONFMUTE
- if (!ioctl(tmp->subs[SUB_REAL].zfd, ZT_GETCONFMUTE, &x)) {
+#ifdef DAHDI_GETCONFMUTE
+ if (!ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_GETCONFMUTE, &x)) {
ast_cli(a->fd, "Actual Confmute: %s\n", x ? "Yes" : "No");
}
#endif
- if (ioctl(tmp->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &ps) < 0) {
+ if (ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_GET_PARAMS, &ps) < 0) {
ast_log(LOG_WARNING, "Failed to get parameters on channel %d\n", tmp->channel);
} else {
ast_cli(a->fd, "Hookstate (FXS only): %s\n", ps.rxisoffhook ? "Offhook" : "Onhook");
return CLI_FAILURE;
}
-static char *handle_zap_show_cadences(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_zap_show_channel_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "zap show channel";
+ e->usage =
+ "Usage: zap show channel <chan num>\n"
+ " Detailed information about a given channel\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ case CLI_HANDLER:
+ return dahdi_show_channel(e, cmd, a);
+ }
+
+ return CLI_FAILURE;
+}
+
+static char *handle_dahdi_show_cadences(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int i, j;
switch (cmd) {
case CLI_INIT:
- e->command = "zap show cadences";
+ e->command = "dahdi show cadences";
e->usage =
- "Usage: zap show cadences\n"
+ "Usage: dahdi show cadences\n"
" Shows all cadences currently defined\n";
return NULL;
case CLI_GENERATE:
return CLI_SUCCESS;
}
+static char *handle_cli_zap_show_cadences_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ switch(cmd) {
+ case CLI_INIT:
+ e->command = "zap show cadences";
+ e->usage =
+ "Usage: zap show cadences\n"
+ " Shows all cadences currently defined\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ case CLI_HANDLER:
+ return handle_dahdi_show_cadences(e, cmd, a);
+ }
+
+ return CLI_FAILURE;
+}
+
/* Based on irqmiss.c */
-static char *zap_show_status(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *dahdi_show_status(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
-#ifdef ZT_SPANINFO_HAS_LINECONFIG
+#ifdef DAHDI_SPANINFO_HAS_LINECONFIG
#define FORMAT "%-40.40s %-7.7s %-6d %-6d %-6d %-3.3s %-4.4s %-8.8s %s\n"
#define FORMAT2 "%-40.40s %-7.7s %-6.6s %-6.6s %-6.6s %-3.3s %-4.4s %-8.8s %s\n"
#else
char alarms[50];
int ctl;
- ZT_SPANINFO s;
+ DAHDI_SPANINFO s;
switch (cmd) {
case CLI_INIT:
- e->command = "zap show status";
+ e->command = "dahdi show status";
e->usage =
- "Usage: zap show status\n"
- " Shows a list of Zaptel cards with status\n";
+ "Usage: dahdi show status\n"
+ " Shows a list of DAHDI cards with status\n";
return NULL;
case CLI_GENERATE:
return NULL;
}
- ctl = open("/dev/zap/ctl", O_RDWR);
+ ctl = open("/dev/dahdi/ctl", O_RDWR);
if (ctl < 0) {
- ast_cli(a->fd, "No Zaptel interface found. Unable to open /dev/zap/ctl: %s\n", strerror(errno));
+ ast_cli(a->fd, "No DAHDI found. Unable to open /dev/dahdi/ctl: %s\n", strerror(errno));
return CLI_FAILURE;
}
ast_cli(a->fd, FORMAT2, "Description", "Alarms", "IRQ", "bpviol", "CRC4"
-#ifdef ZT_SPANINFO_HAS_LINECONFIG
+#ifdef DAHDI_SPANINFO_HAS_LINECONFIG
, "Framing", "Coding", "Options", "LBO"
#endif
);
- for (span = 1; span < ZT_MAX_SPANS; ++span) {
+ for (span = 1; span < DAHDI_MAX_SPANS; ++span) {
s.spanno = span;
- res = ioctl(ctl, ZT_SPANSTAT, &s);
+ res = ioctl(ctl, DAHDI_SPANSTAT, &s);
if (res) {
continue;
}
alarms[0] = '\0';
if (s.alarms > 0) {
- if (s.alarms & ZT_ALARM_BLUE)
+ if (s.alarms & DAHDI_ALARM_BLUE)
strcat(alarms, "BLU/");
- if (s.alarms & ZT_ALARM_YELLOW)
+ if (s.alarms & DAHDI_ALARM_YELLOW)
strcat(alarms, "YEL/");
- if (s.alarms & ZT_ALARM_RED)
+ if (s.alarms & DAHDI_ALARM_RED)
strcat(alarms, "RED/");
- if (s.alarms & ZT_ALARM_LOOPBACK)
+ if (s.alarms & DAHDI_ALARM_LOOPBACK)
strcat(alarms, "LB/");
- if (s.alarms & ZT_ALARM_RECOVER)
+ if (s.alarms & DAHDI_ALARM_RECOVER)
strcat(alarms, "REC/");
- if (s.alarms & ZT_ALARM_NOTOPEN)
+ if (s.alarms & DAHDI_ALARM_NOTOPEN)
strcat(alarms, "NOP/");
if (!strlen(alarms))
strcat(alarms, "UUU/");
}
ast_cli(a->fd, FORMAT, s.desc, alarms, s.irqmisses, s.bpvcount, s.crc4count
-#ifdef ZT_SPANINFO_HAS_LINECONFIG
- , s.lineconfig & ZT_CONFIG_D4 ? "D4" :
- s.lineconfig & ZT_CONFIG_ESF ? "ESF" :
- s.lineconfig & ZT_CONFIG_CCS ? "CCS" :
+#ifdef DAHDI_SPANINFO_HAS_LINECONFIG
+ , s.lineconfig & DAHDI_CONFIG_D4 ? "D4" :
+ s.lineconfig & DAHDI_CONFIG_ESF ? "ESF" :
+ s.lineconfig & DAHDI_CONFIG_CCS ? "CCS" :
"CAS"
- , s.lineconfig & ZT_CONFIG_B8ZS ? "B8ZS" :
- s.lineconfig & ZT_CONFIG_HDB3 ? "HDB3" :
- s.lineconfig & ZT_CONFIG_AMI ? "AMI" :
+ , s.lineconfig & DAHDI_CONFIG_B8ZS ? "B8ZS" :
+ s.lineconfig & DAHDI_CONFIG_HDB3 ? "HDB3" :
+ s.lineconfig & DAHDI_CONFIG_AMI ? "AMI" :
"Unk"
- , s.lineconfig & ZT_CONFIG_CRC4 ?
- s.lineconfig & ZT_CONFIG_NOTOPEN ? "CRC4/YEL" : "CRC4" : "YEL"
+ , s.lineconfig & DAHDI_CONFIG_CRC4 ?
+ s.lineconfig & DAHDI_CONFIG_NOTOPEN ? "CRC4/YEL" : "CRC4" : "YEL"
, lbostr[s.lbo]
#endif
);
#undef FORMAT2
}
-static char *zap_show_version(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_zap_show_status_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "zap show status";
+ e->usage =
+ "Usage: zap show status\n"
+ " Shows a list of zap cards with status\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ case CLI_HANDLER:
+ return dahdi_show_status(e, cmd, a);
+ }
+
+ return CLI_FAILURE;
+}
+
+static char *dahdi_show_version(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int pseudo_fd = -1;
- struct zt_versioninfo vi;
+ struct dahdi_versioninfo vi;
switch (cmd) {
case CLI_INIT:
- e->command = "zap show version";
+ e->command = "dahdi show version";
e->usage =
- "Usage: zap show version\n"
- " Shows the Zaptel version in use\n";
+ "Usage: dahdi show version\n"
+ " Shows the DAHDI version in use\n";
return NULL;
case CLI_GENERATE:
return NULL;
}
- if ((pseudo_fd = open("/dev/zap/ctl", O_RDONLY)) < 0) {
+ if ((pseudo_fd = open("/dev/dahdi/ctl", O_RDONLY)) < 0) {
ast_cli(a->fd, "Failed to open control file to get version.\n");
return CLI_SUCCESS;
}
strcpy(vi.version, "Unknown");
strcpy(vi.echo_canceller, "Unknown");
- if (ioctl(pseudo_fd, ZT_GETVERSION, &vi))
+ if (ioctl(pseudo_fd, DAHDI_GETVERSION, &vi))
ast_cli(a->fd, "Failed to get version from control file.\n");
else
- ast_cli(a->fd, "Zaptel Version: %s Echo Canceller: %s\n", vi.version, vi.echo_canceller);
+ ast_cli(a->fd, "DAHDI Version: %s Echo Canceller: %s\n", vi.version, vi.echo_canceller);
close(pseudo_fd);
return CLI_SUCCESS;
}
-#if defined(HAVE_ZAPTEL_HWGAIN)
-static char *zap_set_hwgain(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_zap_show_version_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "zap show version";
+ e->usage =
+ "Usage: zap show version\n"
+ " Shows the zap version in use\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ case CLI_HANDLER:
+ return dahdi_show_version(e, cmd, a);
+ }
+
+ return CLI_FAILURE;
+}
+
+static char *dahdi_set_hwgain(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int channel;
int gain;
int tx;
- struct zt_hwgain hwgain;
- struct zt_pvt *tmp = NULL;
+ struct dahdi_hwgain hwgain;
+ struct dahdi_pvt *tmp = NULL;
switch (cmd) {
case CLI_INIT:
- e->command = "zap set hwgain";
+ e->command = "dahdi set hwgain";
e->usage =
- "Usage: zap set hwgain <rx|tx> <chan#> <gain>\n"
+ "Usage: dahdi set hwgain <rx|tx> <chan#> <gain>\n"
" Sets the hardware gain on a a given channel, overriding the\n"
" value provided at module loadtime, whether the channel is in\n"
" use or not. Changes take effect immediately.\n"
hwgain.newgain = gain;
hwgain.tx = tx;
- if (ioctl(tmp->subs[SUB_REAL].zfd, ZT_SET_HWGAIN, &hwgain) < 0) {
+ if (ioctl(tmp->subs[SUB_REAL].zfd, DAHDI_SET_HWGAIN, &hwgain) < 0) {
ast_cli(a->fd, "Unable to set the hardware gain for channel %d\n", channel);
ast_mutex_unlock(&iflock);
return CLI_FAILURE;
return CLI_FAILURE;
}
-#endif
-static char *zap_set_swgain(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_zap_set_hwgain_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "zap set hwgain";
+ e->usage =
+ "Usage: zap set hwgain <rx|tx> <chan#> <gain>\n"
+ " Sets the hardware gain on a a given channel, overriding the\n"
+ " value provided at module loadtime, whether the channel is in\n"
+ " use or not. Changes take effect immediately.\n"
+ " <rx|tx> which direction do you want to change (relative to our module)\n"
+ " <chan num> is the channel number relative to the device\n"
+ " <gain> is the gain in dB (e.g. -3.5 for -3.5dB)\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ case CLI_HANDLER:
+ return dahdi_set_hwgain(e, cmd, a);
+ }
+
+ return CLI_FAILURE;
+}
+
+static char *dahdi_set_swgain(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int channel;
float gain;
int tx;
int res;
ast_mutex_t *lock;
- struct zt_pvt *tmp = NULL;
+ struct dahdi_pvt *tmp = NULL;
switch (cmd) {
case CLI_INIT:
- e->command = "zap set swgain";
+ e->command = "dahdi set swgain";
e->usage =
- "Usage: zap set swgain <rx|tx> <chan#> <gain>\n"
+ "Usage: dahdi set swgain <rx|tx> <chan#> <gain>\n"
" Sets the software gain on a a given channel, overriding the\n"
" value provided at module loadtime, whether the channel is in\n"
" use or not. Changes take effect immediately.\n"
}
-static char *zap_set_dnd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_cli_zap_set_swgain_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "zap set swgain";
+ e->usage =
+ "Usage: zap set swgain <rx|tx> <chan#> <gain>\n"
+ " Sets the software gain on a a given channel, overriding the\n"
+ " value provided at module loadtime, whether the channel is in\n"
+ " use or not. Changes take effect immediately.\n"
+ " <rx|tx> which direction do you want to change (relative to our module)\n"
+ " <chan num> is the channel number relative to the device\n"
+ " <gain> is the gain in dB (e.g. -3.5 for -3.5dB)\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ case CLI_HANDLER:
+ return dahdi_set_swgain(e, cmd, a);
+ }
+
+ return CLI_FAILURE;
+}
+
+static char *dahdi_set_dnd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int channel;
int on;
- struct zt_pvt *zt_chan = NULL;
+ struct dahdi_pvt *dahdi_chan = NULL;
switch (cmd) {
case CLI_INIT:
- e->command = "zap set dnd";
+ e->command = "dahdi set dnd";
e->usage =
- "Usage: zap set dnd <chan#> <on|off>\n"
+ "Usage: dahdi set dnd <chan#> <on|off>\n"
" Sets/resets DND (Do Not Disturb) mode on a channel.\n"
" Changes take effect immediately.\n"
" <chan num> is the channel number\n"
}
ast_mutex_lock(&iflock);
- for (zt_chan = iflist; zt_chan; zt_chan = zt_chan->next) {
- if (zt_chan->channel != channel)
+ for (dahdi_chan = iflist; dahdi_chan; dahdi_chan = dahdi_chan->next) {
+ if (dahdi_chan->channel != channel)
continue;
/* Found the channel. Actually set it */
- zap_dnd(zt_chan, on);
+ dahdi_dnd(dahdi_chan, on);
break;
}
ast_mutex_unlock(&iflock);
- if (!zt_chan) {
+ if (!dahdi_chan) {
ast_cli(a->fd, "Unable to find given channel %d\n", channel);
return CLI_FAILURE;
}
return CLI_SUCCESS;
}
-static struct ast_cli_entry zap_cli[] = {
- AST_CLI_DEFINE(handle_zap_show_cadences, "List cadences"),
- AST_CLI_DEFINE(zap_show_channels, "Show active zapata channels"),
- AST_CLI_DEFINE(zap_show_channel, "Show information on a channel"),
- AST_CLI_DEFINE(zap_destroy_channel, "Destroy a channel"),
- AST_CLI_DEFINE(zap_restart_cmd, "Fully restart Zaptel channels"),
- AST_CLI_DEFINE(zap_show_status, "Show all Zaptel cards status"),
- AST_CLI_DEFINE(zap_show_version, "Show the Zaptel version in use"),
-#if defined(HAVE_ZAPTEL_HWGAIN)
- AST_CLI_DEFINE(zap_set_hwgain, "Set hardware gain on a channel"),
-#endif
- AST_CLI_DEFINE(zap_set_swgain, "Set software gain on a channel"),
- AST_CLI_DEFINE(zap_set_dnd, "Set software gain on a channel"),
+static char *handle_cli_zap_set_dnd_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "zap set dnd";
+ e->usage =
+ "Usage: zap set dnd <chan#> <on|off>\n"
+ " Sets/resets DND (Do Not Disturb) mode on a channel.\n"
+ " Changes take effect immediately.\n"
+ " <chan num> is the channel number\n"
+ " <on|off> Enable or disable DND mode?\n"
+ ;
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ case CLI_HANDLER:
+ return dahdi_set_dnd(e, cmd, a);
+ }
+
+ return CLI_FAILURE;
+}
+
+static struct ast_cli_entry cli_zap_show_cadences_deprecated = AST_CLI_DEFINE(handle_cli_zap_show_cadences_deprecated, "List cadences");
+static struct ast_cli_entry cli_zap_show_channels_deprecated = AST_CLI_DEFINE(handle_cli_zap_show_channels_deprecated, "Show active channels");
+static struct ast_cli_entry cli_zap_show_channel_deprecated = AST_CLI_DEFINE(handle_cli_zap_show_channel_deprecated, "Show information on a channel");
+static struct ast_cli_entry cli_zap_destroy_channel_deprecated = AST_CLI_DEFINE(handle_cli_zap_destroy_channel_deprecated, "Destroy a channel");
+static struct ast_cli_entry cli_zap_restart_cmd_deprecated = AST_CLI_DEFINE(handle_cli_zap_restart_cmd_deprecated, "Fully restart channels");
+static struct ast_cli_entry cli_zap_show_status_deprecated = AST_CLI_DEFINE(handle_cli_zap_show_status_deprecated, "Show all cards status");
+static struct ast_cli_entry cli_zap_show_version_deprecated = AST_CLI_DEFINE(handle_cli_zap_show_version_deprecated, "Show DAHDI version in use");
+static struct ast_cli_entry cli_zap_set_hwgain_deprecated = AST_CLI_DEFINE(handle_cli_zap_set_hwgain_deprecated, "Set hardware gain on a channel");
+static struct ast_cli_entry cli_zap_set_swgain_deprecated = AST_CLI_DEFINE(handle_cli_zap_set_swgain_deprecated, "Set software gain on a channel");
+static struct ast_cli_entry cli_zap_set_dnd_deprecated = AST_CLI_DEFINE(handle_cli_zap_set_dnd_deprecated, "Set software gain on a channel");
+
+static struct ast_cli_entry dahdi_cli[] = {
+ AST_CLI_DEFINE(handle_dahdi_show_cadences, "List cadences", .deprecate_cmd = &cli_zap_show_cadences_deprecated),
+ AST_CLI_DEFINE(dahdi_show_channels, "Show active DAHDI channels", .deprecate_cmd = &cli_zap_show_channels_deprecated),
+ AST_CLI_DEFINE(dahdi_show_channel, "Show information on a channel", .deprecate_cmd = &cli_zap_show_channel_deprecated),
+ AST_CLI_DEFINE(dahdi_destroy_channel, "Destroy a channel", .deprecate_cmd = &cli_zap_destroy_channel_deprecated),
+ AST_CLI_DEFINE(dahdi_restart_cmd, "Fully restart DAHDI channels", .deprecate_cmd = &cli_zap_restart_cmd_deprecated),
+ AST_CLI_DEFINE(dahdi_show_status, "Show all DAHDI cards status", .deprecate_cmd = &cli_zap_show_status_deprecated),
+ AST_CLI_DEFINE(dahdi_show_version, "Show the DAHDI version in use", .deprecate_cmd = &cli_zap_show_version_deprecated),
+ AST_CLI_DEFINE(dahdi_set_hwgain, "Set hardware gain on a channel", .deprecate_cmd = &cli_zap_set_hwgain_deprecated),
+ AST_CLI_DEFINE(dahdi_set_swgain, "Set software gain on a channel", .deprecate_cmd = &cli_zap_set_swgain_deprecated),
+ AST_CLI_DEFINE(dahdi_set_dnd, "Set software gain on a channel", .deprecate_cmd = &cli_zap_set_dnd_deprecated),
};
#define TRANSFER 0
#define HANGUP 1
-static int zap_fake_event(struct zt_pvt *p, int mode)
+static int dahdi_fake_event(struct dahdi_pvt *p, int mode)
{
if (p) {
switch (mode) {
case TRANSFER:
- p->fake_event = ZT_EVENT_WINKFLASH;
+ p->fake_event = DAHDI_EVENT_WINKFLASH;
break;
case HANGUP:
- p->fake_event = ZT_EVENT_ONHOOK;
+ p->fake_event = DAHDI_EVENT_ONHOOK;
break;
default:
ast_log(LOG_WARNING, "I don't know how to handle transfer event with this: %d on channel %s\n",mode, p->owner->name);
}
return 0;
}
-static struct zt_pvt *find_channel(int channel)
+static struct dahdi_pvt *find_channel(int channel)
{
- struct zt_pvt *p = iflist;
+ struct dahdi_pvt *p = iflist;
while (p) {
if (p->channel == channel) {
break;
return p;
}
-static int action_zapdndon(struct mansession *s, const struct message *m)
+static int action_dahdidndon(struct mansession *s, const struct message *m)
{
- struct zt_pvt *p = NULL;
- const char *channel = astman_get_header(m, "ZapChannel");
+ struct dahdi_pvt *p = NULL;
+ const char *channel = astman_get_header(m, "DAHDIChannel");
if (ast_strlen_zero(channel)) {
astman_send_error(s, m, "No channel specified");
return 0;
}
-static int action_zapdndoff(struct mansession *s, const struct message *m)
+static int action_dahdidndoff(struct mansession *s, const struct message *m)
{
- struct zt_pvt *p = NULL;
- const char *channel = astman_get_header(m, "ZapChannel");
+ struct dahdi_pvt *p = NULL;
+ const char *channel = astman_get_header(m, "DAHDIChannel");
if (ast_strlen_zero(channel)) {
astman_send_error(s, m, "No channel specified");
static int action_transfer(struct mansession *s, const struct message *m)
{
- struct zt_pvt *p = NULL;
- const char *channel = astman_get_header(m, "ZapChannel");
+ struct dahdi_pvt *p = NULL;
+ const char *channel = astman_get_header(m, "DAHDIChannel");
if (ast_strlen_zero(channel)) {
astman_send_error(s, m, "No channel specified");
astman_send_error(s, m, "No such channel");
return 0;
}
- zap_fake_event(p,TRANSFER);
- astman_send_ack(s, m, "ZapTransfer");
+ dahdi_fake_event(p,TRANSFER);
+ astman_send_ack(s, m, "DAHDITransfer");
return 0;
}
static int action_transferhangup(struct mansession *s, const struct message *m)
{
- struct zt_pvt *p = NULL;
- const char *channel = astman_get_header(m, "ZapChannel");
+ struct dahdi_pvt *p = NULL;
+ const char *channel = astman_get_header(m, "DAHDIChannel");
if (ast_strlen_zero(channel)) {
astman_send_error(s, m, "No channel specified");
astman_send_error(s, m, "No such channel");
return 0;
}
- zap_fake_event(p,HANGUP);
- astman_send_ack(s, m, "ZapHangup");
+ dahdi_fake_event(p,HANGUP);
+ astman_send_ack(s, m, "DAHDIHangup");
return 0;
}
-static int action_zapdialoffhook(struct mansession *s, const struct message *m)
+static int action_dahdidialoffhook(struct mansession *s, const struct message *m)
{
- struct zt_pvt *p = NULL;
- const char *channel = astman_get_header(m, "ZapChannel");
+ struct dahdi_pvt *p = NULL;
+ const char *channel = astman_get_header(m, "DAHDIChannel");
const char *number = astman_get_header(m, "Number");
int i;
}
for (i = 0; i < strlen(number); i++) {
struct ast_frame f = { AST_FRAME_DTMF, number[i] };
- zap_queue_frame(p, &f, NULL);
+ dahdi_queue_frame(p, &f, NULL);
}
- astman_send_ack(s, m, "ZapDialOffhook");
+ astman_send_ack(s, m, "DAHDIDialOffhook");
return 0;
}
-static int action_zapshowchannels(struct mansession *s, const struct message *m)
+static int action_dahdishowchannels(struct mansession *s, const struct message *m)
{
- struct zt_pvt *tmp = NULL;
+ struct dahdi_pvt *tmp = NULL;
const char *id = astman_get_header(m, "ActionID");
- const char *zapchannel = astman_get_header(m, "ZapChannel");
+ const char *dahdichannel = astman_get_header(m, "DAHDIChannel");
char idText[256] = "";
int channels = 0;
- int zapchanquery = -1;
- if (!ast_strlen_zero(zapchannel)) {
- zapchanquery = atoi(zapchannel);
+ int dahdichanquery = -1;
+ if (!ast_strlen_zero(dahdichannel)) {
+ dahdichanquery = atoi(dahdichannel);
}
- astman_send_ack(s, m, "Zapata channel status will follow");
+ astman_send_ack(s, m, "DAHDI channel status will follow");
if (!ast_strlen_zero(id))
snprintf(idText, sizeof(idText), "ActionID: %s\r\n", id);
int alarm = get_alarms(tmp);
/* If a specific channel is queried for, only deliver status for that channel */
- if (zapchanquery > 0 && tmp->channel != zapchanquery)
+ if (dahdichanquery > 0 && tmp->channel != dahdichanquery)
continue;
channels++;
if (tmp->owner) {
/* Add data if we have a current call */
astman_append(s,
- "Event: ZapShowChannels\r\n"
- "ZapChannel: %d\r\n"
+ "Event: DAHDIShowChannels\r\n"
+ "DAHDIChannel: %d\r\n"
"Channel: %s\r\n"
"Uniqueid: %s\r\n"
"AccountCode: %s\r\n"
alarm2str(alarm), idText);
} else {
astman_append(s,
- "Event: ZapShowChannels\r\n"
- "ZapChannel: %d\r\n"
+ "Event: DAHDIShowChannels\r\n"
+ "DAHDIChannel: %d\r\n"
"Signalling: %s\r\n"
"SignallingCode: %d\r\n"
"Context: %s\r\n"
ast_mutex_unlock(&iflock);
astman_append(s,
- "Event: ZapShowChannelsComplete\r\n"
+ "Event: DAHDIShowChannelsComplete\r\n"
"%s"
"Items: %d\r\n"
"\r\n",
static int __unload_module(void)
{
int x;
- struct zt_pvt *p, *pl;
+ struct dahdi_pvt *p, *pl;
#if defined(HAVE_PRI) || defined(HAVE_SS7)
int i;
#endif
if (pris[i].master != AST_PTHREADT_NULL)
pthread_cancel(pris[i].master);
}
- ast_cli_unregister_multiple(zap_pri_cli, sizeof(zap_pri_cli) / sizeof(struct ast_cli_entry));
- ast_unregister_application(zap_send_keypad_facility_app);
+ ast_cli_unregister_multiple(dahdi_pri_cli, sizeof(dahdi_pri_cli) / sizeof(struct ast_cli_entry));
+ ast_unregister_application(dahdi_send_keypad_facility_app);
#endif
- ast_cli_unregister_multiple(zap_cli, sizeof(zap_cli) / sizeof(struct ast_cli_entry));
- ast_manager_unregister( "ZapDialOffhook" );
- ast_manager_unregister( "ZapHangup" );
- ast_manager_unregister( "ZapTransfer" );
- ast_manager_unregister( "ZapDNDoff" );
- ast_manager_unregister( "ZapDNDon" );
- ast_manager_unregister("ZapShowChannels");
- ast_manager_unregister("ZapRestart");
- ast_channel_unregister(&zap_tech);
+ ast_cli_unregister_multiple(dahdi_cli, sizeof(dahdi_cli) / sizeof(struct ast_cli_entry));
+ ast_manager_unregister( "DAHDIDialOffhook" );
+ ast_manager_unregister( "DAHDIHangup" );
+ ast_manager_unregister( "DAHDITransfer" );
+ ast_manager_unregister( "DAHDIDNDoff" );
+ ast_manager_unregister( "DAHDIDNDon" );
+ ast_manager_unregister("DAHDIShowChannels");
+ ast_manager_unregister("DAHDIRestart");
+ ast_channel_unregister(&dahdi_tech);
ast_mutex_lock(&iflock);
/* Hangup all interfaces if they have an owner */
p = iflist;
/* Free any callerid */
if (p->cidspill)
ast_free(p->cidspill);
- /* Close the zapata thingy */
+ /* Close the DAHDI thingy */
if (p->subs[SUB_REAL].zfd > -1)
- zt_close(p->subs[SUB_REAL].zfd);
+ dahdi_close(p->subs[SUB_REAL].zfd);
pl = p;
p = p->next;
x = pl->channel;
/* Free associated memory */
if (pl)
- destroy_zt_pvt(&pl);
+ destroy_dahdi_pvt(&pl);
ast_verb(3, "Unregistered channel %d\n", x);
}
iflist = NULL;
for (i = 0; i < NUM_SPANS; i++) {
if (pris[i].master && (pris[i].master != AST_PTHREADT_NULL))
pthread_join(pris[i].master, NULL);
- zt_close(pris[i].fds[i]);
+ dahdi_close(pris[i].fds[i]);
}
#endif /* HAVE_PRI */
for (i = 0; i < NUM_SPANS; i++) {
if (linksets[i].master && (linksets[i].master != AST_PTHREADT_NULL))
pthread_join(linksets[i].master, NULL);
- zt_close(linksets[i].fds[i]);
+ dahdi_close(linksets[i].fds[i]);
}
#endif /* HAVE_SS7 */
#ifdef HAVE_SS7
static int linkset_addsigchan(int sigchan)
{
- struct zt_ss7 *link;
+ struct dahdi_ss7 *link;
int res;
int curfd;
- ZT_PARAMS p;
- ZT_BUFFERINFO bi;
- struct zt_spaninfo si;
+ DAHDI_PARAMS p;
+ DAHDI_BUFFERINFO bi;
+ struct dahdi_spaninfo si;
link = ss7_resolve_linkset(cur_linkset);
}
curfd = link->numsigchans;
- link->fds[curfd] = open("/dev/zap/channel", O_RDWR, 0600);
- if ((link->fds[curfd] < 0) || (ioctl(link->fds[curfd],ZT_SPECIFY,&sigchan) == -1)) {
+ link->fds[curfd] = open("/dev/dahdi/channel", O_RDWR, 0600);
+ if ((link->fds[curfd] < 0) || (ioctl(link->fds[curfd],DAHDI_SPECIFY,&sigchan) == -1)) {
ast_log(LOG_ERROR, "Unable to open SS7 sigchan %d (%s)\n", sigchan, strerror(errno));
return -1;
}
- res = ioctl(link->fds[curfd], ZT_GET_PARAMS, &p);
+ res = ioctl(link->fds[curfd], DAHDI_GET_PARAMS, &p);
if (res) {
- zt_close(link->fds[curfd]);
+ dahdi_close(link->fds[curfd]);
link->fds[curfd] = -1;
ast_log(LOG_ERROR, "Unable to get parameters for sigchan %d (%s)\n", sigchan, strerror(errno));
return -1;
}
- if ((p.sigtype != ZT_SIG_HDLCFCS) && (p.sigtype != ZT_SIG_HARDHDLC)
-#if defined(HAVE_ZAPTEL_SIG_MTP2)
- && (p.sigtype != ZT_SIG_MTP2)
-#endif
- ) {
- zt_close(link->fds[curfd]);
+ if ((p.sigtype != DAHDI_SIG_HDLCFCS) && (p.sigtype != DAHDI_SIG_HARDHDLC) && (p.sigtype != DAHDI_SIG_MTP2)) {
+ dahdi_close(link->fds[curfd]);
link->fds[curfd] = -1;
- ast_log(LOG_ERROR, "sigchan %d is not in HDLC/FCS mode. See /etc/zaptel.conf\n", sigchan);
+ ast_log(LOG_ERROR, "sigchan %d is not in HDLC/FCS mode. See /etc/dahdi.conf\n", sigchan);
return -1;
}
- bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
- bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
+ bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
+ bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.numbufs = 32;
bi.bufsize = 512;
- if (ioctl(link->fds[curfd], ZT_SET_BUFINFO, &bi)) {
+ if (ioctl(link->fds[curfd], DAHDI_SET_BUFINFO, &bi)) {
ast_log(LOG_ERROR, "Unable to set appropriate buffering on channel %d\n", sigchan);
- zt_close(link->fds[curfd]);
+ dahdi_close(link->fds[curfd]);
link->fds[curfd] = -1;
return -1;
}
- ss7_add_link(link->ss7, SS7_TRANSPORT_ZAP, link->fds[curfd]);
+ ss7_add_link(link->ss7, SS7_TRANSPORT_DAHDI, link->fds[curfd]);
link->numsigchans++;
memset(&si, 0, sizeof(si));
- res = ioctl(link->fds[curfd], ZT_SPANSTAT, &si);
+ res = ioctl(link->fds[curfd], DAHDI_SPANSTAT, &si);
if (res) {
- zt_close(link->fds[curfd]);
+ dahdi_close(link->fds[curfd]);
link->fds[curfd] = -1;
ast_log(LOG_ERROR, "Unable to get span state for sigchan %d (%s)\n", sigchan, strerror(errno));
}
static char *handle_ss7_show_linkset(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int linkset;
- struct zt_ss7 *ss7;
+ struct dahdi_ss7 *ss7;
switch (cmd) {
case CLI_INIT:
e->command = "ss7 show linkset";
return CLI_SUCCESS;
}
-static struct ast_cli_entry zap_ss7_cli[] = {
+static struct ast_cli_entry dahdi_ss7_cli[] = {
AST_CLI_DEFINE(handle_ss7_debug, "Enables SS7 debugging on a linkset"),
AST_CLI_DEFINE(handle_ss7_no_debug, "Disables SS7 debugging on a linkset"),
AST_CLI_DEFINE(handle_ss7_block_cic, "Disables SS7 debugging on a linkset"),
return __unload_module();
}
-static int build_channels(struct zt_chan_conf *conf, int iscrv, const char *value, int reload, int lineno, int *found_pseudo)
+static int build_channels(struct dahdi_chan_conf *conf, int iscrv, const char *value, int reload, int lineno, int *found_pseudo)
{
char *c, *chan;
int x, start, finish;
- struct zt_pvt *tmp;
+ struct dahdi_pvt *tmp;
#ifdef HAVE_PRI
- struct zt_pri *pri;
+ struct dahdi_pri *pri;
int trunkgroup, y;
#endif
return 0;
}
-/** The length of the parameters list of 'zapchan'.
+/** The length of the parameters list of 'dahdichan'.
* \todo Move definition of MAX_CHANLIST_LEN to a proper place. */
#define MAX_CHANLIST_LEN 80
-#if defined(HAVE_ZAPTEL_ECHOCANPARAMS)
-static void process_echocancel(struct zt_chan_conf *confp, const char *data, unsigned int line)
+static void process_echocancel(struct dahdi_chan_conf *confp, const char *data, unsigned int line)
{
char *parse = ast_strdupa(data);
- char *params[ZT_MAX_ECHOCANPARAMS + 1];
+ char *params[DAHDI_MAX_ECHOCANPARAMS + 1];
unsigned int param_count;
unsigned int x;
confp->chan.echocancel.head.param_count++;
}
}
-#endif /* defined(HAVE_ZAPTEL_ECHOCANPARAMS) */
-/*! process_zap() - ignore keyword 'channel' and similar */
-#define PROC_ZAP_OPT_NOCHAN (1 << 0)
-/*! process_zap() - No warnings on non-existing cofiguration keywords */
-#define PROC_ZAP_OPT_NOWARN (1 << 1)
+/*! process_dahdi() - ignore keyword 'channel' and similar */
+#define PROC_DAHDI_OPT_NOCHAN (1 << 0)
+/*! process_dahdi() - No warnings on non-existing cofiguration keywords */
+#define PROC_DAHDI_OPT_NOWARN (1 << 1)
-static int process_zap(struct zt_chan_conf *confp, struct ast_variable *v, int reload, int options)
+static int process_dahdi(struct dahdi_chan_conf *confp, struct ast_variable *v, int reload, int options)
{
- struct zt_pvt *tmp;
+ struct dahdi_pvt *tmp;
const char *ringc; /* temporary string for parsing the dring number. */
int y;
int found_pseudo = 0;
- char zapchan[MAX_CHANLIST_LEN] = {};
+ char dahdichan[MAX_CHANLIST_LEN] = {};
for (; v; v = v->next) {
if (!ast_jb_read_conf(&global_jbconf, v->name, v->value))
#endif
) {
int iscrv;
- if (options && PROC_ZAP_OPT_NOCHAN)
+ if (options && PROC_DAHDI_OPT_NOCHAN)
continue;
iscrv = !strcasecmp(v->name, "crv");
if (build_channels(confp, iscrv, v->value, reload, v->lineno, &found_pseudo))
return -1;
- } else if (!strcasecmp(v->name, "zapchan")) {
- ast_copy_string(zapchan, v->value, sizeof(zapchan));
+ } else if (!strcasecmp(v->name, "dahdichan")) {
+ ast_copy_string(dahdichan, v->value, sizeof(dahdichan));
} else if (!strcasecmp(v->name, "usedistinctiveringdetection")) {
usedistinctiveringdetection = ast_true(v->value);
} else if (!strcasecmp(v->name, "distinctiveringaftercid")) {
} else if (!strcasecmp(v->value, "both") || ast_true(v->value))
confp->chan.callprogress |= CALLPROGRESS_FAX_INCOMING | CALLPROGRESS_FAX_OUTGOING;
} else if (!strcasecmp(v->name, "echocancel")) {
-#if defined(HAVE_ZAPTEL_ECHOCANPARAMS)
process_echocancel(confp, v->value, v->lineno);
-#else
- y = ast_strlen_zero(v->value) ? 0 : atoi(v->value);
-
- if ((y == 32) || (y == 64) || (y == 128) || (y == 256) || (y == 512) || (y == 1024))
- confp->chan.echocancel = y;
- else if ((confp->chan.echocancel = ast_true(v->value)))
- confp->chan.echocancel = 128;
-#endif
} else if (!strcasecmp(v->name, "echotraining")) {
if (sscanf(v->value, "%d", &y) == 1) {
if ((y < 10) || (y > 4000)) {
ast_copy_string(confp->chan.cid_name, v->value, sizeof(confp->chan.cid_name));
} else if (!strcasecmp(v->name, "cid_number")) {
ast_copy_string(confp->chan.cid_num, v->value, sizeof(confp->chan.cid_num));
- } else if (!strcasecmp(v->name, "useincomingcalleridonzaptransfer")) {
- confp->chan.zaptrcallerid = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "useincomingcalleridondahditransfer")) {
+ confp->chan.dahditrcallerid = ast_true(v->value);
} else if (!strcasecmp(v->name, "restrictcid")) {
confp->chan.restrictcid = ast_true(v->value);
} else if (!strcasecmp(v->name, "usecallingpres")) {
ast_copy_string(confp->pri.idledial, v->value, sizeof(confp->pri.idledial));
} else if (!strcasecmp(v->name, "overlapdial")) {
if (ast_true(v->value)) {
- confp->pri.overlapdial = ZAP_OVERLAPDIAL_BOTH;
+ confp->pri.overlapdial = DAHDI_OVERLAPDIAL_BOTH;
} else if (!strcasecmp(v->value, "incoming")) {
- confp->pri.overlapdial = ZAP_OVERLAPDIAL_INCOMING;
+ confp->pri.overlapdial = DAHDI_OVERLAPDIAL_INCOMING;
} else if (!strcasecmp(v->value, "outgoing")) {
- confp->pri.overlapdial = ZAP_OVERLAPDIAL_OUTGOING;
+ confp->pri.overlapdial = DAHDI_OVERLAPDIAL_OUTGOING;
} else if (!strcasecmp(v->value, "both") || ast_true(v->value)) {
- confp->pri.overlapdial = ZAP_OVERLAPDIAL_BOTH;
+ confp->pri.overlapdial = DAHDI_OVERLAPDIAL_BOTH;
} else {
- confp->pri.overlapdial = ZAP_OVERLAPDIAL_NONE;
+ confp->pri.overlapdial = DAHDI_OVERLAPDIAL_NONE;
}
} else if (!strcasecmp(v->name, "pritimer")) {
#ifdef PRI_GETSET_TIMERS
/* 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};
int i;
- struct zt_ring_cadence new_cadence;
+ struct dahdi_ring_cadence new_cadence;
int cid_location = -1;
int firstcadencepos = 0;
char original_args[80];
} else {
if (firstcadencepos == 0) {
firstcadencepos = i; /* only recorded to avoid duplicate specification */
- /* duration will be passed negative to the Zaptel driver */
+ /* duration will be passed negative to the DAHDI driver */
} else {
ast_log(LOG_ERROR, "First cadence position specified twice: %s at line %d.\n", original_args, v->lineno);
cadence_is_ok = 0;
int toneduration;
int ctlfd;
int res;
- struct zt_dialparams dps;
+ struct dahdi_dialparams dps;
- ctlfd = open("/dev/zap/ctl", O_RDWR);
+ ctlfd = open("/dev/dahdi/ctl", O_RDWR);
if (ctlfd == -1) {
- ast_log(LOG_ERROR, "Unable to open /dev/zap/ctl to set toneduration at line %d.\n", v->lineno);
+ ast_log(LOG_ERROR, "Unable to open /dev/dahdi/ctl to set toneduration at line %d.\n", v->lineno);
return -1;
}
memset(&dps, 0, sizeof(dps));
dps.dtmf_tonelen = dps.mfv1_tonelen = toneduration;
- res = ioctl(ctlfd, ZT_SET_DIALPARAMS, &dps);
+ res = ioctl(ctlfd, DAHDI_SET_DIALPARAMS, &dps);
if (res < 0) {
ast_log(LOG_ERROR, "Invalid tone duration: %d ms at line %d.\n", toneduration, v->lineno);
return -1;
} else if (!strcasecmp(v->name, "mwilevel")) {
mwilevel = atoi(v->value);
}
- } else if (!(options && PROC_ZAP_OPT_NOWARN) )
+ } else if (!(options && PROC_DAHDI_OPT_NOWARN) )
ast_log(LOG_WARNING, "Ignoring %s at line %d.\n", v->name, v->lineno);
}
- if (zapchan[0]) {
- /* The user has set 'zapchan' */
+ if (dahdichan[0]) {
+ /* The user has set 'dahdichan' */
/*< \todo pass proper line number instead of 0 */
- if (build_channels(confp, 0, zapchan, reload, 0, &found_pseudo)) {
+ if (build_channels(confp, 0, dahdichan, reload, 0, &found_pseudo)) {
return -1;
}
}
return 0;
}
-static int setup_zap(int reload)
+static int setup_dahdi(int reload)
{
struct ast_config *cfg, *ucfg;
struct ast_variable *v;
- struct zt_chan_conf base_conf = zt_chan_conf_default();
- struct zt_chan_conf conf;
+ struct dahdi_chan_conf base_conf = dahdi_chan_conf_default();
+ struct dahdi_chan_conf conf;
struct ast_flags config_flags = { reload == 1 ? CONFIG_FLAG_FILEUNCHANGED : 0 };
const char *cat;
int res;
while (c && (i < NUM_DCHANS)) {
dchannels[i] = atoi(c + 1);
if (dchannels[i] < 0) {
- ast_log(LOG_WARNING, "D-channel for trunk group %d must be a postiive number at line %d of zapata.conf\n", trunkgroup, v->lineno);
+ ast_log(LOG_WARNING, "D-channel for trunk group %d must be a postiive number at line %d of chan_dahdi.conf\n", trunkgroup, v->lineno);
} else
i++;
c = strchr(c + 1, ',');
}
if (i) {
if (pri_create_trunkgroup(trunkgroup, dchannels)) {
- ast_log(LOG_WARNING, "Unable to create trunk group %d with Primary D-channel %d at line %d of zapata.conf\n", trunkgroup, dchannels[0], v->lineno);
+ ast_log(LOG_WARNING, "Unable to create trunk group %d with Primary D-channel %d at line %d of chan_dahdi.conf\n", trunkgroup, dchannels[0], v->lineno);
} else
ast_verb(2, "Created trunk group %d with Primary D-channel %d and %d backup%s\n", trunkgroup, dchannels[0], i - 1, (i == 1) ? "" : "s");
} else
- ast_log(LOG_WARNING, "Trunk group %d lacks any valid D-channels at line %d of zapata.conf\n", trunkgroup, v->lineno);
+ ast_log(LOG_WARNING, "Trunk group %d lacks any valid D-channels at line %d of chan_dahdi.conf\n", trunkgroup, v->lineno);
} else
- ast_log(LOG_WARNING, "Trunk group %d lacks a primary D-channel at line %d of zapata.conf\n", trunkgroup, v->lineno);
+ ast_log(LOG_WARNING, "Trunk group %d lacks a primary D-channel at line %d of chan_dahdi.conf\n", trunkgroup, v->lineno);
} else
- ast_log(LOG_WARNING, "Trunk group identifier must be a positive integer at line %d of zapata.conf\n", v->lineno);
+ ast_log(LOG_WARNING, "Trunk group identifier must be a positive integer at line %d of chan_dahdi.conf\n", v->lineno);
} else if (!strcasecmp(v->name, "spanmap")) {
spanno = atoi(v->value);
if (spanno > 0) {
} else
ast_verb(2, "Mapped span %d to trunk group %d (logical span %d)\n", spanno, trunkgroup, logicalspan);
} else
- ast_log(LOG_WARNING, "Logical span must be a postive number, or '0' (for unspecified) at line %d of zapata.conf\n", v->lineno);
+ ast_log(LOG_WARNING, "Logical span must be a postive number, or '0' (for unspecified) at line %d of chan_dahdi.conf\n", v->lineno);
} else
- ast_log(LOG_WARNING, "Trunk group must be a postive number at line %d of zapata.conf\n", v->lineno);
+ ast_log(LOG_WARNING, "Trunk group must be a postive number at line %d of chan_dahdi.conf\n", v->lineno);
} else
- ast_log(LOG_WARNING, "Missing trunk group for span map at line %d of zapata.conf\n", v->lineno);
+ ast_log(LOG_WARNING, "Missing trunk group for span map at line %d of chan_dahdi.conf\n", v->lineno);
} else
- ast_log(LOG_WARNING, "Span number must be a postive integer at line %d of zapata.conf\n", v->lineno);
+ ast_log(LOG_WARNING, "Span number must be a postive integer at line %d of chan_dahdi.conf\n", v->lineno);
} else {
ast_log(LOG_NOTICE, "Ignoring unknown keyword '%s' in trunkgroups\n", v->name);
}
mwimonitornotify[0] = '\0';
v = ast_variable_browse(cfg, "channels");
- if ((res = process_zap(&base_conf, v, reload, 0))) {
+ if ((res = process_dahdi(&base_conf, v, reload, 0))) {
ast_mutex_unlock(&iflock);
ast_config_destroy(cfg);
if (ucfg) {
return res;
}
- /* Now get configuration from all normal sections in zapata.conf: */
+ /* Now get configuration from all normal sections in chan_dahdi.conf: */
for (cat = ast_category_browse(cfg, NULL); cat ; cat = ast_category_browse(cfg, cat)) {
/* [channels] and [trunkgroups] are used. Let's also reserve
* [globals] and [general] for future use
memcpy(&conf, &base_conf, sizeof(conf));
- if ((res = process_zap(&conf, ast_variable_browse(cfg, cat), reload, PROC_ZAP_OPT_NOCHAN))) {
+ if ((res = process_dahdi(&conf, ast_variable_browse(cfg, cat), reload, PROC_DAHDI_OPT_NOCHAN))) {
ast_mutex_unlock(&iflock);
ast_config_destroy(cfg);
if (ucfg) {
if (ucfg) {
const char *chans;
- process_zap(&base_conf, ast_variable_browse(ucfg, "general"), 1, 0);
+ process_dahdi(&base_conf, ast_variable_browse(ucfg, "general"), 1, 0);
for (cat = ast_category_browse(ucfg, NULL); cat ; cat = ast_category_browse(ucfg, cat)) {
if (!strcasecmp(cat, "general")) {
continue;
}
- chans = ast_variable_retrieve(ucfg, cat, "zapchan");
+ chans = ast_variable_retrieve(ucfg, cat, "dahdichan");
if (ast_strlen_zero(chans)) {
continue;
memcpy(&conf, &base_conf, sizeof(conf));
- if ((res = process_zap(&conf, ast_variable_browse(ucfg, cat), reload, PROC_ZAP_OPT_NOCHAN | PROC_ZAP_OPT_NOWARN))) {
+ if ((res = process_dahdi(&conf, ast_variable_browse(ucfg, cat), reload, PROC_DAHDI_OPT_NOCHAN | PROC_DAHDI_OPT_NOWARN))) {
ast_config_destroy(ucfg);
ast_mutex_unlock(&iflock);
return res;
for (i = 0; i < NUM_DCHANS; i++)
pris[y].fds[i] = -1;
}
- pri_set_error(zt_pri_error);
- pri_set_message(zt_pri_message);
- ast_register_application(zap_send_keypad_facility_app, zap_send_keypad_facility_exec,
- zap_send_keypad_facility_synopsis, zap_send_keypad_facility_descrip);
+ pri_set_error(dahdi_pri_error);
+ pri_set_message(dahdi_pri_message);
+ ast_register_application(dahdi_send_keypad_facility_app, dahdi_send_keypad_facility_exec,
+ dahdi_send_keypad_facility_synopsis, dahdi_send_keypad_facility_descrip);
#endif
#ifdef HAVE_SS7
memset(linksets, 0, sizeof(linksets));
for (i = 0; i < NUM_DCHANS; i++)
linksets[y].fds[i] = -1;
}
- ss7_set_error(zt_ss7_error);
- ss7_set_message(zt_ss7_message);
+ ss7_set_error(dahdi_ss7_error);
+ ss7_set_message(dahdi_ss7_message);
#endif /* HAVE_SS7 */
- res = setup_zap(0);
- /* Make sure we can register our Zap channel type */
+ res = setup_dahdi(0);
+ /* Make sure we can register our DAHDI channel type */
if (res)
return AST_MODULE_LOAD_DECLINE;
- if (ast_channel_register(&zap_tech)) {
- ast_log(LOG_ERROR, "Unable to register channel class 'Zap'\n");
+ if (ast_channel_register(&dahdi_tech)) {
+ ast_log(LOG_ERROR, "Unable to register channel class 'DAHDI'\n");
__unload_module();
return AST_MODULE_LOAD_FAILURE;
}
#ifdef HAVE_PRI
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(struct ast_cli_entry));
+ ast_cli_register_multiple(dahdi_pri_cli, sizeof(dahdi_pri_cli) / sizeof(struct ast_cli_entry));
#endif
#ifdef HAVE_SS7
- ast_cli_register_multiple(zap_ss7_cli, sizeof(zap_ss7_cli) / sizeof(zap_ss7_cli[0]));
+ ast_cli_register_multiple(dahdi_ss7_cli, sizeof(dahdi_ss7_cli) / sizeof(dahdi_ss7_cli[0]));
#endif
- ast_cli_register_multiple(zap_cli, sizeof(zap_cli) / sizeof(struct ast_cli_entry));
+ ast_cli_register_multiple(dahdi_cli, sizeof(dahdi_cli) / sizeof(struct ast_cli_entry));
memset(round_robin, 0, sizeof(round_robin));
- ast_manager_register( "ZapTransfer", 0, action_transfer, "Transfer Zap Channel" );
- ast_manager_register( "ZapHangup", 0, action_transferhangup, "Hangup Zap Channel" );
- ast_manager_register( "ZapDialOffhook", 0, action_zapdialoffhook, "Dial over Zap channel while offhook" );
- ast_manager_register( "ZapDNDon", 0, action_zapdndon, "Toggle Zap channel Do Not Disturb status ON" );
- ast_manager_register( "ZapDNDoff", 0, action_zapdndoff, "Toggle Zap channel Do Not Disturb status OFF" );
- ast_manager_register("ZapShowChannels", 0, action_zapshowchannels, "Show status zapata channels");
- ast_manager_register("ZapRestart", 0, action_zaprestart, "Fully Restart Zaptel channels (terminates calls)");
+ ast_manager_register( "DAHDITransfer", 0, action_transfer, "Transfer DAHDI Channel" );
+ ast_manager_register( "DAHDIHangup", 0, action_transferhangup, "Hangup DAHDI Channel" );
+ ast_manager_register( "DAHDIDialOffhook", 0, action_dahdidialoffhook, "Dial over DAHDI channel while offhook" );
+ ast_manager_register( "DAHDIDNDon", 0, action_dahdidndon, "Toggle DAHDI channel Do Not Disturb status ON" );
+ ast_manager_register( "DAHDIDNDoff", 0, action_dahdidndoff, "Toggle DAHDI channel Do Not Disturb status OFF" );
+ ast_manager_register("DAHDIShowChannels", 0, action_dahdishowchannels, "Show status DAHDI channels");
+ ast_manager_register("DAHDIRestart", 0, action_dahdirestart, "Fully Restart DAHDI channels (terminates calls)");
return res;
}
-static int zt_sendtext(struct ast_channel *c, const char *text)
+static int dahdi_sendtext(struct ast_channel *c, const char *text)
{
#define END_SILENCE_LEN 400
#define HEADER_MS 50
#define ASCII_BYTES_PER_CHAR 80
unsigned char *buf,*mybuf;
- struct zt_pvt *p = c->tech_pvt;
+ struct dahdi_pvt *p = c->tech_pvt;
struct pollfd fds[1];
int size,res,fd,len,x;
int bytes=0;
float scont = 0.0;
int index;
- index = zt_get_index(c, p, 0);
+ index = dahdi_get_index(c, p, 0);
if (index < 0) {
ast_log(LOG_WARNING, "Huh? I don't exist?\n");
return -1;
{
int res = 0;
- res = setup_zap(1);
+ res = setup_dahdi(1);
if (res) {
- ast_log(LOG_WARNING, "Reload of chan_zap.so is unsuccessful!\n");
+ ast_log(LOG_WARNING, "Reload of chan_dahdi.so is unsuccessful!\n");
return -1;
}
return 0;
}
/* This is a workaround so that menuselect displays a proper description
- * AST_MODULE_INFO(, , "Zapata Telephony"
+ * AST_MODULE_INFO(, , "DAHDI Telephony"
*/
-#ifdef ZAPATA_PRI
-#define tdesc "Zapata Telephony w/PRI"
+#ifdef DAHDI_PRI
+#define tdesc "DAHDI Telephony w/PRI"
#else
-#define tdesc "Zapata Telephony"
+#define tdesc "DAHDI Telephony"
#endif
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, tdesc,
*/
/*** MODULEINFO
- <use>zaptel</use>
+ <use>dahdi</use>
<use>crypto</use>
***/
#include <sys/stat.h>
#include <regex.h>
-#include "asterisk/zapata.h"
+#include "asterisk/dahdi.h"
#include "asterisk/paths.h" /* need ast_config_AST_DATA_DIR for firmware */
#include "asterisk/lock.h"
char buf[1024];
int res, processed = 0, totalcalls = 0;
struct iax2_trunk_peer *tpeer = NULL, *drop = NULL;
-#ifdef ZT_TIMERACK
+#ifdef DAHDI_TIMERACK
int x = 1;
#endif
struct timeval now = ast_tvnow();
if (iaxtrunkdebug)
ast_verbose("Beginning trunk processing. Trunk queue ceiling is %d bytes per host\n", trunkmaxsize);
if (events & AST_IO_PRI) {
-#ifdef ZT_TIMERACK
+#ifdef DAHDI_TIMERACK
/* Great, this is a timing interface, just call the ioctl */
- if (ioctl(fd, ZT_TIMERACK, &x)) {
- ast_log(LOG_WARNING, "Unable to acknowledge zap timer. IAX trunking will fail!\n");
+ if (ioctl(fd, DAHDI_TIMERACK, &x)) {
+ ast_log(LOG_WARNING, "Unable to acknowledge DAHDI timer. IAX trunking will fail!\n");
usleep(1);
return -1;
}
} else if (!strcasecmp(v->name, "trunk")) {
ast_set2_flag(peer, ast_true(v->value), IAX_TRUNK);
if (ast_test_flag(peer, IAX_TRUNK) && (timingfd < 0)) {
- ast_log(LOG_WARNING, "Unable to support trunking on peer '%s' without zaptel timing\n", peer->name);
+ ast_log(LOG_WARNING, "Unable to support trunking on peer '%s' without DAHDI timing\n", peer->name);
ast_clear_flag(peer, IAX_TRUNK);
}
} else if (!strcasecmp(v->name, "auth")) {
} else if (!strcasecmp(v->name, "trunk")) {
ast_set2_flag(user, ast_true(v->value), IAX_TRUNK);
if (ast_test_flag(user, IAX_TRUNK) && (timingfd < 0)) {
- ast_log(LOG_WARNING, "Unable to support trunking on user '%s' without zaptel timing\n", user->name);
+ ast_log(LOG_WARNING, "Unable to support trunking on user '%s' without DAHDI timing\n", user->name);
ast_clear_flag(user, IAX_TRUNK);
}
} else if (!strcasecmp(v->name, "auth")) {
static void set_timing(void)
{
-#ifdef HAVE_ZAPTEL
+#ifdef HAVE_DAHDI
int bs = trunkfreq * 8;
if (timingfd > -1) {
if (
-#ifdef ZT_TIMERACK
- ioctl(timingfd, ZT_TIMERCONFIG, &bs) &&
+#ifdef DAHDI_TIMERACK
+ ioctl(timingfd, DAHDI_TIMERCONFIG, &bs) &&
#endif
- ioctl(timingfd, ZT_SET_BLOCKSIZE, &bs))
+ ioctl(timingfd, DAHDI_SET_BLOCKSIZE, &bs))
ast_log(LOG_WARNING, "Unable to set blocksize on timing source\n");
}
#endif
iax_set_error(iax_error_output);
jb_setoutput(jb_error_output, jb_warning_output, NULL);
-#ifdef HAVE_ZAPTEL
-#ifdef ZT_TIMERACK
- timingfd = open("/dev/zap/timer", O_RDWR);
+#ifdef HAVE_DAHDI
+#ifdef DAHDI_TIMERACK
+ timingfd = open("/dev/dahdi/timer", O_RDWR);
if (timingfd < 0)
#endif
- timingfd = open("/dev/zap/pseudo", O_RDWR);
+ timingfd = open("/dev/dahdi/pseudo", O_RDWR);
if (timingfd < 0)
ast_log(LOG_WARNING, "Unable to open IAX timing interface: %s\n", strerror(errno));
#endif
ast_indicate(chan, -1);
} else {
/* XXX Redundant? We should already be playing dialtone */
- /*tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALTONE);*/
+ /*tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALTONE);*/
transmit_notify_request(sub, "L/dl");
}
if (ast_exists_extension(chan, chan->context, p->dtmf_buf, 1, p->cid_num)) {
ast_copy_string(p->call_forward, p->dtmf_buf, sizeof(p->call_forward));
ast_verb(3, "Setting call forward to '%s' on channel %s\n",
p->call_forward, chan->name);
- /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
+ /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
if (res)
break;
ast_indicate(chan, -1);
sleep(1);
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
- /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALTONE);*/
+ /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALTONE);*/
transmit_notify_request(sub, "L/dl");
len = 0;
getforward = 0;
p->hidecallerid ? "" : p->cid_name,
chan->cid.cid_ani ? NULL : p->cid_num);
ast_setstate(chan, AST_STATE_RING);
- /*zt_enable_ec(p);*/
+ /*dahdi_enable_ec(p);*/
if (p->dtmfmode & MGCP_DTMF_HYBRID) {
p->dtmfmode |= MGCP_DTMF_INBAND;
ast_indicate(chan, -1);
res = ast_pbx_run(chan);
if (res) {
ast_log(LOG_WARNING, "PBX exited non-zero\n");
- /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);*/
+ /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_CONGESTION);*/
/*transmit_notify_request(p, "nbz", 1);*/
transmit_notify_request(sub, "G/cg");
}
}
} else if (res == 0) {
ast_debug(1, "not enough digits (and no ambiguous match)...\n");
- /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);*/
+ /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_CONGESTION);*/
transmit_notify_request(sub, "G/cg");
- /*zt_wait_event(p->subs[index].zfd);*/
+ /*dahdi_wait_event(p->subs[index].zfd);*/
ast_hangup(chan);
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
return NULL;
ast_verb(3, "Disabling call waiting on %s\n", chan->name);
/* Disable call waiting if enabled */
p->callwaiting = 0;
- /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
+ /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
len = 0;
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
*/
if (ast_pickup_call(chan)) {
ast_log(LOG_WARNING, "No call pickup possible...\n");
- /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);*/
+ /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_CONGESTION);*/
transmit_notify_request(sub, "G/cg");
}
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
/* Disable Caller*ID if enabled */
p->hidecallerid = 1;
ast_set_callerid(chan, "", "", NULL);
- /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
+ /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
len = 0;
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
res = ast_say_digit_str(chan, p->lastcallerid, "", chan->language);
}
if (!res)
- /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
+ /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
break;
} else if (!strcmp(p->dtmf_buf, "*78")) {
/* Do not disturb */
ast_verb(3, "Enabled DND on channel %s\n", chan->name);
- /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
+ /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
p->dnd = 1;
getforward = 0;
} else if (!strcmp(p->dtmf_buf, "*79")) {
/* Do not disturb */
ast_verb(3, "Disabled DND on channel %s\n", chan->name);
- /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
+ /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
p->dnd = 0;
getforward = 0;
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
len = 0;
} else if (p->cancallforward && !strcmp(p->dtmf_buf, "*72")) {
- /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
+ /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
getforward = 1;
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
len = 0;
} else if (p->cancallforward && !strcmp(p->dtmf_buf, "*73")) {
ast_verb(3, "Cancelling call forwarding on channel %s\n", chan->name);
- /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
+ /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
memset(p->call_forward, 0, sizeof(p->call_forward));
getforward = 0;
ast_verb(3, "Blacklisting number %s\n", p->lastcallerid);
res = ast_db_put("blacklist", p->lastcallerid, "1");
if (!res) {
- /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
+ /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
len = 0;
/* Enable Caller*ID if enabled */
p->hidecallerid = 0;
ast_set_callerid(chan, p->cid_num, p->cid_name, NULL);
- /*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
+ /*res = tone_zone_play_tone(p->subs[index].zfd, DAHDI_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
len = 0;
memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
/*
* Asterisk -- An open source telephony toolkit.
*
- * Zaptel native transcoding support
+ * DAHDI native transcoding support
*
* Copyright (C) 1999 - 2006, Digium, Inc.
*
/*! \file
*
- * \brief Translate between various formats natively through Zaptel transcoding
+ * \brief Translate between various formats natively through DAHDI transcoding
*
* \ingroup codecs
*/
/*** MODULEINFO
- <depend>zaptel_transcode</depend>
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
***/
#include "asterisk.h"
#include <netinet/in.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
-#include <zaptel/zaptel.h>
+#include "asterisk/dahdi.h"
#include "asterisk/lock.h"
#include "asterisk/translate.h"
#include "asterisk/config.h"
static char *handle_cli_transcoder_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
static struct ast_cli_entry cli[] = {
- AST_CLI_DEFINE(handle_cli_transcoder_show, "Display Zaptel transcoder utilization.")
+ AST_CLI_DEFINE(handle_cli_transcoder_show, "Display DAHDI transcoder utilization.")
};
struct format_map {
int totalms;
int lasttotalms;
#endif
- struct zt_transcode_header *hdr;
+ struct dahdi_transcode_header *hdr;
};
static char *handle_cli_transcoder_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
e->command = "transcoder show";
e->usage =
"Usage: transcoder show\n"
- " Displays channel utilization of Zaptel transcoder(s).\n";
+ " Displays channel utilization of DAHDI transcoder(s).\n";
return NULL;
case CLI_GENERATE:
return NULL;
copy = channels;
if (copy.total == 0)
- ast_cli(a->fd, "No Zaptel transcoders found.\n");
+ ast_cli(a->fd, "No DAHDI transcoders found.\n");
else
ast_cli(a->fd, "%d/%d encoders/decoders of %d channels are in use.\n", copy.encoders, copy.decoders, copy.total);
return CLI_SUCCESS;
}
-static int zap_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
+static int dahdi_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
{
- struct pvt *ztp = pvt->pvt;
- struct zt_transcode_header *hdr = ztp->hdr;
+ struct pvt *dahdip = pvt->pvt;
+ struct dahdi_transcode_header *hdr = dahdip->hdr;
if (!f->subclass) {
/* Fake a return frame for calculation purposes */
- ztp->fake = 2;
+ dahdip->fake = 2;
pvt->samples = f->samples;
return 0;
}
return -1;
}
-static struct ast_frame *zap_frameout(struct ast_trans_pvt *pvt)
+static struct ast_frame *dahdi_frameout(struct ast_trans_pvt *pvt)
{
- struct pvt *ztp = pvt->pvt;
- struct zt_transcode_header *hdr = ztp->hdr;
+ struct pvt *dahdip = pvt->pvt;
+ struct dahdi_transcode_header *hdr = dahdip->hdr;
unsigned int x;
- if (ztp->fake == 2) {
- ztp->fake = 1;
+ if (dahdip->fake == 2) {
+ dahdip->fake = 1;
pvt->f.frametype = AST_FRAME_VOICE;
pvt->f.subclass = 0;
pvt->f.samples = 160;
pvt->f.mallocd = 0;
ast_set_flag(&pvt->f, AST_FRFLAG_FROM_TRANSLATOR);
pvt->samples = 0;
- } else if (ztp->fake == 1) {
+ } else if (dahdip->fake == 1) {
return NULL;
} else {
if (hdr->dstlen) {
#ifdef DEBUG_TRANSCODE
- ztp->totalms += hdr->dstsamples;
- if ((ztp->totalms - ztp->lasttotalms) > 8000) {
- printf("Whee %p, %d (%d to %d)\n", ztp, hdr->dstlen, ztp->lasttotalms, ztp->totalms);
- ztp->lasttotalms = ztp->totalms;
+ dahdip->totalms += hdr->dstsamples;
+ if ((dahdip->totalms - dahdip->lasttotalms) > 8000) {
+ printf("Whee %p, %d (%d to %d)\n", dahdip, hdr->dstlen, dahdip->lasttotalms, dahdip->totalms);
+ dahdip->lasttotalms = dahdip->totalms;
}
#endif
pvt->f.frametype = AST_FRAME_VOICE;
} else {
if (hdr->srclen) {
hdr->dstoffset = AST_FRIENDLY_OFFSET;
- x = ZT_TCOP_TRANSCODE;
- if (ioctl(ztp->fd, ZT_TRANSCODE_OP, &x))
+ x = DAHDI_TCOP_TRANSCODE;
+ if (ioctl(dahdip->fd, DAHDI_TRANSCODE_OP, &x))
ast_log(LOG_WARNING, "Failed to transcode: %s\n", strerror(errno));
}
return NULL;
return &pvt->f;
}
-static void zap_destroy(struct ast_trans_pvt *pvt)
+static void dahdi_destroy(struct ast_trans_pvt *pvt)
{
- struct pvt *ztp = pvt->pvt;
+ struct pvt *dahdip = pvt->pvt;
unsigned int x;
- x = ZT_TCOP_RELEASE;
- if (ioctl(ztp->fd, ZT_TRANSCODE_OP, &x))
+ x = DAHDI_TCOP_RELEASE;
+ if (ioctl(dahdip->fd, DAHDI_TRANSCODE_OP, &x))
ast_log(LOG_WARNING, "Failed to release transcoder channel: %s\n", strerror(errno));
- switch (ztp->hdr->dstfmt) {
+ switch (dahdip->hdr->dstfmt) {
case AST_FORMAT_G729A:
case AST_FORMAT_G723_1:
ast_atomic_fetchadd_int(&channels.encoders, -1);
break;
}
- munmap(ztp->hdr, sizeof(*ztp->hdr));
- close(ztp->fd);
+ munmap(dahdip->hdr, sizeof(*dahdip->hdr));
+ close(dahdip->fd);
}
-static int zap_translate(struct ast_trans_pvt *pvt, int dest, int source)
+static int dahdi_translate(struct ast_trans_pvt *pvt, int dest, int source)
{
- /* Request translation through zap if possible */
+ /* Request translation through dahdi if possible */
int fd;
- unsigned int x = ZT_TCOP_ALLOCATE;
- struct pvt *ztp = pvt->pvt;
- struct zt_transcode_header *hdr;
+ unsigned int x = DAHDI_TCOP_ALLOCATE;
+ struct pvt *dahdip = pvt->pvt;
+ struct dahdi_transcode_header *hdr;
int flags;
- if ((fd = open("/dev/zap/transcode", O_RDWR)) < 0)
+ if ((fd = open("/dev/dahdi/transcode", O_RDWR)) < 0)
return -1;
flags = fcntl(fd, F_GETFL);
if (flags > - 1) {
return -1;
}
- if (hdr->magic != ZT_TRANSCODE_MAGIC) {
+ if (hdr->magic != DAHDI_TRANSCODE_MAGIC) {
ast_log(LOG_ERROR, "Transcoder header (%08x) wasn't magic. Abandoning\n", hdr->magic);
munmap(hdr, sizeof(*hdr));
close(fd);
hdr->srcfmt = (1 << source);
hdr->dstfmt = (1 << dest);
- if (ioctl(fd, ZT_TRANSCODE_OP, &x)) {
+ if (ioctl(fd, DAHDI_TRANSCODE_OP, &x)) {
ast_log(LOG_ERROR, "Unable to attach transcoder: %s\n", strerror(errno));
munmap(hdr, sizeof(*hdr));
close(fd);
return -1;
}
- ztp = pvt->pvt;
- ztp->fd = fd;
- ztp->hdr = hdr;
+ dahdip = pvt->pvt;
+ dahdip->fd = fd;
+ dahdip->hdr = hdr;
switch (hdr->dstfmt) {
case AST_FORMAT_G729A:
return 0;
}
-static int zap_new(struct ast_trans_pvt *pvt)
+static int dahdi_new(struct ast_trans_pvt *pvt)
{
- return zap_translate(pvt, pvt->t->dstfmt, pvt->t->srcfmt);
+ return dahdi_translate(pvt, pvt->t->dstfmt, pvt->t->srcfmt);
}
static struct ast_frame *fakesrc_sample(void)
static int register_translator(int dst, int src)
{
- struct translator *zt;
+ struct translator *dahdi;
int res;
- if (!(zt = ast_calloc(1, sizeof(*zt))))
+ if (!(dahdi = ast_calloc(1, sizeof(*dahdi))))
return -1;
- snprintf((char *) (zt->t.name), sizeof(zt->t.name), "zap%sto%s",
+ snprintf((char *) (dahdi->t.name), sizeof(dahdi->t.name), "DAHDI%sto%s",
ast_getformatname((1 << src)), ast_getformatname((1 << dst)));
- zt->t.srcfmt = (1 << src);
- zt->t.dstfmt = (1 << dst);
- zt->t.newpvt = zap_new;
- zt->t.framein = zap_framein;
- zt->t.frameout = zap_frameout;
- zt->t.destroy = zap_destroy;
- zt->t.sample = fakesrc_sample;
- zt->t.useplc = global_useplc;
- zt->t.buf_size = BUFFER_SAMPLES * 2;
- zt->t.desc_size = sizeof(struct pvt);
- if ((res = ast_register_translator(&zt->t))) {
- ast_free(zt);
+ dahdi->t.srcfmt = (1 << src);
+ dahdi->t.dstfmt = (1 << dst);
+ dahdi->t.newpvt = dahdi_new;
+ dahdi->t.framein = dahdi_framein;
+ dahdi->t.frameout = dahdi_frameout;
+ dahdi->t.destroy = dahdi_destroy;
+ dahdi->t.sample = fakesrc_sample;
+ dahdi->t.useplc = global_useplc;
+ dahdi->t.buf_size = BUFFER_SAMPLES * 2;
+ dahdi->t.desc_size = sizeof(struct pvt);
+ if ((res = ast_register_translator(&dahdi->t))) {
+ ast_free(dahdi);
return -1;
}
AST_LIST_LOCK(&translators);
- AST_LIST_INSERT_HEAD(&translators, zt, entry);
+ AST_LIST_INSERT_HEAD(&translators, dahdi, entry);
AST_LIST_UNLOCK(&translators);
global_format_map.map[dst][src] = 1;
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
global_useplc = ast_true(var->value);
- ast_verb(3, "codec_zap: %susing generic PLC\n",
+ ast_verb(3, "codec_dahdi: %susing generic PLC\n",
global_useplc ? "" : "not ");
}
}
static int find_transcoders(void)
{
- struct zt_transcode_info info = { 0, };
+ struct dahdi_transcode_info info = { 0, };
struct format_map map = { { { 0 } } };
int fd, res;
unsigned int x, y;
- if ((fd = open("/dev/zap/transcode", O_RDWR)) < 0) {
+ if ((fd = open("/dev/dahdi/transcode", O_RDWR)) < 0) {
ast_verbose(VERBOSE_PREFIX_2 "No hardware transcoders found.\n");
return 0;
}
- info.op = ZT_TCOP_GETINFO;
- for (info.tcnum = 0; !(res = ioctl(fd, ZT_TRANSCODE_OP, &info)); info.tcnum++) {
+ info.op = DAHDI_TCOP_GETINFO;
+ for (info.tcnum = 0; !(res = ioctl(fd, DAHDI_TRANSCODE_OP, &info)); info.tcnum++) {
ast_verb(2, "Found transcoder '%s'.\n", info.name);
build_translators(&map, info.dstfmts, info.srcfmts);
ast_atomic_fetchadd_int(&channels.total, info.numchannels / 2);
return AST_MODULE_LOAD_SUCCESS;
}
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Generic Zaptel Transcoder Codec Translator",
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Generic DAHDI Transcoder Codec Translator",
.load = load_module,
.unload = unload_module,
.reload = reload,
globals {
CONSOLE="Console/dsp"; // Console interface for demo
- //CONSOLE=Zap/1
+ //CONSOLE=DAHDI/1
//CONSOLE=Phone/phone0
IAXINFO=guest; // IAXtel username/password
//IAXINFO="myuser:mypass";
- TRUNK="Zap/G2"; // Trunk interface
+ TRUNK="DAHDI/G2"; // Trunk interface
//
// Note the 'G2' in the TRUNK variable above. It specifies which group (defined
- // in zapata.conf) to dial, i.e. group 2, and how to choose a channel to use in
+ // in dahdi.conf) to dial, i.e. group 2, and how to choose a channel to use in
// the specified group. The four possible options are:
//
- // g: select the lowest-numbered non-busy Zap channel
+ // g: select the lowest-numbered non-busy DAHDI channel
// (aka. ascending sequential hunt group).
- // G: select the highest-numbered non-busy Zap channel
+ // G: select the highest-numbered non-busy DAHDI channel
// (aka. descending sequential hunt group).
// r: use a round-robin search, starting at the next highest channel than last
// time (aka. ascending rotary hunt group).
//
// If you are freely delivering calls to the PSTN, list them here
//
- //_1256428XXXX => Dial(Zap/G2/${EXTEN:7}); // Expose all of 256-428
- //_1256325XXXX => Dial(Zap/G2/${EXTEN:7}); // Ditto for 256-325
+ //_1256428XXXX => Dial(DAHDI/G2/${EXTEN:7}); // Expose all of 256-428
+ //_1256325XXXX => Dial(DAHDI/G2/${EXTEN:7}); // Ditto for 256-325
};
context ael-dundi-e164-local {
// 6389 => Dial(MGCP/aaln/1@192.168.0.14);
// 6394 => Dial(Local/6275/n); // this will dial ${MARK}
-// 6275 => &ael-stdexten(6275,${MARK}); // assuming ${MARK} is something like Zap/2
+// 6275 => &ael-stdexten(6275,${MARK}); // assuming ${MARK} is something like DAHDI/2
// mark => goto 6275|1; // alias mark to 6275
// 6536 => &ael-stdexten(6236,${WIL}); // Ditto for wil
// wil => goto 6236|1;
;
[globals]
CONSOLE=Console/dsp ; Console interface for demo
-;CONSOLE=Zap/1
+;CONSOLE=DAHDI/1
;CONSOLE=Phone/phone0
IAXINFO=guest ; IAXtel username/password
;IAXINFO=myuser:mypass
-TRUNK=Zap/G2 ; Trunk interface
+TRUNK=DAHDI/G2 ; Trunk interface
;
; Note the 'G2' in the TRUNK variable above. It specifies which group (defined
-; in zapata.conf) to dial, i.e. group 2, and how to choose a channel to use in
+; in dahdi.conf) to dial, i.e. group 2, and how to choose a channel to use in
; the specified group. The four possible options are:
;
-; g: select the lowest-numbered non-busy Zap channel
+; g: select the lowest-numbered non-busy DAHDI channel
; (aka. ascending sequential hunt group).
-; G: select the highest-numbered non-busy Zap channel
+; G: select the highest-numbered non-busy DAHDI channel
; (aka. descending sequential hunt group).
; r: use a round-robin search, starting at the next highest channel than last
; time (aka. ascending rotary hunt group).
;
; If you are freely delivering calls to the PSTN, list them here
;
-;exten => _1256428XXXX,1,Dial(Zap/G2/${EXTEN:7}) ; Expose all of 256-428
-;exten => _1256325XXXX,1,Dial(Zap/G2/${EXTEN:7}) ; Ditto for 256-325
+;exten => _1256428XXXX,1,Dial(DAHDI/G2/${EXTEN:7}) ; Expose all of 256-428
+;exten => _1256325XXXX,1,Dial(DAHDI/G2/${EXTEN:7}) ; Ditto for 256-325
[dundi-e164-local]
;
;exten => 6394,1,Dial(Local/6275/n) ; this will dial ${MARK}
;exten => 6275,1,Gosub(stdexten,s,1(6275,${MARK}))
- ; assuming ${MARK} is something like Zap/2
+ ; assuming ${MARK} is something like DAHDI/2
;exten => 6275,n,Goto(default,s,1) ; exited Voicemail
;exten => mark,1,Goto(6275|1) ; alias mark to 6275
;exten => 6536,1,Gosub(stdexten,s,1(6236,${WIL}))
CONSOLE = "Console/dsp" -- Console interface for demo
---CONSOLE = "Zap/1"
+--CONSOLE = "DAHDI/1"
--CONSOLE = "Phone/phone0"
IAXINFO = "guest" -- IAXtel username/password
--IAXINFO = "myuser:mypass"
-TRUNK = "Zap/G2"
+TRUNK = "DAHDI/G2"
TRUNKMSD = 1
-- TRUNK = "IAX2/user:pass@provider"
--
-- Dialplan applications can be accessed through the global 'app' table.
--
--- app.Dial("Zap/1")
--- app.dial("Zap/1")
+-- app.Dial("DAHDI/1")
+-- app.dial("DAHDI/1")
--
-- More examples can be found below.
--
--
function outgoing_local(c, e)
- app.dial("zap/1/" .. e, "", "")
+ app.dial("DAHDI/1/" .. e, "", "")
end
function demo_instruct()
[general]
;audiobuffers=32 ; The number of 20ms audio buffers to be used
- ; when feeding audio frames from non-Zap channels
+ ; when feeding audio frames from non-DAHDI channels
; into the conference; larger numbers will allow
; for the conference to 'de-jitter' audio that arrives
; at different timing than the conference's timing
#
# List each channel we're supposed to watch
#
-channel Zap/1
-channel Zap/2
+channel DAHDI/1
+channel DAHDI/2
channel SIP/mark
#
# Mute level is the percentage of the current volume we should
; must also preload pbx_config.so (or pbx_ael.so, pbx_lua.so, or
; pbx_realtime.so, depending on how your dialplan is configured).
;
-;member => Zap/1
-;member => Zap/2,10
-;member => Zap/3,10,Bob Johnson
+;member => DAHDI/1
+;member => DAHDI/2,10
+;member => DAHDI/3,10,Bob Johnson
;member => Agent/1001
;member => Agent/1002
;member => Local/1000@default,0,John Smith,SIP/1000
;[000] ; Node ID of first repeater
-;rxchannel = Zap/1 ; Rx audio/signalling channel
+;rxchannel = DAHDI/1 ; Rx audio/signalling channel
; Note: if you use a unified interface (tx/rx on one channel), only
; specify the rxchannel and the txchannel will be assumed from the rxchannel
-;txchannel = Zap/2 ; Tx audio/signalling channel
+;txchannel = DAHDI/2 ; Tx audio/signalling channel
;duplex = 2 ; (Optional) set duplex operating mode
;; 0 = half duplex (telemetry and courtesy tones do not transmit)
;; 1 = semi-half duplex (telemetry and courtesy tones transmit, but not
;[001] ; Node ID of first repeater
-;rxchannel = Zap/3 ; Rx audio/signalling channel
+;rxchannel = DAHDI/3 ; Rx audio/signalling channel
; Note: if you use a unified interface (tx/rx on one channel), only
; specify the rxchannel and the txchannel will be assumed from the rxchannel
-;txchannel = Zap/4 ; Tx audio/signalling channel
+;txchannel = DAHDI/4 ; Tx audio/signalling channel
;functions = functions-repeater ; DTMF function list
;; specify this for a different function list then local when on link
;;link_functions = functions-different ; DTMF function list for link
;[002] ; Node ID of remote base
-;rxchannel = Zap/5 ; Rx audio/signalling channel
+;rxchannel = DAHDI/5 ; Rx audio/signalling channel
; Note: if you use a unified interface (tx/rx on one channel), only
; specify the rxchannel and the txchannel will be assumed from the rxchannel
-;txchannel = Zap/6 ; Tx audio/signalling channel
+;txchannel = DAHDI/6 ; Tx audio/signalling channel
;functions = functions-remote
;remote = ft897 ; Set remote=y for dumb remote or
; remote=ft897 for Yaesu FT-897 or
;type=trunk ; This line is what marks this entry as a trunk.
-;device=Zap/3 ; Map this trunk declaration to a specific device.
+;device=DAHDI/3 ; Map this trunk declaration to a specific device.
; NOTE: You can not just put any type of channel here.
- ; Zap channels can be directly used. IP trunks
+ ; DAHDI channels can be directly used. IP trunks
; require some indirect configuration which is
; described in doc/asterisk.pdf.
;autocontext=line1 ; This supports automatic generation of the dialplan entries
; if the autocontext option is used. Each trunk should have
- ; a unique context name. Then, in zapata.conf, this device
+ ; a unique context name. Then, in dahdi.conf, this device
; should be configured to have incoming calls go to this context.
;ringtimeout=30 ; Set how long to allow this trunk to ring on an inbound call before hanging
;[line2]
;type=trunk
-;device=Zap/4
+;device=DAHDI/4
;autocontext=line2
;[line3]
;type=trunk
-;device=Zap/3
+;device=DAHDI/3
;autocontext=line3
;[line4]
[interfaces]
; Specify serial ports to listen for SMDI messages on below. These will be
-; referenced later in zapata.conf. If you do not specify any interfaces then
+; referenced later in dahdi.conf. If you do not specify any interfaces then
; SMDI will be disabled. Interfaces can have several different attributes
; associated with them.
;fullname = Joe User
;email = joe@foo.bar
;secret = 1234
-;zapchan = 1
+;dahdichan = 1
;hasvoicemail = yes
;vmsecret = 1234
;hassip = yes
;
; NOTE that other caller ID standards are supported in Asterisk, but are
; not yet active in chan_vpb. It should be reasonably trivial to add
-; support for the other standards (see the default zapata.conf for a list
+; support for the other standards (see the default dahdi.conf for a list
; of them) that Asterisk already handles.
;
callerid=bell
;
-; Zapata telephony interface
+; DAHDI telephony
;
; Configuration file
;
-; You need to restart Asterisk to re-configure the Zap channel
-; CLI> reload chan_zap.so
+; You need to restart Asterisk to re-configure the DAHDI channel
+; CLI> reload chan_dahdi.so
; will reload the configuration file,
; but not all configuration options are
; re-configured during a reload (signalling, as well as
; trunkgroup => <trunkgroup>,<dchannel>[,<backup1>...]
;
; trunkgroup is the numerical trunk group to create
-; dchannel is the zap channel which will have the
+; dchannel is the DAHDI channel which will have the
; d-channel for the trunk.
; backup1 is an optional list of backup d-channels.
;
;trunkgroup => 1,24
;
; Spanmap: Associates a span with a trunk group
-; spanmap => <zapspan>,<trunkgroup>[,<logicalspan>]
+; spanmap => <dahdispan>,<trunkgroup>[,<logicalspan>]
;
-; zapspan is the zap span number to associate
+; dahdispan is the DAHDI span number to associate
; trunkgroup is the trunkgroup (specified above) for the mapping
; logicalspan is the logical span number within the trunk group to use.
; if unspecified, no logical span number is used.
; pritimer cannot be changed on a reload.
;
; Signalling method. The default is "auto". Valid values:
-; auto: Use the current value from Zaptel.
+; auto: Use the current value from DAHDI.
; em: E & M
; em_e1: E & M E1
; em_w: E & M Wink
;
; A variety of timing parameters can be specified as well
; The default values for those are "-1", which is to use the
-; compile-time defaults of the Zaptel kernel modules. The timing
-; parameters, (with the standard default from Zaptel):
+; compile-time defaults of the DAHDI kernel modules. The timing
+; parameters, (with the standard default from DAHDI):
;
; prewink: Pre-wink time (default 50ms)
; preflash: Pre-flash time (default 50ms)
; first is the corresponding mailbox, and the second is 1 or 0, indicating if
; there are messages waiting or not.
;
-;mwimonitornotify=/usr/local/bin/zapnotify.sh
+;mwimonitornotify=/usr/local/bin/dahdinotify.sh
;
; Whether or not to enable call waiting on internal extensions
; With this set to 'yes', busy extensions will hear the call-waiting
; Note that when setting the number of taps, the number 256 does not translate
; to 256 ms of echo cancellation. echocancel=256 means 256 / 8 = 32 ms.
;
-; Note that if any of your Zaptel cards have hardware echo cancellers,
+; Note that if any of your DAHDI cards have hardware echo cancellers,
; then this setting only turns them on and off; numeric settings will
; be treated as "yes". There are no special settings required for
; hardware echo cancellers; when present and enabled in their kernel
; modules, they take precedence over the software echo canceller compiled
-; into Zaptel automatically.
+; into DAHDI automatically.
;
;
echocancel=yes
;
-; As of Zaptel 1.4.8, some Zaptel echo cancellers (software and hardware)
+; As of Zaptel 1.4.8, some DAHDI echo cancellers (software and hardware)
; support adjustable parameters; these parameters can be supplied as
; additional options to the 'echocancel' setting. Note that Asterisk
; does not attempt to validate the parameters or their values, so if you
; supply an invalid parameter you will not know the specific reason it
; failed without checking the kernel message log for the error(s)
-; put there by Zaptel.
+; put there by DAHDI.
;
;echocancel=128,param1=32,param2=0,param3=14
;
;
; In some cases, the echo canceller doesn't train quickly enough and there
; is echo at the beginning of the call. Enabling echo training will cause
-; Zaptel to briefly mute the channel, send an impulse, and use the impulse
+; DAHDI to briefly mute the channel, send an impulse, and use the impulse
; response to pre-train the echo canceller so it can start out with a much
; closer idea of the actual echo. Value may be "yes", "no", or a number of
; milliseconds to delay before training (default = 400)
;
;callerid = asreceived
;
-; should we use the caller ID from incoming call on zap transfer?
+; should we use the caller ID from incoming call on DAHDI transfer?
;
-;useincomingcalleridonzaptransfer = yes
+;useincomingcalleridondahditransfer = yes
;
; AMA flags affects the recording of Call Detail Records. If specified
; it may be 'default', 'omit', 'billing', or 'documentation'.
;progzone=uk
;
; Set the tonezone. Equivalent of the defaultzone settings in
-; /etc/zaptel.conf . This sets the tone zone by number.
-; Note that you'd still need to load tonezones (loadzone in zaptel.conf).
+; /etc/dahdi.conf . This sets the tone zone by number.
+; Note that you'd still need to load tonezones (loadzone in dahdi.conf).
; The default is -1: not to set anything.
;tonezone = 0 ; 0 is US
;
; FXO (FXS signalled) devices must have a timeout to determine if there was a
; hangup before the line was answered. This value can be tweaked to shorten
-; how long it takes before Zap considers a non-ringing line to have hungup.
+; how long it takes before DAHDI considers a non-ringing line to have hungup.
;
; ringtimeout will not update on a reload.
;
;mohsuggest=default
;
; PRI channels can have an idle extension and a minunused number. So long as
-; at least "minunused" channels are idle, chan_zap will try to call "idledial"
+; at least "minunused" channels are idle, chan_dahdi will try to call "idledial"
; on them, and then dump them into the PBX in the "idleext" extension (which
; is of the form exten@context). When channels are needed the "idle" calls
; are disconnected (so long as there are at least "minidle" calls still
;minunused=2
;minidle=1
;
-; Configure jitter buffers in Zapata (each one is 20ms, default is 4)
+; Configure jitter buffers in DAHDI (each one is 20ms, default is 4)
; This is set globally, rather than per-channel.
;
;jitterbuffers=4
;
;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a
- ; ZAP channel. Defaults to "no". An enabled jitterbuffer will
+ ; DAHDI channel. Defaults to "no". An enabled jitterbuffer will
; be used only if the sending side can create and the receiving
- ; side can not accept jitter. The ZAP channel can't accept jitter,
- ; thus an enabled jitterbuffer on the receive ZAP side will always
+ ; side can not accept jitter. The DAHDI channel can't accept jitter,
+ ; thus an enabled jitterbuffer on the receive DAHDI side will always
; be used if the sending side can create jitter.
; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds.
; big jumps in/broken timestamps, usually sent from exotic devices
; and programs. Defaults to 1000.
-; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a ZAP
+; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a DAHDI
; channel. Two implementations are currently available - "fixed"
; (with size always equals to jbmax-size) and "adaptive" (with
; variable size, actually the new jb of IAX2). Defaults to fixed.
; Configuration Sections
; ~~~~~~~~~~~~~~~~~~~~~~
-; You can also configure channels in a separate zapata.conf section. In
+; You can also configure channels in a separate dahdi.conf section. In
; this case the keyword 'channel' is not used. Instead the keyword
-; 'zapchan' is used (as in users.conf) - configuration is only processed
-; in a section where the keyword zapchan is used. It will only be
+; 'dahdichan' is used (as in users.conf) - configuration is only processed
+; in a section where the keyword dahdichan is used. It will only be
; processed in the end of the section. Thus the following section:
;
;[phones]
;echocancel = 64
-;zapchan = 1-8
+;dahdichan = 1-8
;group = 1
;
; Is somewhat equivalent to the following snippet in the section
;
; When starting a new section almost all of the configuration values are
; copied from their values at the end of the section [channels] in
-; zapata.conf and [general] in users.conf - one section's configuration
+; dahdi.conf and [general] in users.conf - one section's configuration
; does not affect another one's.
;
; Instead of letting common configuration values "slide through" you can
;faxdetect = incoming
;
;[phone-1](phones)
-;zapchan = 1
+;dahdichan = 1
;callerid = My Name <501>
;mailbox = 501@mailboxes
;
;
;[fax](phones)
-;zapchan = 2
+;dahdichan = 2
;faxdetect = no
;context = fax
;
;[phone-3](phones)
-;zapchan = 3
+;dahdichan = 3
;pickupgroup = 3,4
#! /bin/sh
-# From configure.ac Revision: 119826 .
+# From configure.ac Revision: 118608 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for asterisk 1.6.
#
CRYPTO_INCLUDE
CRYPTO_DIR
PBX_CRYPTO
+DAHDI_LIB
+DAHDI_INCLUDE
+DAHDI_DIR
+PBX_DAHDI
FFMPEG_LIB
FFMPEG_INCLUDE
FFMPEG_DIR
PRI_INCLUDE
PRI_DIR
PBX_PRI
-SPANDSP_LIB
-SPANDSP_INCLUDE
-SPANDSP_DIR
-PBX_SPANDSP
SS7_LIB
SS7_INCLUDE
SS7_DIR
SDL_IMAGE_INCLUDE
SDL_IMAGE_DIR
PBX_SDL_IMAGE
-SACLM_LIB
-SACLM_INCLUDE
-SACLM_DIR
-PBX_SACLM
-SAEVT_LIB
-SAEVT_INCLUDE
-SAEVT_DIR
-PBX_SAEVT
SPEEX_LIB
SPEEX_INCLUDE
SPEEX_DIR
ZLIB_INCLUDE
ZLIB_DIR
PBX_ZLIB
-ZAPTEL_LIB
-ZAPTEL_INCLUDE
-ZAPTEL_DIR
-PBX_ZAPTEL
ALLOCA
LIBOBJS
POW_LIB
OPENH323_BUILD
PBX_SPEEX_PREPROCESS
CONFIG_GMIME
-PBX_ZAPTEL_VLDTMF
-PBX_ZAPTEL_ECHOCANPARAMS
-PBX_ZAPTEL_TRANSCODE
-PBX_ZAPTEL_HWGAIN
-PBX_ZAPTEL_NEONMWI
-PBX_ZAPTEL_SIG_MTP2
EDITLINE_LIB
PBX_H323
PBX_IXJUSER
--with-curl=PATH use cURL files in PATH
--with-curses=PATH use curses files in PATH
--with-crypto=PATH use OpenSSL Cryptography support files in PATH
+ --with-dahdi=PATH use DAHDI files in PATH
--with-avcodec=PATH use Ffmpeg and avcodec library files in PATH
--with-gsm=PATH use External GSM library files in PATH , use
'internal' GSM otherwise
--with-popt=PATH use popt files in PATH
--with-portaudio=PATH use PortAudio files in PATH
--with-pri=PATH use ISDN PRI files in PATH
- --with-spandsp=PATH use SPANDSP files in PATH
--with-ss7=PATH use ISDN SS7 files in PATH
--with-pwlib=PATH use PWlib files in PATH
--with-h323=PATH use OpenH323 files in PATH
--with-radius=PATH use Radius Client files in PATH
--with-sdl=PATH use Sdl files in PATH
--with-SDL_image=PATH use Sdl Image library files in PATH
- --with-SaClm=PATH use SAForum AIS CLM files in PATH
- --with-SaEvt=PATH use SAForum AIS EVT files in PATH
--with-speex=PATH use Speex files in PATH
--with-speexdsp=PATH use Speexdsp files in PATH
--with-sqlite=PATH use SQLite files in PATH
--with-vpb=PATH use Voicetronix API files in PATH
--with-x11=PATH use X11 support files in PATH
--with-z=PATH use zlib files in PATH
- --with-zaptel=PATH use Zaptel files in PATH
Some influential environment variables:
CC C compiler command
+ DAHDI_DESCRIP="DAHDI"
+ DAHDI_OPTION="dahdi"
+
+# Check whether --with-dahdi was given.
+if test "${with_dahdi+set}" = set; then
+ withval=$with_dahdi;
+ case ${withval} in
+ n|no)
+ USE_DAHDI=no
+ ;;
+ y|ye|yes)
+ ac_mandatory_list="${ac_mandatory_list} DAHDI"
+ ;;
+ *)
+ DAHDI_DIR="${withval}"
+ ac_mandatory_list="${ac_mandatory_list} DAHDI"
+ ;;
+ esac
+
+fi
+
+ PBX_DAHDI=0
+
+
+
+
+
+
FFMPEG_DESCRIP="Ffmpeg and avcodec library"
FFMPEG_OPTION="avcodec"
- SPANDSP_DESCRIP="SPANDSP"
- SPANDSP_OPTION="spandsp"
-
-# Check whether --with-spandsp was given.
-if test "${with_spandsp+set}" = set; then
- withval=$with_spandsp;
- case ${withval} in
- n|no)
- USE_SPANDSP=no
- ;;
- y|ye|yes)
- ac_mandatory_list="${ac_mandatory_list} SPANDSP"
- ;;
- *)
- SPANDSP_DIR="${withval}"
- ac_mandatory_list="${ac_mandatory_list} SPANDSP"
- ;;
- esac
-
-fi
-
- PBX_SPANDSP=0
-
-
-
-
-
-
SS7_DESCRIP="ISDN SS7"
SS7_OPTION="ss7"
- SACLM_DESCRIP="SAForum AIS CLM"
- SACLM_OPTION="SaClm"
-
-# Check whether --with-SaClm was given.
-if test "${with_SaClm+set}" = set; then
- withval=$with_SaClm;
- case ${withval} in
- n|no)
- USE_SACLM=no
- ;;
- y|ye|yes)
- ac_mandatory_list="${ac_mandatory_list} SACLM"
- ;;
- *)
- SACLM_DIR="${withval}"
- ac_mandatory_list="${ac_mandatory_list} SACLM"
- ;;
- esac
-
-fi
-
- PBX_SACLM=0
-
-
-
-
-
-
- SAEVT_DESCRIP="SAForum AIS EVT"
- SAEVT_OPTION="SaEvt"
-
-# Check whether --with-SaEvt was given.
-if test "${with_SaEvt+set}" = set; then
- withval=$with_SaEvt;
- case ${withval} in
- n|no)
- USE_SAEVT=no
- ;;
- y|ye|yes)
- ac_mandatory_list="${ac_mandatory_list} SAEVT"
- ;;
- *)
- SAEVT_DIR="${withval}"
- ac_mandatory_list="${ac_mandatory_list} SAEVT"
- ;;
- esac
-
-fi
-
- PBX_SAEVT=0
-
-
-
-
-
-
SPEEX_DESCRIP="Speex"
SPEEX_OPTION="speex"
- ZAPTEL_DESCRIP="Zaptel"
- ZAPTEL_OPTION="zaptel"
-
-# Check whether --with-zaptel was given.
-if test "${with_zaptel+set}" = set; then
- withval=$with_zaptel;
- case ${withval} in
- n|no)
- USE_ZAPTEL=no
- ;;
- y|ye|yes)
- ac_mandatory_list="${ac_mandatory_list} ZAPTEL"
- ;;
- *)
- ZAPTEL_DIR="${withval}"
- ac_mandatory_list="${ac_mandatory_list} ZAPTEL"
- ;;
- esac
-
-fi
-
- PBX_ZAPTEL=0
-
-
-
-
-
-
# check for basic system features and functionality before
# checking for package libraries
fi
-# BSD might not have exp2, and/or log2
-if test "x${PBX_EXP2L}" != "x1" -a "${USE_EXP2L}" != "no"; then
- pbxlibdir=""
- # if --with-EXP2L=DIR has been specified, use it.
- if test "x${EXP2L_DIR}" != "x"; then
- if test -d ${EXP2L_DIR}/lib; then
- pbxlibdir="-L${EXP2L_DIR}/lib"
- else
- pbxlibdir="-L${EXP2L_DIR}"
- fi
- fi
- pbxfuncname="exp2l"
- if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_EXP2L_FOUND=yes
- else
- as_ac_Lib=`echo "ac_cv_lib_m_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lm" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lm... $ECHO_C" >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm ${pbxlibdir} $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+ if test "x${PBX_DAHDI}" != "x1"; then
+ { echo "$as_me:$LINENO: checking for DAHDI_CODE in dahdi/user.h" >&5
+echo $ECHO_N "checking for DAHDI_CODE in dahdi/user.h... $ECHO_C" >&6; }
+ saved_cppflags="${CPPFLAGS}"
+ if test "x${DAHDI_DIR}" != "x"; then
+ DAHDI_INCLUDE="-I${DAHDI_DIR}/include"
+ fi
+ CPPFLAGS="${CPPFLAGS} ${DAHDI_INCLUDE}"
+
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ${pbxfuncname} ();
+#include <dahdi/user.h>
int
main ()
{
-return ${pbxfuncname} ();
+#if defined(DAHDI_CODE)
+ int foo = 0;
+ #else
+ int foo = bar;
+ #endif
+ 0
+
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_Lib=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Lib=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-ac_res=`eval echo '${'$as_ac_Lib'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_EXP2L_FOUND=yes
-else
- AST_EXP2L_FOUND=no
-fi
-
- fi
-
- # now check for the header.
- if test "${AST_EXP2L_FOUND}" = "yes"; then
- EXP2L_LIB="${pbxlibdir} -lm "
- # if --with-EXP2L=DIR has been specified, use it.
- if test "x${EXP2L_DIR}" != "x"; then
- EXP2L_INCLUDE="-I${EXP2L_DIR}/include"
- fi
- EXP2L_INCLUDE="${EXP2L_INCLUDE} "
- if test "x" = "x" ; then # no header, assume found
- EXP2L_HEADER_FOUND="1"
- else # check for the header
- saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${EXP2L_INCLUDE} "
- if test "${ac_cv_header_+set}" = set; then
- { echo "$as_me:$LINENO: checking for " >&5
-echo $ECHO_N "checking for ... $ECHO_C" >&6; }
-if test "${ac_cv_header_+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
-echo "${ECHO_T}$ac_cv_header_" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking usability" >&5
-echo $ECHO_N "checking usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <>
-_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ PBX_DAHDI=1
- ac_header_compiler=no
-fi
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DAHDI 1
+_ACEOF
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-# Is the header present?
-{ echo "$as_me:$LINENO: checking presence" >&5
-echo $ECHO_N "checking presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <>
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DAHDI_VERSION
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
+
+
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5
-echo "$as_me: WARNING: : present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5
-echo "$as_me: WARNING: : see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for " >&5
-echo $ECHO_N "checking for ... $ECHO_C" >&6; }
-if test "${ac_cv_header_+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
-echo "${ECHO_T}$ac_cv_header_" >&6; }
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
-fi
-if test $ac_cv_header_ = yes; then
- EXP2L_HEADER_FOUND=1
-else
- EXP2L_HEADER_FOUND=0
fi
-
- CPPFLAGS="${saved_cppflags}"
- fi
- if test "x${EXP2L_HEADER_FOUND}" = "x0" ; then
- EXP2L_LIB=""
- EXP2L_INCLUDE=""
- else
- if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- EXP2L_LIB=""
- fi
- PBX_EXP2L=1
- # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_EXP2L 1
-_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="${saved_cppflags}"
+ fi
-cat >>confdefs.h <<_ACEOF
-#define HAVE_EXP2L_VERSION
-_ACEOF
-
- fi
- fi
-fi
+# BSD might not have exp2, and/or log2
-if test "x${PBX_LOG2L}" != "x1" -a "${USE_LOG2L}" != "no"; then
+if test "x${PBX_EXP2L}" != "x1" -a "${USE_EXP2L}" != "no"; then
pbxlibdir=""
- # if --with-LOG2L=DIR has been specified, use it.
- if test "x${LOG2L_DIR}" != "x"; then
- if test -d ${LOG2L_DIR}/lib; then
- pbxlibdir="-L${LOG2L_DIR}/lib"
+ # if --with-EXP2L=DIR has been specified, use it.
+ if test "x${EXP2L_DIR}" != "x"; then
+ if test -d ${EXP2L_DIR}/lib; then
+ pbxlibdir="-L${EXP2L_DIR}/lib"
else
- pbxlibdir="-L${LOG2L_DIR}"
+ pbxlibdir="-L${EXP2L_DIR}"
fi
fi
- pbxfuncname="log2l"
+ pbxfuncname="exp2l"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_LOG2L_FOUND=yes
+ AST_EXP2L_FOUND=yes
+ else
+ as_ac_Lib=`echo "ac_cv_lib_m_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lm" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lm... $ECHO_C" >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm ${pbxlibdir} $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ${pbxfuncname} ();
+int
+main ()
+{
+return ${pbxfuncname} ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Lib=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+ac_res=`eval echo '${'$as_ac_Lib'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ AST_EXP2L_FOUND=yes
+else
+ AST_EXP2L_FOUND=no
+fi
+
+ fi
+
+ # now check for the header.
+ if test "${AST_EXP2L_FOUND}" = "yes"; then
+ EXP2L_LIB="${pbxlibdir} -lm "
+ # if --with-EXP2L=DIR has been specified, use it.
+ if test "x${EXP2L_DIR}" != "x"; then
+ EXP2L_INCLUDE="-I${EXP2L_DIR}/include"
+ fi
+ EXP2L_INCLUDE="${EXP2L_INCLUDE} "
+ if test "x" = "x" ; then # no header, assume found
+ EXP2L_HEADER_FOUND="1"
+ else # check for the header
+ saved_cppflags="${CPPFLAGS}"
+ CPPFLAGS="${CPPFLAGS} ${EXP2L_INCLUDE} "
+ if test "${ac_cv_header_+set}" = set; then
+ { echo "$as_me:$LINENO: checking for " >&5
+echo $ECHO_N "checking for ... $ECHO_C" >&6; }
+if test "${ac_cv_header_+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
+echo "${ECHO_T}$ac_cv_header_" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking usability" >&5
+echo $ECHO_N "checking usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking presence" >&5
+echo $ECHO_N "checking presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5
+echo "$as_me: WARNING: : present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5
+echo "$as_me: WARNING: : see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ------------------------------- ##
+## Report this to www.asterisk.org ##
+## ------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for " >&5
+echo $ECHO_N "checking for ... $ECHO_C" >&6; }
+if test "${ac_cv_header_+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
+echo "${ECHO_T}$ac_cv_header_" >&6; }
+
+fi
+if test $ac_cv_header_ = yes; then
+ EXP2L_HEADER_FOUND=1
+else
+ EXP2L_HEADER_FOUND=0
+fi
+
+
+ CPPFLAGS="${saved_cppflags}"
+ fi
+ if test "x${EXP2L_HEADER_FOUND}" = "x0" ; then
+ EXP2L_LIB=""
+ EXP2L_INCLUDE=""
+ else
+ if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
+ EXP2L_LIB=""
+ fi
+ PBX_EXP2L=1
+ # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_EXP2L 1
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_EXP2L_VERSION
+_ACEOF
+
+ fi
+ fi
+fi
+
+
+if test "x${PBX_LOG2L}" != "x1" -a "${USE_LOG2L}" != "no"; then
+ pbxlibdir=""
+ # if --with-LOG2L=DIR has been specified, use it.
+ if test "x${LOG2L_DIR}" != "x"; then
+ if test -d ${LOG2L_DIR}/lib; then
+ pbxlibdir="-L${LOG2L_DIR}/lib"
+ else
+ pbxlibdir="-L${LOG2L_DIR}"
+ fi
+ fi
+ pbxfuncname="log2l"
+ if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
+ AST_LOG2L_FOUND=yes
else
as_ac_Lib=`echo "ac_cv_lib_m_${pbxfuncname}" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lm" >&5
- if test "x${PBX_SPANDSP}" != "x1" -a "${USE_SPANDSP}" != "no"; then
- { echo "$as_me:$LINENO: checking if \"
- #if SPANDSP_RELEASE_DATE < 20080516
- #error \"spandsp 0.0.5 or greater is required\"
- #endif
- \" compiles using spandsp/version.h" >&5
-echo $ECHO_N "checking if \"
- #if SPANDSP_RELEASE_DATE < 20080516
- #error \"spandsp 0.0.5 or greater is required\"
- #endif
- \" compiles using spandsp/version.h... $ECHO_C" >&6; }
- saved_cppflags="${CPPFLAGS}"
- if test "x${SPANDSP_DIR}" != "x"; then
- SPANDSP_INCLUDE="-I${SPANDSP_DIR}/include"
- fi
- CPPFLAGS="${CPPFLAGS} ${SPANDSP_INCLUDE}"
-
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <spandsp/version.h>
-int
-main ()
-{
-
- #if SPANDSP_RELEASE_DATE < 20080516
- #error "spandsp 0.0.5 or greater is required"
- #endif
- ;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- PBX_SPANDSP=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SPANDSP 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SPANDSP_VERSION
-_ACEOF
-
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CPPFLAGS="${saved_cppflags}"
- fi
-
-
-if test "x${PBX_SPANDSP}" = "x1" ; then
- # We found the correct version in the header, now let's make sure it links
- # properly, and that libtiff is available
- PBX_SPANDSP=0
-
-if test "x${PBX_SPANDSP}" != "x1" -a "${USE_SPANDSP}" != "no"; then
- pbxlibdir=""
- # if --with-SPANDSP=DIR has been specified, use it.
- if test "x${SPANDSP_DIR}" != "x"; then
- if test -d ${SPANDSP_DIR}/lib; then
- pbxlibdir="-L${SPANDSP_DIR}/lib"
- else
- pbxlibdir="-L${SPANDSP_DIR}"
- fi
- fi
- pbxfuncname="span_set_message_handler"
- if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_SPANDSP_FOUND=yes
- else
- as_ac_Lib=`echo "ac_cv_lib_spandsp_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lspandsp" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lspandsp... $ECHO_C" >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lspandsp ${pbxlibdir} -ltiff $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ${pbxfuncname} ();
-int
-main ()
-{
-return ${pbxfuncname} ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_Lib=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Lib=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-ac_res=`eval echo '${'$as_ac_Lib'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_SPANDSP_FOUND=yes
-else
- AST_SPANDSP_FOUND=no
-fi
-
- fi
-
- # now check for the header.
- if test "${AST_SPANDSP_FOUND}" = "yes"; then
- SPANDSP_LIB="${pbxlibdir} -lspandsp -ltiff"
- # if --with-SPANDSP=DIR has been specified, use it.
- if test "x${SPANDSP_DIR}" != "x"; then
- SPANDSP_INCLUDE="-I${SPANDSP_DIR}/include"
- fi
- SPANDSP_INCLUDE="${SPANDSP_INCLUDE} "
- if test "xspandsp.h" = "x" ; then # no header, assume found
- SPANDSP_HEADER_FOUND="1"
- else # check for the header
- saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${SPANDSP_INCLUDE} "
- if test "${ac_cv_header_spandsp_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for spandsp.h" >&5
-echo $ECHO_N "checking for spandsp.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_spandsp_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_spandsp_h" >&5
-echo "${ECHO_T}$ac_cv_header_spandsp_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking spandsp.h usability" >&5
-echo $ECHO_N "checking spandsp.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <spandsp.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking spandsp.h presence" >&5
-echo $ECHO_N "checking spandsp.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <spandsp.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: spandsp.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: spandsp.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: spandsp.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: spandsp.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: spandsp.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: spandsp.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: spandsp.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: spandsp.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: spandsp.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: spandsp.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: spandsp.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: spandsp.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: spandsp.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: spandsp.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: spandsp.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: spandsp.h: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for spandsp.h" >&5
-echo $ECHO_N "checking for spandsp.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_spandsp_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_spandsp_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_spandsp_h" >&5
-echo "${ECHO_T}$ac_cv_header_spandsp_h" >&6; }
-
-fi
-if test $ac_cv_header_spandsp_h = yes; then
- SPANDSP_HEADER_FOUND=1
-else
- SPANDSP_HEADER_FOUND=0
-fi
-
-
- CPPFLAGS="${saved_cppflags}"
- fi
- if test "x${SPANDSP_HEADER_FOUND}" = "x0" ; then
- SPANDSP_LIB=""
- SPANDSP_INCLUDE=""
- else
- if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- SPANDSP_LIB=""
- fi
- PBX_SPANDSP=1
- # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SPANDSP 1
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SPANDSP_VERSION
-_ACEOF
-
- fi
- fi
-fi
-
-fi
-
-
if test "x${PBX_SS7}" != "x1" -a "${USE_SS7}" != "no"; then
pbxlibdir=""
# if --with-SS7=DIR has been specified, use it.
-if test "x${PBX_SACLM}" != "x1" -a "${USE_SACLM}" != "no"; then
+if test "x${PBX_SPEEX}" != "x1" -a "${USE_SPEEX}" != "no"; then
pbxlibdir=""
- # if --with-SACLM=DIR has been specified, use it.
- if test "x${SACLM_DIR}" != "x"; then
- if test -d ${SACLM_DIR}/lib; then
- pbxlibdir="-L${SACLM_DIR}/lib"
+ # if --with-SPEEX=DIR has been specified, use it.
+ if test "x${SPEEX_DIR}" != "x"; then
+ if test -d ${SPEEX_DIR}/lib; then
+ pbxlibdir="-L${SPEEX_DIR}/lib"
else
- pbxlibdir="-L${SACLM_DIR}"
+ pbxlibdir="-L${SPEEX_DIR}"
fi
fi
- pbxfuncname="saClmInitialize"
+ pbxfuncname="speex_encode"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_SACLM_FOUND=yes
+ AST_SPEEX_FOUND=yes
else
- as_ac_Lib=`echo "ac_cv_lib_SaClm_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lSaClm" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lSaClm... $ECHO_C" >&6; }
+ as_ac_Lib=`echo "ac_cv_lib_speex_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lspeex" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lspeex... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lSaClm ${pbxlibdir} $LIBS"
+LIBS="-lspeex ${pbxlibdir} -lm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_SACLM_FOUND=yes
+ AST_SPEEX_FOUND=yes
else
- AST_SACLM_FOUND=no
+ AST_SPEEX_FOUND=no
fi
fi
# now check for the header.
- if test "${AST_SACLM_FOUND}" = "yes"; then
- SACLM_LIB="${pbxlibdir} -lSaClm "
- # if --with-SACLM=DIR has been specified, use it.
- if test "x${SACLM_DIR}" != "x"; then
- SACLM_INCLUDE="-I${SACLM_DIR}/include"
- fi
- SACLM_INCLUDE="${SACLM_INCLUDE} "
- if test "xopenais/saClm.h" = "x" ; then # no header, assume found
- SACLM_HEADER_FOUND="1"
+ if test "${AST_SPEEX_FOUND}" = "yes"; then
+ SPEEX_LIB="${pbxlibdir} -lspeex -lm"
+ # if --with-SPEEX=DIR has been specified, use it.
+ if test "x${SPEEX_DIR}" != "x"; then
+ SPEEX_INCLUDE="-I${SPEEX_DIR}/include"
+ fi
+ SPEEX_INCLUDE="${SPEEX_INCLUDE} "
+ if test "xspeex/speex.h" = "x" ; then # no header, assume found
+ SPEEX_HEADER_FOUND="1"
else # check for the header
saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${SACLM_INCLUDE} "
- if test "${ac_cv_header_openais_saClm_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for openais/saClm.h" >&5
-echo $ECHO_N "checking for openais/saClm.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_openais_saClm_h+set}" = set; then
+ CPPFLAGS="${CPPFLAGS} ${SPEEX_INCLUDE} "
+ if test "${ac_cv_header_speex_speex_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for speex/speex.h" >&5
+echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_speex_speex_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_openais_saClm_h" >&5
-echo "${ECHO_T}$ac_cv_header_openais_saClm_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_speex_speex_h" >&5
+echo "${ECHO_T}$ac_cv_header_speex_speex_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking openais/saClm.h usability" >&5
-echo $ECHO_N "checking openais/saClm.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking speex/speex.h usability" >&5
+echo $ECHO_N "checking speex/speex.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <openais/saClm.h>
+#include <speex/speex.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking openais/saClm.h presence" >&5
-echo $ECHO_N "checking openais/saClm.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking speex/speex.h presence" >&5
+echo $ECHO_N "checking speex/speex.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <openais/saClm.h>
+#include <speex/speex.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: openais/saClm.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: openais/saClm.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: openais/saClm.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: openais/saClm.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: speex/speex.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: openais/saClm.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: openais/saClm.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: openais/saClm.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: openais/saClm.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: openais/saClm.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: openais/saClm.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: openais/saClm.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: openais/saClm.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: openais/saClm.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: openais/saClm.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: openais/saClm.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: openais/saClm.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: speex/speex.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: speex/speex.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: speex/speex.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: speex/speex.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: speex/speex.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: speex/speex.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------- ##
## Report this to www.asterisk.org ##
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for openais/saClm.h" >&5
-echo $ECHO_N "checking for openais/saClm.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_openais_saClm_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for speex/speex.h" >&5
+echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_speex_speex_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_header_openais_saClm_h=$ac_header_preproc
+ ac_cv_header_speex_speex_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_openais_saClm_h" >&5
-echo "${ECHO_T}$ac_cv_header_openais_saClm_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_speex_speex_h" >&5
+echo "${ECHO_T}$ac_cv_header_speex_speex_h" >&6; }
fi
-if test $ac_cv_header_openais_saClm_h = yes; then
- SACLM_HEADER_FOUND=1
+if test $ac_cv_header_speex_speex_h = yes; then
+ SPEEX_HEADER_FOUND=1
else
- SACLM_HEADER_FOUND=0
+ SPEEX_HEADER_FOUND=0
fi
CPPFLAGS="${saved_cppflags}"
fi
- if test "x${SACLM_HEADER_FOUND}" = "x0" ; then
- SACLM_LIB=""
- SACLM_INCLUDE=""
+ if test "x${SPEEX_HEADER_FOUND}" = "x0" ; then
+ SPEEX_LIB=""
+ SPEEX_INCLUDE=""
else
if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- SACLM_LIB=""
+ SPEEX_LIB=""
fi
- PBX_SACLM=1
+ PBX_SPEEX=1
# XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
cat >>confdefs.h <<_ACEOF
-#define HAVE_SACLM 1
+#define HAVE_SPEEX 1
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define HAVE_SACLM_VERSION
+#define HAVE_SPEEX_VERSION
_ACEOF
fi
fi
-if test "x${PBX_SAEVT}" != "x1" -a "${USE_SAEVT}" != "no"; then
+# See if the main speex library contains the preprocess functions
+
+if test "x${PBX_SPEEX_PREPROCESS}" != "x1" -a "${USE_SPEEX_PREPROCESS}" != "no"; then
pbxlibdir=""
- # if --with-SAEVT=DIR has been specified, use it.
- if test "x${SAEVT_DIR}" != "x"; then
- if test -d ${SAEVT_DIR}/lib; then
- pbxlibdir="-L${SAEVT_DIR}/lib"
+ # if --with-SPEEX_PREPROCESS=DIR has been specified, use it.
+ if test "x${SPEEX_PREPROCESS_DIR}" != "x"; then
+ if test -d ${SPEEX_PREPROCESS_DIR}/lib; then
+ pbxlibdir="-L${SPEEX_PREPROCESS_DIR}/lib"
else
- pbxlibdir="-L${SAEVT_DIR}"
+ pbxlibdir="-L${SPEEX_PREPROCESS_DIR}"
fi
fi
- pbxfuncname="saEvtInitialize"
+ pbxfuncname="speex_preprocess_ctl"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_SAEVT_FOUND=yes
+ AST_SPEEX_PREPROCESS_FOUND=yes
else
- as_ac_Lib=`echo "ac_cv_lib_SaEvt_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lSaEvt" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lSaEvt... $ECHO_C" >&6; }
+ as_ac_Lib=`echo "ac_cv_lib_speex_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lspeex" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lspeex... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lSaEvt ${pbxlibdir} $LIBS"
+LIBS="-lspeex ${pbxlibdir} -lm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_SAEVT_FOUND=yes
+ AST_SPEEX_PREPROCESS_FOUND=yes
else
- AST_SAEVT_FOUND=no
+ AST_SPEEX_PREPROCESS_FOUND=no
fi
fi
# now check for the header.
- if test "${AST_SAEVT_FOUND}" = "yes"; then
- SAEVT_LIB="${pbxlibdir} -lSaEvt "
- # if --with-SAEVT=DIR has been specified, use it.
- if test "x${SAEVT_DIR}" != "x"; then
- SAEVT_INCLUDE="-I${SAEVT_DIR}/include"
- fi
- SAEVT_INCLUDE="${SAEVT_INCLUDE} "
- if test "xopenais/saEvt.h" = "x" ; then # no header, assume found
- SAEVT_HEADER_FOUND="1"
+ if test "${AST_SPEEX_PREPROCESS_FOUND}" = "yes"; then
+ SPEEX_PREPROCESS_LIB="${pbxlibdir} -lspeex -lm"
+ # if --with-SPEEX_PREPROCESS=DIR has been specified, use it.
+ if test "x${SPEEX_PREPROCESS_DIR}" != "x"; then
+ SPEEX_PREPROCESS_INCLUDE="-I${SPEEX_PREPROCESS_DIR}/include"
+ fi
+ SPEEX_PREPROCESS_INCLUDE="${SPEEX_PREPROCESS_INCLUDE} "
+ if test "xspeex/speex.h" = "x" ; then # no header, assume found
+ SPEEX_PREPROCESS_HEADER_FOUND="1"
else # check for the header
saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${SAEVT_INCLUDE} "
- if test "${ac_cv_header_openais_saEvt_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for openais/saEvt.h" >&5
-echo $ECHO_N "checking for openais/saEvt.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_openais_saEvt_h+set}" = set; then
+ CPPFLAGS="${CPPFLAGS} ${SPEEX_PREPROCESS_INCLUDE} "
+ if test "${ac_cv_header_speex_speex_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for speex/speex.h" >&5
+echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_speex_speex_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_openais_saEvt_h" >&5
-echo "${ECHO_T}$ac_cv_header_openais_saEvt_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_speex_speex_h" >&5
+echo "${ECHO_T}$ac_cv_header_speex_speex_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking openais/saEvt.h usability" >&5
-echo $ECHO_N "checking openais/saEvt.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking speex/speex.h usability" >&5
+echo $ECHO_N "checking speex/speex.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <openais/saEvt.h>
+#include <speex/speex.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking openais/saEvt.h presence" >&5
-echo $ECHO_N "checking openais/saEvt.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking speex/speex.h presence" >&5
+echo $ECHO_N "checking speex/speex.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <openais/saEvt.h>
+#include <speex/speex.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: openais/saEvt.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: openais/saEvt.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: openais/saEvt.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: openais/saEvt.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: speex/speex.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: openais/saEvt.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: openais/saEvt.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: openais/saEvt.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: openais/saEvt.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: openais/saEvt.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: openais/saEvt.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: openais/saEvt.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: openais/saEvt.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: openais/saEvt.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: openais/saEvt.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: openais/saEvt.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: openais/saEvt.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: speex/speex.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: speex/speex.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: speex/speex.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: speex/speex.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: speex/speex.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: speex/speex.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: speex/speex.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------- ##
## Report this to www.asterisk.org ##
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for openais/saEvt.h" >&5
-echo $ECHO_N "checking for openais/saEvt.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_openais_saEvt_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for speex/speex.h" >&5
+echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_speex_speex_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_header_openais_saEvt_h=$ac_header_preproc
+ ac_cv_header_speex_speex_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_openais_saEvt_h" >&5
-echo "${ECHO_T}$ac_cv_header_openais_saEvt_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_speex_speex_h" >&5
+echo "${ECHO_T}$ac_cv_header_speex_speex_h" >&6; }
fi
-if test $ac_cv_header_openais_saEvt_h = yes; then
- SAEVT_HEADER_FOUND=1
+if test $ac_cv_header_speex_speex_h = yes; then
+ SPEEX_PREPROCESS_HEADER_FOUND=1
else
- SAEVT_HEADER_FOUND=0
+ SPEEX_PREPROCESS_HEADER_FOUND=0
fi
CPPFLAGS="${saved_cppflags}"
fi
- if test "x${SAEVT_HEADER_FOUND}" = "x0" ; then
- SAEVT_LIB=""
- SAEVT_INCLUDE=""
+ if test "x${SPEEX_PREPROCESS_HEADER_FOUND}" = "x0" ; then
+ SPEEX_PREPROCESS_LIB=""
+ SPEEX_PREPROCESS_INCLUDE=""
else
if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- SAEVT_LIB=""
+ SPEEX_PREPROCESS_LIB=""
fi
- PBX_SAEVT=1
+ PBX_SPEEX_PREPROCESS=1
# XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
cat >>confdefs.h <<_ACEOF
-#define HAVE_SAEVT 1
+#define HAVE_SPEEX_PREPROCESS 1
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define HAVE_SAEVT_VERSION
+#define HAVE_SPEEX_PREPROCESS_VERSION
_ACEOF
fi
fi
fi
+if test "${PBX_SPEEX_PREPROCESS}" = 1; then
+ PBX_SPEEX_PREPROCESS=1
+fi
-if test "x${PBX_SPEEX}" != "x1" -a "${USE_SPEEX}" != "no"; then
+if test "x${PBX_SPEEXDSP}" != "x1" -a "${USE_SPEEXDSP}" != "no"; then
pbxlibdir=""
- # if --with-SPEEX=DIR has been specified, use it.
- if test "x${SPEEX_DIR}" != "x"; then
- if test -d ${SPEEX_DIR}/lib; then
- pbxlibdir="-L${SPEEX_DIR}/lib"
+ # if --with-SPEEXDSP=DIR has been specified, use it.
+ if test "x${SPEEXDSP_DIR}" != "x"; then
+ if test -d ${SPEEXDSP_DIR}/lib; then
+ pbxlibdir="-L${SPEEXDSP_DIR}/lib"
else
- pbxlibdir="-L${SPEEX_DIR}"
+ pbxlibdir="-L${SPEEXDSP_DIR}"
fi
fi
- pbxfuncname="speex_encode"
+ pbxfuncname="speex_preprocess_ctl"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_SPEEX_FOUND=yes
+ AST_SPEEXDSP_FOUND=yes
else
- as_ac_Lib=`echo "ac_cv_lib_speex_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lspeex" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lspeex... $ECHO_C" >&6; }
+ as_ac_Lib=`echo "ac_cv_lib_speexdsp_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lspeexdsp" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lspeexdsp... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lspeex ${pbxlibdir} -lm $LIBS"
+LIBS="-lspeexdsp ${pbxlibdir} -lm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_SPEEX_FOUND=yes
+ AST_SPEEXDSP_FOUND=yes
else
- AST_SPEEX_FOUND=no
+ AST_SPEEXDSP_FOUND=no
fi
fi
# now check for the header.
- if test "${AST_SPEEX_FOUND}" = "yes"; then
- SPEEX_LIB="${pbxlibdir} -lspeex -lm"
- # if --with-SPEEX=DIR has been specified, use it.
- if test "x${SPEEX_DIR}" != "x"; then
- SPEEX_INCLUDE="-I${SPEEX_DIR}/include"
+ if test "${AST_SPEEXDSP_FOUND}" = "yes"; then
+ SPEEXDSP_LIB="${pbxlibdir} -lspeexdsp -lm"
+ # if --with-SPEEXDSP=DIR has been specified, use it.
+ if test "x${SPEEXDSP_DIR}" != "x"; then
+ SPEEXDSP_INCLUDE="-I${SPEEXDSP_DIR}/include"
fi
- SPEEX_INCLUDE="${SPEEX_INCLUDE} "
+ SPEEXDSP_INCLUDE="${SPEEXDSP_INCLUDE} "
if test "xspeex/speex.h" = "x" ; then # no header, assume found
- SPEEX_HEADER_FOUND="1"
+ SPEEXDSP_HEADER_FOUND="1"
else # check for the header
saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${SPEEX_INCLUDE} "
+ CPPFLAGS="${CPPFLAGS} ${SPEEXDSP_INCLUDE} "
if test "${ac_cv_header_speex_speex_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for speex/speex.h" >&5
echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
fi
if test $ac_cv_header_speex_speex_h = yes; then
- SPEEX_HEADER_FOUND=1
+ SPEEXDSP_HEADER_FOUND=1
else
- SPEEX_HEADER_FOUND=0
+ SPEEXDSP_HEADER_FOUND=0
fi
CPPFLAGS="${saved_cppflags}"
fi
- if test "x${SPEEX_HEADER_FOUND}" = "x0" ; then
- SPEEX_LIB=""
- SPEEX_INCLUDE=""
+ if test "x${SPEEXDSP_HEADER_FOUND}" = "x0" ; then
+ SPEEXDSP_LIB=""
+ SPEEXDSP_INCLUDE=""
else
if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- SPEEX_LIB=""
+ SPEEXDSP_LIB=""
fi
- PBX_SPEEX=1
+ PBX_SPEEXDSP=1
# XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
cat >>confdefs.h <<_ACEOF
-#define HAVE_SPEEX 1
+#define HAVE_SPEEXDSP 1
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define HAVE_SPEEX_VERSION
+#define HAVE_SPEEXDSP_VERSION
_ACEOF
fi
fi
fi
+if test "${PBX_SPEEXDSP}" = 1; then
+ PBX_SPEEX_PREPROCESS=1
+fi
-# See if the main speex library contains the preprocess functions
-if test "x${PBX_SPEEX_PREPROCESS}" != "x1" -a "${USE_SPEEX_PREPROCESS}" != "no"; then
+
+
+if test "x${PBX_SQLITE}" != "x1" -a "${USE_SQLITE}" != "no"; then
pbxlibdir=""
- # if --with-SPEEX_PREPROCESS=DIR has been specified, use it.
- if test "x${SPEEX_PREPROCESS_DIR}" != "x"; then
- if test -d ${SPEEX_PREPROCESS_DIR}/lib; then
- pbxlibdir="-L${SPEEX_PREPROCESS_DIR}/lib"
+ # if --with-SQLITE=DIR has been specified, use it.
+ if test "x${SQLITE_DIR}" != "x"; then
+ if test -d ${SQLITE_DIR}/lib; then
+ pbxlibdir="-L${SQLITE_DIR}/lib"
else
- pbxlibdir="-L${SPEEX_PREPROCESS_DIR}"
+ pbxlibdir="-L${SQLITE_DIR}"
fi
fi
- pbxfuncname="speex_preprocess_ctl"
+ pbxfuncname="sqlite_exec"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_SPEEX_PREPROCESS_FOUND=yes
+ AST_SQLITE_FOUND=yes
else
- as_ac_Lib=`echo "ac_cv_lib_speex_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lspeex" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lspeex... $ECHO_C" >&6; }
+ as_ac_Lib=`echo "ac_cv_lib_sqlite_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lsqlite" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lsqlite... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lspeex ${pbxlibdir} -lm $LIBS"
+LIBS="-lsqlite ${pbxlibdir} $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_SPEEX_PREPROCESS_FOUND=yes
+ AST_SQLITE_FOUND=yes
else
- AST_SPEEX_PREPROCESS_FOUND=no
+ AST_SQLITE_FOUND=no
fi
fi
# now check for the header.
- if test "${AST_SPEEX_PREPROCESS_FOUND}" = "yes"; then
- SPEEX_PREPROCESS_LIB="${pbxlibdir} -lspeex -lm"
- # if --with-SPEEX_PREPROCESS=DIR has been specified, use it.
- if test "x${SPEEX_PREPROCESS_DIR}" != "x"; then
- SPEEX_PREPROCESS_INCLUDE="-I${SPEEX_PREPROCESS_DIR}/include"
+ if test "${AST_SQLITE_FOUND}" = "yes"; then
+ SQLITE_LIB="${pbxlibdir} -lsqlite "
+ # if --with-SQLITE=DIR has been specified, use it.
+ if test "x${SQLITE_DIR}" != "x"; then
+ SQLITE_INCLUDE="-I${SQLITE_DIR}/include"
fi
- SPEEX_PREPROCESS_INCLUDE="${SPEEX_PREPROCESS_INCLUDE} "
- if test "xspeex/speex.h" = "x" ; then # no header, assume found
- SPEEX_PREPROCESS_HEADER_FOUND="1"
+ SQLITE_INCLUDE="${SQLITE_INCLUDE} "
+ if test "xsqlite.h" = "x" ; then # no header, assume found
+ SQLITE_HEADER_FOUND="1"
else # check for the header
saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${SPEEX_PREPROCESS_INCLUDE} "
- if test "${ac_cv_header_speex_speex_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for speex/speex.h" >&5
-echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_speex_speex_h+set}" = set; then
+ CPPFLAGS="${CPPFLAGS} ${SQLITE_INCLUDE} "
+ if test "${ac_cv_header_sqlite_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for sqlite.h" >&5
+echo $ECHO_N "checking for sqlite.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sqlite_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_speex_speex_h" >&5
-echo "${ECHO_T}$ac_cv_header_speex_speex_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite_h" >&5
+echo "${ECHO_T}$ac_cv_header_sqlite_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking speex/speex.h usability" >&5
-echo $ECHO_N "checking speex/speex.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sqlite.h usability" >&5
+echo $ECHO_N "checking sqlite.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <speex/speex.h>
+#include <sqlite.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking speex/speex.h presence" >&5
-echo $ECHO_N "checking speex/speex.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sqlite.h presence" >&5
+echo $ECHO_N "checking sqlite.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <speex/speex.h>
+#include <sqlite.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: speex/speex.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sqlite.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sqlite.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: speex/speex.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: speex/speex.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: speex/speex.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: speex/speex.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: speex/speex.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: speex/speex.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sqlite.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sqlite.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sqlite.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sqlite.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sqlite.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sqlite.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------- ##
## Report this to www.asterisk.org ##
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for speex/speex.h" >&5
-echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_speex_speex_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for sqlite.h" >&5
+echo $ECHO_N "checking for sqlite.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sqlite_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_header_speex_speex_h=$ac_header_preproc
+ ac_cv_header_sqlite_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_speex_speex_h" >&5
-echo "${ECHO_T}$ac_cv_header_speex_speex_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite_h" >&5
+echo "${ECHO_T}$ac_cv_header_sqlite_h" >&6; }
fi
-if test $ac_cv_header_speex_speex_h = yes; then
- SPEEX_PREPROCESS_HEADER_FOUND=1
+if test $ac_cv_header_sqlite_h = yes; then
+ SQLITE_HEADER_FOUND=1
else
- SPEEX_PREPROCESS_HEADER_FOUND=0
+ SQLITE_HEADER_FOUND=0
fi
CPPFLAGS="${saved_cppflags}"
fi
- if test "x${SPEEX_PREPROCESS_HEADER_FOUND}" = "x0" ; then
- SPEEX_PREPROCESS_LIB=""
- SPEEX_PREPROCESS_INCLUDE=""
+ if test "x${SQLITE_HEADER_FOUND}" = "x0" ; then
+ SQLITE_LIB=""
+ SQLITE_INCLUDE=""
else
if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- SPEEX_PREPROCESS_LIB=""
+ SQLITE_LIB=""
fi
- PBX_SPEEX_PREPROCESS=1
+ PBX_SQLITE=1
# XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
cat >>confdefs.h <<_ACEOF
-#define HAVE_SPEEX_PREPROCESS 1
+#define HAVE_SQLITE 1
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define HAVE_SPEEX_PREPROCESS_VERSION
+#define HAVE_SQLITE_VERSION
_ACEOF
fi
fi
fi
-if test "${PBX_SPEEX_PREPROCESS}" = 1; then
- PBX_SPEEX_PREPROCESS=1
-fi
-if test "x${PBX_SPEEXDSP}" != "x1" -a "${USE_SPEEXDSP}" != "no"; then
+if test "x${PBX_SQLITE3}" != "x1" -a "${USE_SQLITE3}" != "no"; then
pbxlibdir=""
- # if --with-SPEEXDSP=DIR has been specified, use it.
- if test "x${SPEEXDSP_DIR}" != "x"; then
- if test -d ${SPEEXDSP_DIR}/lib; then
- pbxlibdir="-L${SPEEXDSP_DIR}/lib"
+ # if --with-SQLITE3=DIR has been specified, use it.
+ if test "x${SQLITE3_DIR}" != "x"; then
+ if test -d ${SQLITE3_DIR}/lib; then
+ pbxlibdir="-L${SQLITE3_DIR}/lib"
else
- pbxlibdir="-L${SPEEXDSP_DIR}"
+ pbxlibdir="-L${SQLITE3_DIR}"
fi
fi
- pbxfuncname="speex_preprocess_ctl"
+ pbxfuncname="sqlite3_open"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_SPEEXDSP_FOUND=yes
+ AST_SQLITE3_FOUND=yes
else
- as_ac_Lib=`echo "ac_cv_lib_speexdsp_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lspeexdsp" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lspeexdsp... $ECHO_C" >&6; }
+ as_ac_Lib=`echo "ac_cv_lib_sqlite3_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lsqlite3" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lsqlite3... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lspeexdsp ${pbxlibdir} -lm $LIBS"
+LIBS="-lsqlite3 ${pbxlibdir} $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_SPEEXDSP_FOUND=yes
+ AST_SQLITE3_FOUND=yes
else
- AST_SPEEXDSP_FOUND=no
+ AST_SQLITE3_FOUND=no
fi
fi
# now check for the header.
- if test "${AST_SPEEXDSP_FOUND}" = "yes"; then
- SPEEXDSP_LIB="${pbxlibdir} -lspeexdsp -lm"
- # if --with-SPEEXDSP=DIR has been specified, use it.
- if test "x${SPEEXDSP_DIR}" != "x"; then
- SPEEXDSP_INCLUDE="-I${SPEEXDSP_DIR}/include"
+ if test "${AST_SQLITE3_FOUND}" = "yes"; then
+ SQLITE3_LIB="${pbxlibdir} -lsqlite3 "
+ # if --with-SQLITE3=DIR has been specified, use it.
+ if test "x${SQLITE3_DIR}" != "x"; then
+ SQLITE3_INCLUDE="-I${SQLITE3_DIR}/include"
fi
- SPEEXDSP_INCLUDE="${SPEEXDSP_INCLUDE} "
- if test "xspeex/speex.h" = "x" ; then # no header, assume found
- SPEEXDSP_HEADER_FOUND="1"
+ SQLITE3_INCLUDE="${SQLITE3_INCLUDE} "
+ if test "xsqlite3.h" = "x" ; then # no header, assume found
+ SQLITE3_HEADER_FOUND="1"
else # check for the header
saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${SPEEXDSP_INCLUDE} "
- if test "${ac_cv_header_speex_speex_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for speex/speex.h" >&5
-echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_speex_speex_h+set}" = set; then
+ CPPFLAGS="${CPPFLAGS} ${SQLITE3_INCLUDE} "
+ if test "${ac_cv_header_sqlite3_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for sqlite3.h" >&5
+echo $ECHO_N "checking for sqlite3.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sqlite3_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_speex_speex_h" >&5
-echo "${ECHO_T}$ac_cv_header_speex_speex_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite3_h" >&5
+echo "${ECHO_T}$ac_cv_header_sqlite3_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking speex/speex.h usability" >&5
-echo $ECHO_N "checking speex/speex.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sqlite3.h usability" >&5
+echo $ECHO_N "checking sqlite3.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <speex/speex.h>
+#include <sqlite3.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking speex/speex.h presence" >&5
-echo $ECHO_N "checking speex/speex.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sqlite3.h presence" >&5
+echo $ECHO_N "checking sqlite3.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <speex/speex.h>
+#include <sqlite3.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: speex/speex.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite3.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sqlite3.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: speex/speex.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: speex/speex.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: speex/speex.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: speex/speex.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: speex/speex.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: speex/speex.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: speex/speex.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite3.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sqlite3.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite3.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sqlite3.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite3.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sqlite3.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite3.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sqlite3.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite3.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sqlite3.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sqlite3.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sqlite3.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------- ##
## Report this to www.asterisk.org ##
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for speex/speex.h" >&5
-echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_speex_speex_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for sqlite3.h" >&5
+echo $ECHO_N "checking for sqlite3.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sqlite3_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_header_speex_speex_h=$ac_header_preproc
+ ac_cv_header_sqlite3_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_speex_speex_h" >&5
-echo "${ECHO_T}$ac_cv_header_speex_speex_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite3_h" >&5
+echo "${ECHO_T}$ac_cv_header_sqlite3_h" >&6; }
fi
-if test $ac_cv_header_speex_speex_h = yes; then
- SPEEXDSP_HEADER_FOUND=1
+if test $ac_cv_header_sqlite3_h = yes; then
+ SQLITE3_HEADER_FOUND=1
else
- SPEEXDSP_HEADER_FOUND=0
+ SQLITE3_HEADER_FOUND=0
fi
CPPFLAGS="${saved_cppflags}"
fi
- if test "x${SPEEXDSP_HEADER_FOUND}" = "x0" ; then
- SPEEXDSP_LIB=""
- SPEEXDSP_INCLUDE=""
+ if test "x${SQLITE3_HEADER_FOUND}" = "x0" ; then
+ SQLITE3_LIB=""
+ SQLITE3_INCLUDE=""
else
if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- SPEEXDSP_LIB=""
+ SQLITE3_LIB=""
fi
- PBX_SPEEXDSP=1
+ PBX_SQLITE3=1
# XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
cat >>confdefs.h <<_ACEOF
-#define HAVE_SPEEXDSP 1
+#define HAVE_SQLITE3 1
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define HAVE_SPEEXDSP_VERSION
+#define HAVE_SQLITE3_VERSION
_ACEOF
fi
fi
fi
-if test "${PBX_SPEEXDSP}" = 1; then
- PBX_SPEEX_PREPROCESS=1
-fi
-
-
-if test "x${PBX_SQLITE}" != "x1" -a "${USE_SQLITE}" != "no"; then
+if test "x${PBX_CRYPTO}" != "x1" -a "${USE_CRYPTO}" != "no"; then
pbxlibdir=""
- # if --with-SQLITE=DIR has been specified, use it.
- if test "x${SQLITE_DIR}" != "x"; then
- if test -d ${SQLITE_DIR}/lib; then
- pbxlibdir="-L${SQLITE_DIR}/lib"
+ # if --with-CRYPTO=DIR has been specified, use it.
+ if test "x${CRYPTO_DIR}" != "x"; then
+ if test -d ${CRYPTO_DIR}/lib; then
+ pbxlibdir="-L${CRYPTO_DIR}/lib"
else
- pbxlibdir="-L${SQLITE_DIR}"
+ pbxlibdir="-L${CRYPTO_DIR}"
fi
fi
- pbxfuncname="sqlite_exec"
+ pbxfuncname="AES_encrypt"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_SQLITE_FOUND=yes
+ AST_CRYPTO_FOUND=yes
else
- as_ac_Lib=`echo "ac_cv_lib_sqlite_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lsqlite" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lsqlite... $ECHO_C" >&6; }
+ as_ac_Lib=`echo "ac_cv_lib_crypto_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lcrypto" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lcrypto... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsqlite ${pbxlibdir} $LIBS"
+LIBS="-lcrypto ${pbxlibdir} $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_SQLITE_FOUND=yes
+ AST_CRYPTO_FOUND=yes
else
- AST_SQLITE_FOUND=no
+ AST_CRYPTO_FOUND=no
fi
fi
# now check for the header.
- if test "${AST_SQLITE_FOUND}" = "yes"; then
- SQLITE_LIB="${pbxlibdir} -lsqlite "
- # if --with-SQLITE=DIR has been specified, use it.
- if test "x${SQLITE_DIR}" != "x"; then
- SQLITE_INCLUDE="-I${SQLITE_DIR}/include"
+ if test "${AST_CRYPTO_FOUND}" = "yes"; then
+ CRYPTO_LIB="${pbxlibdir} -lcrypto "
+ # if --with-CRYPTO=DIR has been specified, use it.
+ if test "x${CRYPTO_DIR}" != "x"; then
+ CRYPTO_INCLUDE="-I${CRYPTO_DIR}/include"
fi
- SQLITE_INCLUDE="${SQLITE_INCLUDE} "
- if test "xsqlite.h" = "x" ; then # no header, assume found
- SQLITE_HEADER_FOUND="1"
+ CRYPTO_INCLUDE="${CRYPTO_INCLUDE} "
+ if test "xopenssl/aes.h" = "x" ; then # no header, assume found
+ CRYPTO_HEADER_FOUND="1"
else # check for the header
saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${SQLITE_INCLUDE} "
- if test "${ac_cv_header_sqlite_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for sqlite.h" >&5
-echo $ECHO_N "checking for sqlite.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sqlite_h+set}" = set; then
+ CPPFLAGS="${CPPFLAGS} ${CRYPTO_INCLUDE} "
+ if test "${ac_cv_header_openssl_aes_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for openssl/aes.h" >&5
+echo $ECHO_N "checking for openssl/aes.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_openssl_aes_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite_h" >&5
-echo "${ECHO_T}$ac_cv_header_sqlite_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_aes_h" >&5
+echo "${ECHO_T}$ac_cv_header_openssl_aes_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking sqlite.h usability" >&5
-echo $ECHO_N "checking sqlite.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking openssl/aes.h usability" >&5
+echo $ECHO_N "checking openssl/aes.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <sqlite.h>
+#include <openssl/aes.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking sqlite.h presence" >&5
-echo $ECHO_N "checking sqlite.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking openssl/aes.h presence" >&5
+echo $ECHO_N "checking openssl/aes.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <sqlite.h>
+#include <openssl/aes.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: sqlite.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: sqlite.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: sqlite.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: sqlite.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/aes.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: openssl/aes.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/aes.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: openssl/aes.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: sqlite.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sqlite.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: sqlite.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sqlite.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: sqlite.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: sqlite.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: sqlite.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: sqlite.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: sqlite.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sqlite.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: sqlite.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: sqlite.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/aes.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: openssl/aes.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/aes.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: openssl/aes.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/aes.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: openssl/aes.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/aes.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: openssl/aes.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/aes.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: openssl/aes.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/aes.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: openssl/aes.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------- ##
## Report this to www.asterisk.org ##
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for sqlite.h" >&5
-echo $ECHO_N "checking for sqlite.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sqlite_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for openssl/aes.h" >&5
+echo $ECHO_N "checking for openssl/aes.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_openssl_aes_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_header_sqlite_h=$ac_header_preproc
+ ac_cv_header_openssl_aes_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite_h" >&5
-echo "${ECHO_T}$ac_cv_header_sqlite_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_aes_h" >&5
+echo "${ECHO_T}$ac_cv_header_openssl_aes_h" >&6; }
fi
-if test $ac_cv_header_sqlite_h = yes; then
- SQLITE_HEADER_FOUND=1
+if test $ac_cv_header_openssl_aes_h = yes; then
+ CRYPTO_HEADER_FOUND=1
else
- SQLITE_HEADER_FOUND=0
+ CRYPTO_HEADER_FOUND=0
fi
CPPFLAGS="${saved_cppflags}"
fi
- if test "x${SQLITE_HEADER_FOUND}" = "x0" ; then
- SQLITE_LIB=""
- SQLITE_INCLUDE=""
+ if test "x${CRYPTO_HEADER_FOUND}" = "x0" ; then
+ CRYPTO_LIB=""
+ CRYPTO_INCLUDE=""
else
if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- SQLITE_LIB=""
+ CRYPTO_LIB=""
fi
- PBX_SQLITE=1
+ PBX_CRYPTO=1
# XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
cat >>confdefs.h <<_ACEOF
-#define HAVE_SQLITE 1
+#define HAVE_CRYPTO 1
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define HAVE_SQLITE_VERSION
+#define HAVE_CRYPTO_VERSION
_ACEOF
fi
fi
+if test "$PBX_CRYPTO" = "1";
+then
-if test "x${PBX_SQLITE3}" != "x1" -a "${USE_SQLITE3}" != "no"; then
+if test "x${PBX_OPENSSL}" != "x1" -a "${USE_OPENSSL}" != "no"; then
pbxlibdir=""
- # if --with-SQLITE3=DIR has been specified, use it.
- if test "x${SQLITE3_DIR}" != "x"; then
- if test -d ${SQLITE3_DIR}/lib; then
- pbxlibdir="-L${SQLITE3_DIR}/lib"
+ # if --with-OPENSSL=DIR has been specified, use it.
+ if test "x${OPENSSL_DIR}" != "x"; then
+ if test -d ${OPENSSL_DIR}/lib; then
+ pbxlibdir="-L${OPENSSL_DIR}/lib"
else
- pbxlibdir="-L${SQLITE3_DIR}"
+ pbxlibdir="-L${OPENSSL_DIR}"
fi
fi
- pbxfuncname="sqlite3_open"
+ pbxfuncname="ssl2_connect"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_SQLITE3_FOUND=yes
+ AST_OPENSSL_FOUND=yes
else
- as_ac_Lib=`echo "ac_cv_lib_sqlite3_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lsqlite3" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lsqlite3... $ECHO_C" >&6; }
+ as_ac_Lib=`echo "ac_cv_lib_ssl_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lssl" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lssl... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsqlite3 ${pbxlibdir} $LIBS"
+LIBS="-lssl ${pbxlibdir} -lcrypto $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_SQLITE3_FOUND=yes
+ AST_OPENSSL_FOUND=yes
else
- AST_SQLITE3_FOUND=no
+ AST_OPENSSL_FOUND=no
fi
fi
# now check for the header.
- if test "${AST_SQLITE3_FOUND}" = "yes"; then
- SQLITE3_LIB="${pbxlibdir} -lsqlite3 "
- # if --with-SQLITE3=DIR has been specified, use it.
- if test "x${SQLITE3_DIR}" != "x"; then
- SQLITE3_INCLUDE="-I${SQLITE3_DIR}/include"
+ if test "${AST_OPENSSL_FOUND}" = "yes"; then
+ OPENSSL_LIB="${pbxlibdir} -lssl -lcrypto"
+ # if --with-OPENSSL=DIR has been specified, use it.
+ if test "x${OPENSSL_DIR}" != "x"; then
+ OPENSSL_INCLUDE="-I${OPENSSL_DIR}/include"
fi
- SQLITE3_INCLUDE="${SQLITE3_INCLUDE} "
- if test "xsqlite3.h" = "x" ; then # no header, assume found
- SQLITE3_HEADER_FOUND="1"
+ OPENSSL_INCLUDE="${OPENSSL_INCLUDE} "
+ if test "xopenssl/ssl.h" = "x" ; then # no header, assume found
+ OPENSSL_HEADER_FOUND="1"
else # check for the header
saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${SQLITE3_INCLUDE} "
- if test "${ac_cv_header_sqlite3_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for sqlite3.h" >&5
-echo $ECHO_N "checking for sqlite3.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sqlite3_h+set}" = set; then
+ CPPFLAGS="${CPPFLAGS} ${OPENSSL_INCLUDE} "
+ if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
+echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite3_h" >&5
-echo "${ECHO_T}$ac_cv_header_sqlite3_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5
+echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking sqlite3.h usability" >&5
-echo $ECHO_N "checking sqlite3.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking openssl/ssl.h usability" >&5
+echo $ECHO_N "checking openssl/ssl.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <sqlite3.h>
+#include <openssl/ssl.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking sqlite3.h presence" >&5
-echo $ECHO_N "checking sqlite3.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking openssl/ssl.h presence" >&5
+echo $ECHO_N "checking openssl/ssl.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <sqlite3.h>
+#include <openssl/ssl.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: sqlite3.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: sqlite3.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: sqlite3.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: sqlite3.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sqlite3.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: sqlite3.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sqlite3.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: sqlite3.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: sqlite3.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: sqlite3.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: sqlite3.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: sqlite3.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sqlite3.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: sqlite3.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: sqlite3.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: openssl/ssl.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: openssl/ssl.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: openssl/ssl.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: openssl/ssl.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------- ##
## Report this to www.asterisk.org ##
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for sqlite3.h" >&5
-echo $ECHO_N "checking for sqlite3.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sqlite3_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
+echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_header_sqlite3_h=$ac_header_preproc
+ ac_cv_header_openssl_ssl_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite3_h" >&5
-echo "${ECHO_T}$ac_cv_header_sqlite3_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5
+echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6; }
fi
-if test $ac_cv_header_sqlite3_h = yes; then
- SQLITE3_HEADER_FOUND=1
+if test $ac_cv_header_openssl_ssl_h = yes; then
+ OPENSSL_HEADER_FOUND=1
else
- SQLITE3_HEADER_FOUND=0
+ OPENSSL_HEADER_FOUND=0
fi
CPPFLAGS="${saved_cppflags}"
fi
- if test "x${SQLITE3_HEADER_FOUND}" = "x0" ; then
- SQLITE3_LIB=""
- SQLITE3_INCLUDE=""
+ if test "x${OPENSSL_HEADER_FOUND}" = "x0" ; then
+ OPENSSL_LIB=""
+ OPENSSL_INCLUDE=""
else
if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- SQLITE3_LIB=""
+ OPENSSL_LIB=""
fi
- PBX_SQLITE3=1
+ PBX_OPENSSL=1
# XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
cat >>confdefs.h <<_ACEOF
-#define HAVE_SQLITE3 1
+#define HAVE_OPENSSL 1
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define HAVE_SQLITE3_VERSION
+#define HAVE_OPENSSL_VERSION
_ACEOF
fi
fi
fi
+fi
+if test "$PBX_OPENSSL" = "1";
+then
-if test "x${PBX_CRYPTO}" != "x1" -a "${USE_CRYPTO}" != "no"; then
+if test "x${PBX_OSPTK}" != "x1" -a "${USE_OSPTK}" != "no"; then
pbxlibdir=""
- # if --with-CRYPTO=DIR has been specified, use it.
- if test "x${CRYPTO_DIR}" != "x"; then
- if test -d ${CRYPTO_DIR}/lib; then
- pbxlibdir="-L${CRYPTO_DIR}/lib"
+ # if --with-OSPTK=DIR has been specified, use it.
+ if test "x${OSPTK_DIR}" != "x"; then
+ if test -d ${OSPTK_DIR}/lib; then
+ pbxlibdir="-L${OSPTK_DIR}/lib"
else
- pbxlibdir="-L${CRYPTO_DIR}"
+ pbxlibdir="-L${OSPTK_DIR}"
fi
fi
- pbxfuncname="AES_encrypt"
+ pbxfuncname="OSPPCryptoDecrypt"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_CRYPTO_FOUND=yes
+ AST_OSPTK_FOUND=yes
else
- as_ac_Lib=`echo "ac_cv_lib_crypto_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lcrypto" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lcrypto... $ECHO_C" >&6; }
+ as_ac_Lib=`echo "ac_cv_lib_osptk_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -losptk" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -losptk... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto ${pbxlibdir} $LIBS"
+LIBS="-losptk ${pbxlibdir} -lcrypto -lssl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_CRYPTO_FOUND=yes
+ AST_OSPTK_FOUND=yes
else
- AST_CRYPTO_FOUND=no
+ AST_OSPTK_FOUND=no
fi
fi
# now check for the header.
- if test "${AST_CRYPTO_FOUND}" = "yes"; then
- CRYPTO_LIB="${pbxlibdir} -lcrypto "
- # if --with-CRYPTO=DIR has been specified, use it.
- if test "x${CRYPTO_DIR}" != "x"; then
- CRYPTO_INCLUDE="-I${CRYPTO_DIR}/include"
+ if test "${AST_OSPTK_FOUND}" = "yes"; then
+ OSPTK_LIB="${pbxlibdir} -losptk -lcrypto -lssl"
+ # if --with-OSPTK=DIR has been specified, use it.
+ if test "x${OSPTK_DIR}" != "x"; then
+ OSPTK_INCLUDE="-I${OSPTK_DIR}/include"
fi
- CRYPTO_INCLUDE="${CRYPTO_INCLUDE} "
- if test "xopenssl/aes.h" = "x" ; then # no header, assume found
- CRYPTO_HEADER_FOUND="1"
+ OSPTK_INCLUDE="${OSPTK_INCLUDE} "
+ if test "xosp/osp.h" = "x" ; then # no header, assume found
+ OSPTK_HEADER_FOUND="1"
else # check for the header
saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${CRYPTO_INCLUDE} "
- if test "${ac_cv_header_openssl_aes_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for openssl/aes.h" >&5
-echo $ECHO_N "checking for openssl/aes.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_openssl_aes_h+set}" = set; then
+ CPPFLAGS="${CPPFLAGS} ${OSPTK_INCLUDE} "
+ if test "${ac_cv_header_osp_osp_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for osp/osp.h" >&5
+echo $ECHO_N "checking for osp/osp.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_osp_osp_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_aes_h" >&5
-echo "${ECHO_T}$ac_cv_header_openssl_aes_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_osp_osp_h" >&5
+echo "${ECHO_T}$ac_cv_header_osp_osp_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking openssl/aes.h usability" >&5
-echo $ECHO_N "checking openssl/aes.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking osp/osp.h usability" >&5
+echo $ECHO_N "checking osp/osp.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <openssl/aes.h>
+#include <osp/osp.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking openssl/aes.h presence" >&5
-echo $ECHO_N "checking openssl/aes.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking osp/osp.h presence" >&5
+echo $ECHO_N "checking osp/osp.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <openssl/aes.h>
+#include <osp/osp.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: openssl/aes.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: openssl/aes.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: openssl/aes.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: openssl/aes.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: osp/osp.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: osp/osp.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: osp/osp.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: osp/osp.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: openssl/aes.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: openssl/aes.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: openssl/aes.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: openssl/aes.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: openssl/aes.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: openssl/aes.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: openssl/aes.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: openssl/aes.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: openssl/aes.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: openssl/aes.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: openssl/aes.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: openssl/aes.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: osp/osp.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: osp/osp.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: osp/osp.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: osp/osp.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: osp/osp.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: osp/osp.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: osp/osp.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: osp/osp.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: osp/osp.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: osp/osp.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: osp/osp.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: osp/osp.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------- ##
## Report this to www.asterisk.org ##
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for openssl/aes.h" >&5
-echo $ECHO_N "checking for openssl/aes.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_openssl_aes_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for osp/osp.h" >&5
+echo $ECHO_N "checking for osp/osp.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_osp_osp_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_header_openssl_aes_h=$ac_header_preproc
+ ac_cv_header_osp_osp_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_aes_h" >&5
-echo "${ECHO_T}$ac_cv_header_openssl_aes_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_osp_osp_h" >&5
+echo "${ECHO_T}$ac_cv_header_osp_osp_h" >&6; }
fi
-if test $ac_cv_header_openssl_aes_h = yes; then
- CRYPTO_HEADER_FOUND=1
+if test $ac_cv_header_osp_osp_h = yes; then
+ OSPTK_HEADER_FOUND=1
else
- CRYPTO_HEADER_FOUND=0
+ OSPTK_HEADER_FOUND=0
fi
CPPFLAGS="${saved_cppflags}"
fi
- if test "x${CRYPTO_HEADER_FOUND}" = "x0" ; then
- CRYPTO_LIB=""
- CRYPTO_INCLUDE=""
+ if test "x${OSPTK_HEADER_FOUND}" = "x0" ; then
+ OSPTK_LIB=""
+ OSPTK_INCLUDE=""
else
if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- CRYPTO_LIB=""
+ OSPTK_LIB=""
fi
- PBX_CRYPTO=1
+ PBX_OSPTK=1
# XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
cat >>confdefs.h <<_ACEOF
-#define HAVE_CRYPTO 1
+#define HAVE_OSPTK 1
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define HAVE_CRYPTO_VERSION
+#define HAVE_OSPTK_VERSION
_ACEOF
fi
fi
fi
+fi
-if test "$PBX_CRYPTO" = "1";
-then
-if test "x${PBX_OPENSSL}" != "x1" -a "${USE_OPENSSL}" != "no"; then
- pbxlibdir=""
- # if --with-OPENSSL=DIR has been specified, use it.
- if test "x${OPENSSL_DIR}" != "x"; then
- if test -d ${OPENSSL_DIR}/lib; then
- pbxlibdir="-L${OPENSSL_DIR}/lib"
- else
- pbxlibdir="-L${OPENSSL_DIR}"
- fi
- fi
- pbxfuncname="ssl2_connect"
- if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_OPENSSL_FOUND=yes
- else
- as_ac_Lib=`echo "ac_cv_lib_ssl_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lssl" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lssl... $ECHO_C" >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+ if test "x${PBX_GMIME}" != "x1" -a "${USE_GMIME}" != "no"; then
+ PBX_GMIME=0
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gmime-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gmime-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CONFIG_GMIME+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lssl ${pbxlibdir} -lcrypto $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+ if test -n "$CONFIG_GMIME"; then
+ ac_cv_prog_CONFIG_GMIME="$CONFIG_GMIME" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CONFIG_GMIME="${ac_tool_prefix}gmime-config"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CONFIG_GMIME=$ac_cv_prog_CONFIG_GMIME
+if test -n "$CONFIG_GMIME"; then
+ { echo "$as_me:$LINENO: result: $CONFIG_GMIME" >&5
+echo "${ECHO_T}$CONFIG_GMIME" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CONFIG_GMIME"; then
+ ac_ct_CONFIG_GMIME=$CONFIG_GMIME
+ # Extract the first word of "gmime-config", so it can be a program name with args.
+set dummy gmime-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CONFIG_GMIME+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CONFIG_GMIME"; then
+ ac_cv_prog_ac_ct_CONFIG_GMIME="$ac_ct_CONFIG_GMIME" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CONFIG_GMIME="gmime-config"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CONFIG_GMIME=$ac_cv_prog_ac_ct_CONFIG_GMIME
+if test -n "$ac_ct_CONFIG_GMIME"; then
+ { echo "$as_me:$LINENO: result: $ac_ct_CONFIG_GMIME" >&5
+echo "${ECHO_T}$ac_ct_CONFIG_GMIME" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+ if test "x$ac_ct_CONFIG_GMIME" = x; then
+ CONFIG_GMIME="No"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CONFIG_GMIME=$ac_ct_CONFIG_GMIME
+ fi
+else
+ CONFIG_GMIME="$ac_cv_prog_CONFIG_GMIME"
+fi
+
+ if test ! "x${CONFIG_GMIME}" = xNo; then
+ if test x"" = x ; then A=--cflags ; else A="" ; fi
+ GMIME_INCLUDE=$(${CONFIG_GMIME} $A)
+ if test x"" = x ; then A=--libs ; else A="" ; fi
+ GMIME_LIB=$(${CONFIG_GMIME} $A)
+ if test x"" != x ; then
+ saved_cppflags="${CPPFLAGS}"
+ if test "x${GMIME_DIR}" != "x"; then
+ GMIME_INCLUDE="-I${GMIME_DIR}/include"
+ fi
+ CPPFLAGS="${CPPFLAGS} ${GMIME_INCLUDE}"
+
+ saved_ldflags="${LDFLAGS}"
+ LDFLAGS="${GMIME_LIB}"
+
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ${pbxfuncname} ();
int
main ()
{
-return ${pbxfuncname} ();
+ ;
+
;
return 0;
}
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
- eval "$as_ac_Lib=yes"
+ PBX_GMIME=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GMIME 1
+_ACEOF
+
+
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- eval "$as_ac_Lib=no"
+
+
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-ac_res=`eval echo '${'$as_ac_Lib'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_OPENSSL_FOUND=yes
-else
- AST_OPENSSL_FOUND=no
-fi
-
- fi
-
- # now check for the header.
- if test "${AST_OPENSSL_FOUND}" = "yes"; then
- OPENSSL_LIB="${pbxlibdir} -lssl -lcrypto"
- # if --with-OPENSSL=DIR has been specified, use it.
- if test "x${OPENSSL_DIR}" != "x"; then
- OPENSSL_INCLUDE="-I${OPENSSL_DIR}/include"
- fi
- OPENSSL_INCLUDE="${OPENSSL_INCLUDE} "
- if test "xopenssl/ssl.h" = "x" ; then # no header, assume found
- OPENSSL_HEADER_FOUND="1"
- else # check for the header
- saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${OPENSSL_INCLUDE} "
- if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
-echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5
-echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking openssl/ssl.h usability" >&5
-echo $ECHO_N "checking openssl/ssl.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <openssl/ssl.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking openssl/ssl.h presence" >&5
-echo $ECHO_N "checking openssl/ssl.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <openssl/ssl.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: openssl/ssl.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: openssl/ssl.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: openssl/ssl.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: openssl/ssl.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
-echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_openssl_ssl_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5
-echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6; }
-
-fi
-if test $ac_cv_header_openssl_ssl_h = yes; then
- OPENSSL_HEADER_FOUND=1
-else
- OPENSSL_HEADER_FOUND=0
-fi
-
-
- CPPFLAGS="${saved_cppflags}"
- fi
- if test "x${OPENSSL_HEADER_FOUND}" = "x0" ; then
- OPENSSL_LIB=""
- OPENSSL_INCLUDE=""
- else
- if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- OPENSSL_LIB=""
- fi
- PBX_OPENSSL=1
- # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_OPENSSL 1
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_OPENSSL_VERSION
-_ACEOF
-
- fi
- fi
-fi
-
-fi
-
-if test "$PBX_OPENSSL" = "1";
-then
-
-if test "x${PBX_OSPTK}" != "x1" -a "${USE_OSPTK}" != "no"; then
- pbxlibdir=""
- # if --with-OSPTK=DIR has been specified, use it.
- if test "x${OSPTK_DIR}" != "x"; then
- if test -d ${OSPTK_DIR}/lib; then
- pbxlibdir="-L${OSPTK_DIR}/lib"
- else
- pbxlibdir="-L${OSPTK_DIR}"
- fi
- fi
- pbxfuncname="OSPPCryptoDecrypt"
- if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_OSPTK_FOUND=yes
- else
- as_ac_Lib=`echo "ac_cv_lib_osptk_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -losptk" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -losptk... $ECHO_C" >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-losptk ${pbxlibdir} -lcrypto -lssl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ${pbxfuncname} ();
-int
-main ()
-{
-return ${pbxfuncname} ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_Lib=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Lib=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-ac_res=`eval echo '${'$as_ac_Lib'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_OSPTK_FOUND=yes
-else
- AST_OSPTK_FOUND=no
-fi
-
- fi
-
- # now check for the header.
- if test "${AST_OSPTK_FOUND}" = "yes"; then
- OSPTK_LIB="${pbxlibdir} -losptk -lcrypto -lssl"
- # if --with-OSPTK=DIR has been specified, use it.
- if test "x${OSPTK_DIR}" != "x"; then
- OSPTK_INCLUDE="-I${OSPTK_DIR}/include"
- fi
- OSPTK_INCLUDE="${OSPTK_INCLUDE} "
- if test "xosp/osp.h" = "x" ; then # no header, assume found
- OSPTK_HEADER_FOUND="1"
- else # check for the header
- saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${OSPTK_INCLUDE} "
- if test "${ac_cv_header_osp_osp_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for osp/osp.h" >&5
-echo $ECHO_N "checking for osp/osp.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_osp_osp_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_osp_osp_h" >&5
-echo "${ECHO_T}$ac_cv_header_osp_osp_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking osp/osp.h usability" >&5
-echo $ECHO_N "checking osp/osp.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <osp/osp.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking osp/osp.h presence" >&5
-echo $ECHO_N "checking osp/osp.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <osp/osp.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: osp/osp.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: osp/osp.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: osp/osp.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: osp/osp.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: osp/osp.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: osp/osp.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: osp/osp.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: osp/osp.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: osp/osp.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: osp/osp.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: osp/osp.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: osp/osp.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: osp/osp.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: osp/osp.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: osp/osp.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: osp/osp.h: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for osp/osp.h" >&5
-echo $ECHO_N "checking for osp/osp.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_osp_osp_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_osp_osp_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_osp_osp_h" >&5
-echo "${ECHO_T}$ac_cv_header_osp_osp_h" >&6; }
-
-fi
-if test $ac_cv_header_osp_osp_h = yes; then
- OSPTK_HEADER_FOUND=1
-else
- OSPTK_HEADER_FOUND=0
-fi
-
-
- CPPFLAGS="${saved_cppflags}"
- fi
- if test "x${OSPTK_HEADER_FOUND}" = "x0" ; then
- OSPTK_LIB=""
- OSPTK_INCLUDE=""
- else
- if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- OSPTK_LIB=""
- fi
- PBX_OSPTK=1
- # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_OSPTK 1
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_OSPTK_VERSION
-_ACEOF
-
- fi
- fi
-fi
-
-fi
-
-
- if test "x${PBX_GMIME}" != "x1" -a "${USE_GMIME}" != "no"; then
- PBX_GMIME=0
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gmime-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gmime-config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CONFIG_GMIME+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CONFIG_GMIME"; then
- ac_cv_prog_CONFIG_GMIME="$CONFIG_GMIME" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CONFIG_GMIME="${ac_tool_prefix}gmime-config"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CONFIG_GMIME=$ac_cv_prog_CONFIG_GMIME
-if test -n "$CONFIG_GMIME"; then
- { echo "$as_me:$LINENO: result: $CONFIG_GMIME" >&5
-echo "${ECHO_T}$CONFIG_GMIME" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CONFIG_GMIME"; then
- ac_ct_CONFIG_GMIME=$CONFIG_GMIME
- # Extract the first word of "gmime-config", so it can be a program name with args.
-set dummy gmime-config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CONFIG_GMIME+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CONFIG_GMIME"; then
- ac_cv_prog_ac_ct_CONFIG_GMIME="$ac_ct_CONFIG_GMIME" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CONFIG_GMIME="gmime-config"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CONFIG_GMIME=$ac_cv_prog_ac_ct_CONFIG_GMIME
-if test -n "$ac_ct_CONFIG_GMIME"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CONFIG_GMIME" >&5
-echo "${ECHO_T}$ac_ct_CONFIG_GMIME" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_CONFIG_GMIME" = x; then
- CONFIG_GMIME="No"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CONFIG_GMIME=$ac_ct_CONFIG_GMIME
- fi
-else
- CONFIG_GMIME="$ac_cv_prog_CONFIG_GMIME"
-fi
-
- if test ! "x${CONFIG_GMIME}" = xNo; then
- if test x"" = x ; then A=--cflags ; else A="" ; fi
- GMIME_INCLUDE=$(${CONFIG_GMIME} $A)
- if test x"" = x ; then A=--libs ; else A="" ; fi
- GMIME_LIB=$(${CONFIG_GMIME} $A)
- if test x"" != x ; then
- saved_cppflags="${CPPFLAGS}"
- if test "x${GMIME_DIR}" != "x"; then
- GMIME_INCLUDE="-I${GMIME_DIR}/include"
- fi
- CPPFLAGS="${CPPFLAGS} ${GMIME_INCLUDE}"
-
- saved_ldflags="${LDFLAGS}"
- LDFLAGS="${GMIME_LIB}"
-
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
- ;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- PBX_GMIME=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GMIME 1
-_ACEOF
-
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- CPPFLAGS="${saved_cppflags}"
- LDFLAGS="${saved_ldflags}"
- else
- PBX_GMIME=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GMIME 1
-_ACEOF
-
- fi
- fi
- fi
-
-
-
-if test "x${PBX_FREETDS}" != "x1" -a "${USE_FREETDS}" != "no"; then
- pbxlibdir=""
- # if --with-FREETDS=DIR has been specified, use it.
- if test "x${FREETDS_DIR}" != "x"; then
- if test -d ${FREETDS_DIR}/lib; then
- pbxlibdir="-L${FREETDS_DIR}/lib"
- else
- pbxlibdir="-L${FREETDS_DIR}"
- fi
- fi
- pbxfuncname="tds_version"
- if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_FREETDS_FOUND=yes
- else
- as_ac_Lib=`echo "ac_cv_lib_tds_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -ltds" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -ltds... $ECHO_C" >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltds ${pbxlibdir} $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ${pbxfuncname} ();
-int
-main ()
-{
-return ${pbxfuncname} ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_Lib=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Lib=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-ac_res=`eval echo '${'$as_ac_Lib'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_FREETDS_FOUND=yes
-else
- AST_FREETDS_FOUND=no
-fi
-
- fi
-
- # now check for the header.
- if test "${AST_FREETDS_FOUND}" = "yes"; then
- FREETDS_LIB="${pbxlibdir} -ltds "
- # if --with-FREETDS=DIR has been specified, use it.
- if test "x${FREETDS_DIR}" != "x"; then
- FREETDS_INCLUDE="-I${FREETDS_DIR}/include"
- fi
- FREETDS_INCLUDE="${FREETDS_INCLUDE} "
- if test "xtds.h" = "x" ; then # no header, assume found
- FREETDS_HEADER_FOUND="1"
- else # check for the header
- saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${FREETDS_INCLUDE} "
- if test "${ac_cv_header_tds_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for tds.h" >&5
-echo $ECHO_N "checking for tds.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_tds_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_tds_h" >&5
-echo "${ECHO_T}$ac_cv_header_tds_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking tds.h usability" >&5
-echo $ECHO_N "checking tds.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <tds.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking tds.h presence" >&5
-echo $ECHO_N "checking tds.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <tds.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: tds.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: tds.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: tds.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: tds.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: tds.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: tds.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: tds.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: tds.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: tds.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: tds.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: tds.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: tds.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: tds.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: tds.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: tds.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: tds.h: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for tds.h" >&5
-echo $ECHO_N "checking for tds.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_tds_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_tds_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_tds_h" >&5
-echo "${ECHO_T}$ac_cv_header_tds_h" >&6; }
-
-fi
-if test $ac_cv_header_tds_h = yes; then
- FREETDS_HEADER_FOUND=1
-else
- FREETDS_HEADER_FOUND=0
-fi
-
-
- CPPFLAGS="${saved_cppflags}"
- fi
- if test "x${FREETDS_HEADER_FOUND}" = "x0" ; then
- FREETDS_LIB=""
- FREETDS_INCLUDE=""
- else
- if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- FREETDS_LIB=""
- fi
- PBX_FREETDS=1
- # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FREETDS 1
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FREETDS_VERSION
-_ACEOF
-
- fi
- fi
-fi
-
-if test "${PBX_FREETDS}" != "0";
-then
- if test "${FREETDS_DIR}x" = "x";
- then
- for tds_dir in /usr /usr/local;
- do
- if test -f "${tds_dir}/include/tdsver.h";
- then
- FREETDS_DIR="${tds_dir}"
- fi
- done
- fi
- case `${GREP} TDS_VERSION_NO ${FREETDS_DIR:-/usr}/include/tdsver.h` in
- *0.64*)
- FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
- ;;
- *0.63*)
- FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
- ;;
- *0.62*)
- FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
- ;;
- *)
- FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
- ;;
- esac
-fi
-
-
-if test "x${PBX_TERMCAP}" != "x1" -a "${USE_TERMCAP}" != "no"; then
- pbxlibdir=""
- # if --with-TERMCAP=DIR has been specified, use it.
- if test "x${TERMCAP_DIR}" != "x"; then
- if test -d ${TERMCAP_DIR}/lib; then
- pbxlibdir="-L${TERMCAP_DIR}/lib"
- else
- pbxlibdir="-L${TERMCAP_DIR}"
- fi
- fi
- pbxfuncname="tgetent"
- if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_TERMCAP_FOUND=yes
- else
- as_ac_Lib=`echo "ac_cv_lib_termcap_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -ltermcap" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -ltermcap... $ECHO_C" >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltermcap ${pbxlibdir} $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ${pbxfuncname} ();
-int
-main ()
-{
-return ${pbxfuncname} ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_Lib=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Lib=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-ac_res=`eval echo '${'$as_ac_Lib'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_TERMCAP_FOUND=yes
-else
- AST_TERMCAP_FOUND=no
-fi
-
- fi
-
- # now check for the header.
- if test "${AST_TERMCAP_FOUND}" = "yes"; then
- TERMCAP_LIB="${pbxlibdir} -ltermcap "
- # if --with-TERMCAP=DIR has been specified, use it.
- if test "x${TERMCAP_DIR}" != "x"; then
- TERMCAP_INCLUDE="-I${TERMCAP_DIR}/include"
- fi
- TERMCAP_INCLUDE="${TERMCAP_INCLUDE} "
- if test "x" = "x" ; then # no header, assume found
- TERMCAP_HEADER_FOUND="1"
- else # check for the header
- saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${TERMCAP_INCLUDE} "
- if test "${ac_cv_header_+set}" = set; then
- { echo "$as_me:$LINENO: checking for " >&5
-echo $ECHO_N "checking for ... $ECHO_C" >&6; }
-if test "${ac_cv_header_+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
-echo "${ECHO_T}$ac_cv_header_" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking usability" >&5
-echo $ECHO_N "checking usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking presence" >&5
-echo $ECHO_N "checking presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5
-echo "$as_me: WARNING: : present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5
-echo "$as_me: WARNING: : see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for " >&5
-echo $ECHO_N "checking for ... $ECHO_C" >&6; }
-if test "${ac_cv_header_+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
-echo "${ECHO_T}$ac_cv_header_" >&6; }
-
-fi
-if test $ac_cv_header_ = yes; then
- TERMCAP_HEADER_FOUND=1
-else
- TERMCAP_HEADER_FOUND=0
-fi
-
-
- CPPFLAGS="${saved_cppflags}"
- fi
- if test "x${TERMCAP_HEADER_FOUND}" = "x0" ; then
- TERMCAP_LIB=""
- TERMCAP_INCLUDE=""
- else
- if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- TERMCAP_LIB=""
- fi
- PBX_TERMCAP=1
- # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_TERMCAP 1
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_TERMCAP_VERSION
-_ACEOF
-
- fi
- fi
-fi
-
-
-
-if test "x${PBX_TINFO}" != "x1" -a "${USE_TINFO}" != "no"; then
- pbxlibdir=""
- # if --with-TINFO=DIR has been specified, use it.
- if test "x${TINFO_DIR}" != "x"; then
- if test -d ${TINFO_DIR}/lib; then
- pbxlibdir="-L${TINFO_DIR}/lib"
- else
- pbxlibdir="-L${TINFO_DIR}"
- fi
- fi
- pbxfuncname="tgetent"
- if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_TINFO_FOUND=yes
- else
- as_ac_Lib=`echo "ac_cv_lib_tinfo_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -ltinfo" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -ltinfo... $ECHO_C" >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltinfo ${pbxlibdir} $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ${pbxfuncname} ();
-int
-main ()
-{
-return ${pbxfuncname} ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_Lib=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Lib=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-ac_res=`eval echo '${'$as_ac_Lib'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_TINFO_FOUND=yes
-else
- AST_TINFO_FOUND=no
-fi
-
- fi
-
- # now check for the header.
- if test "${AST_TINFO_FOUND}" = "yes"; then
- TINFO_LIB="${pbxlibdir} -ltinfo "
- # if --with-TINFO=DIR has been specified, use it.
- if test "x${TINFO_DIR}" != "x"; then
- TINFO_INCLUDE="-I${TINFO_DIR}/include"
- fi
- TINFO_INCLUDE="${TINFO_INCLUDE} "
- if test "x" = "x" ; then # no header, assume found
- TINFO_HEADER_FOUND="1"
- else # check for the header
- saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${TINFO_INCLUDE} "
- if test "${ac_cv_header_+set}" = set; then
- { echo "$as_me:$LINENO: checking for " >&5
-echo $ECHO_N "checking for ... $ECHO_C" >&6; }
-if test "${ac_cv_header_+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
-echo "${ECHO_T}$ac_cv_header_" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking usability" >&5
-echo $ECHO_N "checking usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking presence" >&5
-echo $ECHO_N "checking presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5
-echo "$as_me: WARNING: : present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5
-echo "$as_me: WARNING: : see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for " >&5
-echo $ECHO_N "checking for ... $ECHO_C" >&6; }
-if test "${ac_cv_header_+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
-echo "${ECHO_T}$ac_cv_header_" >&6; }
-
-fi
-if test $ac_cv_header_ = yes; then
- TINFO_HEADER_FOUND=1
-else
- TINFO_HEADER_FOUND=0
-fi
-
-
- CPPFLAGS="${saved_cppflags}"
- fi
- if test "x${TINFO_HEADER_FOUND}" = "x0" ; then
- TINFO_LIB=""
- TINFO_INCLUDE=""
- else
- if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- TINFO_LIB=""
- fi
- PBX_TINFO=1
- # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_TINFO 1
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_TINFO_VERSION
-_ACEOF
-
- fi
- fi
-fi
-
-
-if test "${host_os}" != "linux-gnu" ; then
- tonezone_extra="-lm"
-fi
-
-# new tonezone, version 1.4.0
-
-if test "x${PBX_TONEZONE}" != "x1" -a "${USE_TONEZONE}" != "no"; then
- pbxlibdir=""
- # if --with-TONEZONE=DIR has been specified, use it.
- if test "x${TONEZONE_DIR}" != "x"; then
- if test -d ${TONEZONE_DIR}/lib; then
- pbxlibdir="-L${TONEZONE_DIR}/lib"
- else
- pbxlibdir="-L${TONEZONE_DIR}"
- fi
- fi
- pbxfuncname="tone_zone_find"
- if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_TONEZONE_FOUND=yes
- else
- as_ac_Lib=`echo "ac_cv_lib_tonezone_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -ltonezone" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -ltonezone... $ECHO_C" >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltonezone ${pbxlibdir} ${tonezone_extra} $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ${pbxfuncname} ();
-int
-main ()
-{
-return ${pbxfuncname} ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_Lib=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Lib=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-ac_res=`eval echo '${'$as_ac_Lib'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_TONEZONE_FOUND=yes
-else
- AST_TONEZONE_FOUND=no
-fi
-
- fi
-
- # now check for the header.
- if test "${AST_TONEZONE_FOUND}" = "yes"; then
- TONEZONE_LIB="${pbxlibdir} -ltonezone ${tonezone_extra}"
- # if --with-TONEZONE=DIR has been specified, use it.
- if test "x${TONEZONE_DIR}" != "x"; then
- TONEZONE_INCLUDE="-I${TONEZONE_DIR}/include"
- fi
- TONEZONE_INCLUDE="${TONEZONE_INCLUDE} "
- if test "xzaptel/tonezone.h" = "x" ; then # no header, assume found
- TONEZONE_HEADER_FOUND="1"
- else # check for the header
- saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${TONEZONE_INCLUDE} "
- if test "${ac_cv_header_zaptel_tonezone_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for zaptel/tonezone.h" >&5
-echo $ECHO_N "checking for zaptel/tonezone.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_zaptel_tonezone_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zaptel_tonezone_h" >&5
-echo "${ECHO_T}$ac_cv_header_zaptel_tonezone_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking zaptel/tonezone.h usability" >&5
-echo $ECHO_N "checking zaptel/tonezone.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <zaptel/tonezone.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking zaptel/tonezone.h presence" >&5
-echo $ECHO_N "checking zaptel/tonezone.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <zaptel/tonezone.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: zaptel/tonezone.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: zaptel/tonezone.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/tonezone.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: zaptel/tonezone.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: zaptel/tonezone.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: zaptel/tonezone.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/tonezone.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: zaptel/tonezone.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/tonezone.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: zaptel/tonezone.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/tonezone.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: zaptel/tonezone.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/tonezone.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: zaptel/tonezone.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/tonezone.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: zaptel/tonezone.h: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for zaptel/tonezone.h" >&5
-echo $ECHO_N "checking for zaptel/tonezone.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_zaptel_tonezone_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_zaptel_tonezone_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zaptel_tonezone_h" >&5
-echo "${ECHO_T}$ac_cv_header_zaptel_tonezone_h" >&6; }
-
-fi
-if test $ac_cv_header_zaptel_tonezone_h = yes; then
- TONEZONE_HEADER_FOUND=1
-else
- TONEZONE_HEADER_FOUND=0
-fi
-
-
- CPPFLAGS="${saved_cppflags}"
- fi
- if test "x${TONEZONE_HEADER_FOUND}" = "x0" ; then
- TONEZONE_LIB=""
- TONEZONE_INCLUDE=""
- else
- if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- TONEZONE_LIB=""
- fi
- PBX_TONEZONE=1
- # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_TONEZONE 1
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_TONEZONE_VERSION 140
-_ACEOF
-
- fi
- fi
-fi
-
-# other case, old tonezone (0.80)
-
-if test "x${PBX_TONEZONE}" != "x1" -a "${USE_TONEZONE}" != "no"; then
- pbxlibdir=""
- # if --with-TONEZONE=DIR has been specified, use it.
- if test "x${TONEZONE_DIR}" != "x"; then
- if test -d ${TONEZONE_DIR}/lib; then
- pbxlibdir="-L${TONEZONE_DIR}/lib"
- else
- pbxlibdir="-L${TONEZONE_DIR}"
- fi
- fi
- pbxfuncname="tone_zone_find"
- if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_TONEZONE_FOUND=yes
- else
- as_ac_Lib=`echo "ac_cv_lib_tonezone_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -ltonezone" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -ltonezone... $ECHO_C" >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltonezone ${pbxlibdir} ${tonezone_extra} $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ${pbxfuncname} ();
-int
-main ()
-{
-return ${pbxfuncname} ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_Lib=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Lib=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-ac_res=`eval echo '${'$as_ac_Lib'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_TONEZONE_FOUND=yes
-else
- AST_TONEZONE_FOUND=no
-fi
-
- fi
-
- # now check for the header.
- if test "${AST_TONEZONE_FOUND}" = "yes"; then
- TONEZONE_LIB="${pbxlibdir} -ltonezone ${tonezone_extra}"
- # if --with-TONEZONE=DIR has been specified, use it.
- if test "x${TONEZONE_DIR}" != "x"; then
- TONEZONE_INCLUDE="-I${TONEZONE_DIR}/include"
- fi
- TONEZONE_INCLUDE="${TONEZONE_INCLUDE} "
- if test "xzaptel/zaptel.h" = "x" ; then # no header, assume found
- TONEZONE_HEADER_FOUND="1"
- else # check for the header
- saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${TONEZONE_INCLUDE} "
- if test "${ac_cv_header_zaptel_zaptel_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for zaptel/zaptel.h" >&5
-echo $ECHO_N "checking for zaptel/zaptel.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_zaptel_zaptel_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zaptel_zaptel_h" >&5
-echo "${ECHO_T}$ac_cv_header_zaptel_zaptel_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking zaptel/zaptel.h usability" >&5
-echo $ECHO_N "checking zaptel/zaptel.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <zaptel/zaptel.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking zaptel/zaptel.h presence" >&5
-echo $ECHO_N "checking zaptel/zaptel.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <zaptel/zaptel.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for zaptel/zaptel.h" >&5
-echo $ECHO_N "checking for zaptel/zaptel.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_zaptel_zaptel_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_zaptel_zaptel_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zaptel_zaptel_h" >&5
-echo "${ECHO_T}$ac_cv_header_zaptel_zaptel_h" >&6; }
-
-fi
-if test $ac_cv_header_zaptel_zaptel_h = yes; then
- TONEZONE_HEADER_FOUND=1
-else
- TONEZONE_HEADER_FOUND=0
-fi
-
-
- CPPFLAGS="${saved_cppflags}"
- fi
- if test "x${TONEZONE_HEADER_FOUND}" = "x0" ; then
- TONEZONE_LIB=""
- TONEZONE_INCLUDE=""
- else
- if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- TONEZONE_LIB=""
- fi
- PBX_TONEZONE=1
- # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_TONEZONE 1
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_TONEZONE_VERSION 80
-_ACEOF
-
- fi
- fi
-fi
-
-
-
-if test "x${PBX_USB}" != "x1" -a "${USE_USB}" != "no"; then
- pbxlibdir=""
- # if --with-USB=DIR has been specified, use it.
- if test "x${USB_DIR}" != "x"; then
- if test -d ${USB_DIR}/lib; then
- pbxlibdir="-L${USB_DIR}/lib"
- else
- pbxlibdir="-L${USB_DIR}"
- fi
- fi
- pbxfuncname="usb_init"
- if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_USB_FOUND=yes
- else
- as_ac_Lib=`echo "ac_cv_lib_usb_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lusb" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lusb... $ECHO_C" >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lusb ${pbxlibdir} $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ${pbxfuncname} ();
-int
-main ()
-{
-return ${pbxfuncname} ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_Lib=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Lib=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-ac_res=`eval echo '${'$as_ac_Lib'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_USB_FOUND=yes
-else
- AST_USB_FOUND=no
-fi
-
- fi
-
- # now check for the header.
- if test "${AST_USB_FOUND}" = "yes"; then
- USB_LIB="${pbxlibdir} -lusb "
- # if --with-USB=DIR has been specified, use it.
- if test "x${USB_DIR}" != "x"; then
- USB_INCLUDE="-I${USB_DIR}/include"
- fi
- USB_INCLUDE="${USB_INCLUDE} "
- if test "xusb.h" = "x" ; then # no header, assume found
- USB_HEADER_FOUND="1"
- else # check for the header
- saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${USB_INCLUDE} "
- if test "${ac_cv_header_usb_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for usb.h" >&5
-echo $ECHO_N "checking for usb.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_usb_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_usb_h" >&5
-echo "${ECHO_T}$ac_cv_header_usb_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking usb.h usability" >&5
-echo $ECHO_N "checking usb.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <usb.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking usb.h presence" >&5
-echo $ECHO_N "checking usb.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <usb.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: usb.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: usb.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: usb.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: usb.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: usb.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: usb.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: usb.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: usb.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: usb.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: usb.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: usb.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: usb.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: usb.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: usb.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: usb.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: usb.h: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for usb.h" >&5
-echo $ECHO_N "checking for usb.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_usb_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_usb_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_usb_h" >&5
-echo "${ECHO_T}$ac_cv_header_usb_h" >&6; }
-
-fi
-if test $ac_cv_header_usb_h = yes; then
- USB_HEADER_FOUND=1
-else
- USB_HEADER_FOUND=0
-fi
-
-
- CPPFLAGS="${saved_cppflags}"
- fi
- if test "x${USB_HEADER_FOUND}" = "x0" ; then
- USB_LIB=""
- USB_INCLUDE=""
- else
- if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- USB_LIB=""
- fi
- PBX_USB=1
- # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_USB 1
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_USB_VERSION
-_ACEOF
-
- fi
- fi
-fi
-
-
-
-if test "x${PBX_VORBIS}" != "x1" -a "${USE_VORBIS}" != "no"; then
- pbxlibdir=""
- # if --with-VORBIS=DIR has been specified, use it.
- if test "x${VORBIS_DIR}" != "x"; then
- if test -d ${VORBIS_DIR}/lib; then
- pbxlibdir="-L${VORBIS_DIR}/lib"
- else
- pbxlibdir="-L${VORBIS_DIR}"
- fi
- fi
- pbxfuncname="vorbis_info_init"
- if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_VORBIS_FOUND=yes
- else
- as_ac_Lib=`echo "ac_cv_lib_vorbis_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lvorbis" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lvorbis... $ECHO_C" >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lvorbis ${pbxlibdir} -lm -lvorbisenc $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ${pbxfuncname} ();
-int
-main ()
-{
-return ${pbxfuncname} ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_Lib=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Lib=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-ac_res=`eval echo '${'$as_ac_Lib'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_VORBIS_FOUND=yes
-else
- AST_VORBIS_FOUND=no
-fi
-
- fi
-
- # now check for the header.
- if test "${AST_VORBIS_FOUND}" = "yes"; then
- VORBIS_LIB="${pbxlibdir} -lvorbis -lm -lvorbisenc"
- # if --with-VORBIS=DIR has been specified, use it.
- if test "x${VORBIS_DIR}" != "x"; then
- VORBIS_INCLUDE="-I${VORBIS_DIR}/include"
- fi
- VORBIS_INCLUDE="${VORBIS_INCLUDE} "
- if test "xvorbis/codec.h" = "x" ; then # no header, assume found
- VORBIS_HEADER_FOUND="1"
- else # check for the header
- saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${VORBIS_INCLUDE} "
- if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for vorbis/codec.h" >&5
-echo $ECHO_N "checking for vorbis/codec.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_vorbis_codec_h" >&5
-echo "${ECHO_T}$ac_cv_header_vorbis_codec_h" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking vorbis/codec.h usability" >&5
-echo $ECHO_N "checking vorbis/codec.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <vorbis/codec.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking vorbis/codec.h presence" >&5
-echo $ECHO_N "checking vorbis/codec.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <vorbis/codec.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: vorbis/codec.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: vorbis/codec.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: vorbis/codec.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: vorbis/codec.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: vorbis/codec.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: vorbis/codec.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: vorbis/codec.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: vorbis/codec.h: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for vorbis/codec.h" >&5
-echo $ECHO_N "checking for vorbis/codec.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_header_vorbis_codec_h=$ac_header_preproc
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_vorbis_codec_h" >&5
-echo "${ECHO_T}$ac_cv_header_vorbis_codec_h" >&6; }
-
-fi
-if test $ac_cv_header_vorbis_codec_h = yes; then
- VORBIS_HEADER_FOUND=1
-else
- VORBIS_HEADER_FOUND=0
-fi
-
-
- CPPFLAGS="${saved_cppflags}"
- fi
- if test "x${VORBIS_HEADER_FOUND}" = "x0" ; then
- VORBIS_LIB=""
- VORBIS_INCLUDE=""
- else
- if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- VORBIS_LIB=""
- fi
- PBX_VORBIS=1
- # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_VORBIS 1
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_VORBIS_VERSION
-_ACEOF
-
- fi
- fi
-fi
-
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-if test "${USE_VPB}" != "no"; then
- { echo "$as_me:$LINENO: checking for vpb_open in -lvpb" >&5
-echo $ECHO_N "checking for vpb_open in -lvpb... $ECHO_C" >&6; }
- saved_libs="${LIBS}"
- saved_cppflags="${CPPFLAGS}"
- if test "x${VPB_DIR}" != "x"; then
- if test -d ${VPB_DIR}/lib; then
- vpblibdir=${VPB_DIR}/lib
- else
- vpblibdir=${VPB_DIR}
- fi
- LIBS="${LIBS} -L${vpblibdir}"
- CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
- fi
- LIBS="${LIBS} -lvpb -lpthread"
- cat >conftest.$ac_ext <<_ACEOF
-
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <vpbapi.h>
-int
-main ()
-{
-int q = vpb_open(0,0);
- ;
- return 0;
-}
-
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- ac_cv_lib_vpb_vpb_open="yes"
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- ac_cv_lib_vpb_vpb_open="no"
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- LIBS="${saved_libs}"
- CPPFLAGS="${saved_cppflags}"
- if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
- VPB_LIB="-lvpb"
- if test "${VPB_DIR}" != ""; then
- VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
- VPB_INCLUDE="-I${VPB_DIR}/include"
- fi
- PBX_VPB=1
+ CPPFLAGS="${saved_cppflags}"
+ LDFLAGS="${saved_ldflags}"
+ else
+ PBX_GMIME=1
cat >>confdefs.h <<\_ACEOF
-#define HAVE_VPB 1
+#define HAVE_GMIME 1
_ACEOF
- fi
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ fi
+ fi
+ fi
-if test "x${PBX_ZLIB}" != "x1" -a "${USE_ZLIB}" != "no"; then
+if test "x${PBX_FREETDS}" != "x1" -a "${USE_FREETDS}" != "no"; then
pbxlibdir=""
- # if --with-ZLIB=DIR has been specified, use it.
- if test "x${ZLIB_DIR}" != "x"; then
- if test -d ${ZLIB_DIR}/lib; then
- pbxlibdir="-L${ZLIB_DIR}/lib"
+ # if --with-FREETDS=DIR has been specified, use it.
+ if test "x${FREETDS_DIR}" != "x"; then
+ if test -d ${FREETDS_DIR}/lib; then
+ pbxlibdir="-L${FREETDS_DIR}/lib"
else
- pbxlibdir="-L${ZLIB_DIR}"
+ pbxlibdir="-L${FREETDS_DIR}"
fi
fi
- pbxfuncname="compress"
+ pbxfuncname="tds_version"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_ZLIB_FOUND=yes
+ AST_FREETDS_FOUND=yes
else
- as_ac_Lib=`echo "ac_cv_lib_z_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lz" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lz... $ECHO_C" >&6; }
+ as_ac_Lib=`echo "ac_cv_lib_tds_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -ltds" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -ltds... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz ${pbxlibdir} $LIBS"
+LIBS="-ltds ${pbxlibdir} $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_ZLIB_FOUND=yes
+ AST_FREETDS_FOUND=yes
else
- AST_ZLIB_FOUND=no
+ AST_FREETDS_FOUND=no
fi
fi
# now check for the header.
- if test "${AST_ZLIB_FOUND}" = "yes"; then
- ZLIB_LIB="${pbxlibdir} -lz "
- # if --with-ZLIB=DIR has been specified, use it.
- if test "x${ZLIB_DIR}" != "x"; then
- ZLIB_INCLUDE="-I${ZLIB_DIR}/include"
+ if test "${AST_FREETDS_FOUND}" = "yes"; then
+ FREETDS_LIB="${pbxlibdir} -ltds "
+ # if --with-FREETDS=DIR has been specified, use it.
+ if test "x${FREETDS_DIR}" != "x"; then
+ FREETDS_INCLUDE="-I${FREETDS_DIR}/include"
fi
- ZLIB_INCLUDE="${ZLIB_INCLUDE} "
- if test "xzlib.h" = "x" ; then # no header, assume found
- ZLIB_HEADER_FOUND="1"
+ FREETDS_INCLUDE="${FREETDS_INCLUDE} "
+ if test "xtds.h" = "x" ; then # no header, assume found
+ FREETDS_HEADER_FOUND="1"
else # check for the header
saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${ZLIB_INCLUDE} "
- if test "${ac_cv_header_zlib_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for zlib.h" >&5
-echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_zlib_h+set}" = set; then
+ CPPFLAGS="${CPPFLAGS} ${FREETDS_INCLUDE} "
+ if test "${ac_cv_header_tds_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for tds.h" >&5
+echo $ECHO_N "checking for tds.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_tds_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
-echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_tds_h" >&5
+echo "${ECHO_T}$ac_cv_header_tds_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking zlib.h usability" >&5
-echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking tds.h usability" >&5
+echo $ECHO_N "checking tds.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <zlib.h>
+#include <tds.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking zlib.h presence" >&5
-echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking tds.h presence" >&5
+echo $ECHO_N "checking tds.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <zlib.h>
+#include <tds.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: tds.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: tds.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: tds.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: tds.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: tds.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: tds.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: tds.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: tds.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: tds.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: tds.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: tds.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: tds.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: tds.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: tds.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: tds.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: tds.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------- ##
## Report this to www.asterisk.org ##
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for zlib.h" >&5
-echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_zlib_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for tds.h" >&5
+echo $ECHO_N "checking for tds.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_tds_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_header_zlib_h=$ac_header_preproc
+ ac_cv_header_tds_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
-echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_tds_h" >&5
+echo "${ECHO_T}$ac_cv_header_tds_h" >&6; }
fi
-if test $ac_cv_header_zlib_h = yes; then
- ZLIB_HEADER_FOUND=1
+if test $ac_cv_header_tds_h = yes; then
+ FREETDS_HEADER_FOUND=1
else
- ZLIB_HEADER_FOUND=0
+ FREETDS_HEADER_FOUND=0
fi
CPPFLAGS="${saved_cppflags}"
fi
- if test "x${ZLIB_HEADER_FOUND}" = "x0" ; then
- ZLIB_LIB=""
- ZLIB_INCLUDE=""
+ if test "x${FREETDS_HEADER_FOUND}" = "x0" ; then
+ FREETDS_LIB=""
+ FREETDS_INCLUDE=""
else
if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- ZLIB_LIB=""
+ FREETDS_LIB=""
fi
- PBX_ZLIB=1
+ PBX_FREETDS=1
# XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
cat >>confdefs.h <<_ACEOF
-#define HAVE_ZLIB 1
+#define HAVE_FREETDS 1
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define HAVE_ZLIB_VERSION
+#define HAVE_FREETDS_VERSION
_ACEOF
fi
fi
fi
-
-# Check for various zaptel features and locations.
-# The version number, which goes into HAVE_ZAPTEL_VERSION,
-# will be used in the system headers to determine the location
-# of the zaptel.h header.
-
-
- if test "x${PBX_ZAPTEL}" != "x1"; then
- { echo "$as_me:$LINENO: checking for ZT_TONE_DTMF_BASE in zaptel/zaptel.h" >&5
-echo $ECHO_N "checking for ZT_TONE_DTMF_BASE in zaptel/zaptel.h... $ECHO_C" >&6; }
- saved_cppflags="${CPPFLAGS}"
- if test "x${ZAPTEL_DIR}" != "x"; then
- ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
- fi
- CPPFLAGS="${CPPFLAGS} ${ZAPTEL_INCLUDE}"
-
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <zaptel/zaptel.h>
-int
-main ()
-{
-#if defined(ZT_TONE_DTMF_BASE)
- int foo = 0;
- #else
- int foo = bar;
- #endif
- 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- PBX_ZAPTEL=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_VERSION 140
-_ACEOF
-
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CPPFLAGS="${saved_cppflags}"
+if test "${PBX_FREETDS}" != "0";
+then
+ if test "${FREETDS_DIR}x" = "x";
+ then
+ for tds_dir in /usr /usr/local;
+ do
+ if test -f "${tds_dir}/include/tdsver.h";
+ then
+ FREETDS_DIR="${tds_dir}"
+ fi
+ done
fi
-
-
-
- if test "x${PBX_ZAPTEL}" != "x1"; then
- { echo "$as_me:$LINENO: checking for ZT_DIAL_OP_CANCEL in zaptel/zaptel.h" >&5
-echo $ECHO_N "checking for ZT_DIAL_OP_CANCEL in zaptel/zaptel.h... $ECHO_C" >&6; }
- saved_cppflags="${CPPFLAGS}"
- if test "x${ZAPTEL_DIR}" != "x"; then
- ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
- fi
- CPPFLAGS="${CPPFLAGS} ${ZAPTEL_INCLUDE}"
-
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <zaptel/zaptel.h>
-int
-main ()
-{
-#if defined(ZT_DIAL_OP_CANCEL)
- int foo = 0;
- #else
- int foo = bar;
- #endif
- 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- PBX_ZAPTEL=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_VERSION 90
-_ACEOF
-
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
+ case `${GREP} TDS_VERSION_NO ${FREETDS_DIR:-/usr}/include/tdsver.h` in
+ *0.64*)
+ FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
+ ;;
+ *0.63*)
+ FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
+ ;;
+ *0.62*)
+ FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
+ ;;
+ *)
+ FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
+ ;;
+ esac
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CPPFLAGS="${saved_cppflags}"
- fi
-
-
-
-# Check for VLDTMF support
- if test "x${PBX_ZAPTEL_VLDTMF}" != "x1"; then
- { echo "$as_me:$LINENO: checking for ZT_EVENT_REMOVED in zaptel/zaptel.h" >&5
-echo $ECHO_N "checking for ZT_EVENT_REMOVED in zaptel/zaptel.h... $ECHO_C" >&6; }
- saved_cppflags="${CPPFLAGS}"
- if test "x${ZAPTEL_VLDTMF_DIR}" != "x"; then
- ZAPTEL_VLDTMF_INCLUDE="-I${ZAPTEL_VLDTMF_DIR}/include"
- fi
- CPPFLAGS="${CPPFLAGS} ${ZAPTEL_VLDTMF_INCLUDE}"
-
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
+if test "x${PBX_TERMCAP}" != "x1" -a "${USE_TERMCAP}" != "no"; then
+ pbxlibdir=""
+ # if --with-TERMCAP=DIR has been specified, use it.
+ if test "x${TERMCAP_DIR}" != "x"; then
+ if test -d ${TERMCAP_DIR}/lib; then
+ pbxlibdir="-L${TERMCAP_DIR}/lib"
+ else
+ pbxlibdir="-L${TERMCAP_DIR}"
+ fi
+ fi
+ pbxfuncname="tgetent"
+ if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
+ AST_TERMCAP_FOUND=yes
+ else
+ as_ac_Lib=`echo "ac_cv_lib_termcap_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -ltermcap" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -ltermcap... $ECHO_C" >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltermcap ${pbxlibdir} $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <zaptel/zaptel.h>
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ${pbxfuncname} ();
int
main ()
{
-#if defined(ZT_EVENT_REMOVED)
- int foo = 0;
- #else
- int foo = bar;
- #endif
- 0
-
+return ${pbxfuncname} ();
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+ (eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- PBX_ZAPTEL_VLDTMF=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_VLDTMF 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_VLDTMF_VERSION
-_ACEOF
-
-
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_Lib=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
+ eval "$as_ac_Lib=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CPPFLAGS="${saved_cppflags}"
- fi
-
-
-
-# Check for echo canceler parameters support
-
- if test "x${PBX_ZAPTEL_ECHOCANPARAMS}" != "x1"; then
- { echo "$as_me:$LINENO: checking for ZT_ECHOCANCEL_PARAMS in zaptel/zaptel.h" >&5
-echo $ECHO_N "checking for ZT_ECHOCANCEL_PARAMS in zaptel/zaptel.h... $ECHO_C" >&6; }
- saved_cppflags="${CPPFLAGS}"
- if test "x${ZAPTEL_ECHOCANPARAMS_DIR}" != "x"; then
- ZAPTEL_ECHOCANPARAMS_INCLUDE="-I${ZAPTEL_ECHOCANPARAMS_DIR}/include"
- fi
- CPPFLAGS="${CPPFLAGS} ${ZAPTEL_ECHOCANPARAMS_INCLUDE}"
-
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <zaptel/zaptel.h>
-int
-main ()
-{
-#if defined(ZT_ECHOCANCEL_PARAMS)
- int foo = 0;
- #else
- int foo = bar;
- #endif
- 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- PBX_ZAPTEL_ECHOCANPARAMS=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_ECHOCANPARAMS 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_ECHOCANPARAMS_VERSION
-_ACEOF
-
-
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+ac_res=`eval echo '${'$as_ac_Lib'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ AST_TERMCAP_FOUND=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
+ AST_TERMCAP_FOUND=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CPPFLAGS="${saved_cppflags}"
- fi
-
-
-
-# Check for transcoder support
-
- if test "x${PBX_ZAPTEL_TRANSCODE}" != "x1"; then
- { echo "$as_me:$LINENO: checking for ZT_TCOP_ALLOCATE in zaptel/zaptel.h" >&5
-echo $ECHO_N "checking for ZT_TCOP_ALLOCATE in zaptel/zaptel.h... $ECHO_C" >&6; }
- saved_cppflags="${CPPFLAGS}"
- if test "x${ZAPTEL_TRANSCODE_DIR}" != "x"; then
- ZAPTEL_TRANSCODE_INCLUDE="-I${ZAPTEL_TRANSCODE_DIR}/include"
- fi
- CPPFLAGS="${CPPFLAGS} ${ZAPTEL_TRANSCODE_INCLUDE}"
+ fi
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
+ # now check for the header.
+ if test "${AST_TERMCAP_FOUND}" = "yes"; then
+ TERMCAP_LIB="${pbxlibdir} -ltermcap "
+ # if --with-TERMCAP=DIR has been specified, use it.
+ if test "x${TERMCAP_DIR}" != "x"; then
+ TERMCAP_INCLUDE="-I${TERMCAP_DIR}/include"
+ fi
+ TERMCAP_INCLUDE="${TERMCAP_INCLUDE} "
+ if test "x" = "x" ; then # no header, assume found
+ TERMCAP_HEADER_FOUND="1"
+ else # check for the header
+ saved_cppflags="${CPPFLAGS}"
+ CPPFLAGS="${CPPFLAGS} ${TERMCAP_INCLUDE} "
+ if test "${ac_cv_header_+set}" = set; then
+ { echo "$as_me:$LINENO: checking for " >&5
+echo $ECHO_N "checking for ... $ECHO_C" >&6; }
+if test "${ac_cv_header_+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
+echo "${ECHO_T}$ac_cv_header_" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking usability" >&5
+echo $ECHO_N "checking usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <zaptel/zaptel.h>
-int
-main ()
-{
-#if defined(ZT_TCOP_ALLOCATE)
- int foo = 0;
- #else
- int foo = bar;
- #endif
- 0
-
- ;
- return 0;
-}
+$ac_includes_default
+#include <>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- PBX_ZAPTEL_TRANSCODE=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_TRANSCODE 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_TRANSCODE_VERSION
-_ACEOF
-
-
+ ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
+ ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CPPFLAGS="${saved_cppflags}"
- fi
-
-
-
-# Check for hwgain support
-
- if test "x${PBX_ZAPTEL_HWGAIN}" != "x1"; then
- { echo "$as_me:$LINENO: checking for ZT_SET_HWGAIN in zaptel/zaptel.h" >&5
-echo $ECHO_N "checking for ZT_SET_HWGAIN in zaptel/zaptel.h... $ECHO_C" >&6; }
- saved_cppflags="${CPPFLAGS}"
- if test "x${ZAPTEL_HWGAIN_DIR}" != "x"; then
- ZAPTEL_HWGAIN_INCLUDE="-I${ZAPTEL_HWGAIN_DIR}/include"
- fi
- CPPFLAGS="${CPPFLAGS} ${ZAPTEL_HWGAIN_INCLUDE}"
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
+# Is the header present?
+{ echo "$as_me:$LINENO: checking presence" >&5
+echo $ECHO_N "checking presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <zaptel/zaptel.h>
-int
-main ()
-{
-#if defined(ZT_SET_HWGAIN)
- int foo = 0;
- #else
- int foo = bar;
- #endif
- 0
-
- ;
- return 0;
-}
+#include <>
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- PBX_ZAPTEL_HWGAIN=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_HWGAIN 1
-_ACEOF
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_HWGAIN_VERSION
-_ACEOF
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5
+echo "$as_me: WARNING: : present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5
+echo "$as_me: WARNING: : see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ------------------------------- ##
+## Report this to www.asterisk.org ##
+## ------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for " >&5
+echo $ECHO_N "checking for ... $ECHO_C" >&6; }
+if test "${ac_cv_header_+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
+echo "${ECHO_T}$ac_cv_header_" >&6; }
+fi
+if test $ac_cv_header_ = yes; then
+ TERMCAP_HEADER_FOUND=1
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ TERMCAP_HEADER_FOUND=0
+fi
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
+ CPPFLAGS="${saved_cppflags}"
+ fi
+ if test "x${TERMCAP_HEADER_FOUND}" = "x0" ; then
+ TERMCAP_LIB=""
+ TERMCAP_INCLUDE=""
+ else
+ if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
+ TERMCAP_LIB=""
+ fi
+ PBX_TERMCAP=1
+ # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CPPFLAGS="${saved_cppflags}"
- fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_TERMCAP 1
+_ACEOF
+cat >>confdefs.h <<_ACEOF
+#define HAVE_TERMCAP_VERSION
+_ACEOF
+
+ fi
+ fi
+fi
-# Check for neon mwi support
- if test "x${PBX_ZAPTEL_NEONMWI}" != "x1"; then
- { echo "$as_me:$LINENO: checking for ZT_EVENT_NEONMWI_ACTIVE in zaptel/zaptel.h" >&5
-echo $ECHO_N "checking for ZT_EVENT_NEONMWI_ACTIVE in zaptel/zaptel.h... $ECHO_C" >&6; }
- saved_cppflags="${CPPFLAGS}"
- if test "x${ZAPTEL_NEONMWI_DIR}" != "x"; then
- ZAPTEL_NEONMWI_INCLUDE="-I${ZAPTEL_NEONMWI_DIR}/include"
- fi
- CPPFLAGS="${CPPFLAGS} ${ZAPTEL_NEONMWI_INCLUDE}"
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
+if test "x${PBX_TINFO}" != "x1" -a "${USE_TINFO}" != "no"; then
+ pbxlibdir=""
+ # if --with-TINFO=DIR has been specified, use it.
+ if test "x${TINFO_DIR}" != "x"; then
+ if test -d ${TINFO_DIR}/lib; then
+ pbxlibdir="-L${TINFO_DIR}/lib"
+ else
+ pbxlibdir="-L${TINFO_DIR}"
+ fi
+ fi
+ pbxfuncname="tgetent"
+ if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
+ AST_TINFO_FOUND=yes
+ else
+ as_ac_Lib=`echo "ac_cv_lib_tinfo_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -ltinfo" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -ltinfo... $ECHO_C" >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltinfo ${pbxlibdir} $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <zaptel/zaptel.h>
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ${pbxfuncname} ();
int
main ()
{
-#if defined(ZT_EVENT_NEONMWI_ACTIVE)
- int foo = 0;
- #else
- int foo = bar;
- #endif
- 0
-
+return ${pbxfuncname} ();
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+ (eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- PBX_ZAPTEL_NEONMWI=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_NEONMWI 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_NEONMWI_VERSION
-_ACEOF
-
-
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_Lib=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
+ eval "$as_ac_Lib=no"
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CPPFLAGS="${saved_cppflags}"
- fi
-
-
-
-# Check for channel alarm support
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+ac_res=`eval echo '${'$as_ac_Lib'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ AST_TINFO_FOUND=yes
+else
+ AST_TINFO_FOUND=no
+fi
- if test "x${PBX_ZAPTEL_CHANALARMS}" != "x1" -a "${USE_ZAPTEL_CHANALARMS}" != "no"; then
- { echo "$as_me:$LINENO: checking if \"size_t foo = sizeof(struct zt_params_v1)\" compiles using zaptel/zaptel.h" >&5
-echo $ECHO_N "checking if \"size_t foo = sizeof(struct zt_params_v1)\" compiles using zaptel/zaptel.h... $ECHO_C" >&6; }
- saved_cppflags="${CPPFLAGS}"
- if test "x${ZAPTEL_CHANALARMS_DIR}" != "x"; then
- ZAPTEL_CHANALARMS_INCLUDE="-I${ZAPTEL_CHANALARMS_DIR}/include"
- fi
- CPPFLAGS="${CPPFLAGS} ${ZAPTEL_CHANALARMS_INCLUDE}"
+ fi
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
+ # now check for the header.
+ if test "${AST_TINFO_FOUND}" = "yes"; then
+ TINFO_LIB="${pbxlibdir} -ltinfo "
+ # if --with-TINFO=DIR has been specified, use it.
+ if test "x${TINFO_DIR}" != "x"; then
+ TINFO_INCLUDE="-I${TINFO_DIR}/include"
+ fi
+ TINFO_INCLUDE="${TINFO_INCLUDE} "
+ if test "x" = "x" ; then # no header, assume found
+ TINFO_HEADER_FOUND="1"
+ else # check for the header
+ saved_cppflags="${CPPFLAGS}"
+ CPPFLAGS="${CPPFLAGS} ${TINFO_INCLUDE} "
+ if test "${ac_cv_header_+set}" = set; then
+ { echo "$as_me:$LINENO: checking for " >&5
+echo $ECHO_N "checking for ... $ECHO_C" >&6; }
+if test "${ac_cv_header_+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
+echo "${ECHO_T}$ac_cv_header_" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking usability" >&5
+echo $ECHO_N "checking usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <zaptel/zaptel.h>
-int
-main ()
-{
- size_t foo = sizeof(struct zt_params_v1);
-
- ;
- return 0;
-}
+$ac_includes_default
+#include <>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- PBX_ZAPTEL_CHANALARMS=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_CHANALARMS 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_CHANALARMS_VERSION
-_ACEOF
-
-
+ ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
+ ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CPPFLAGS="${saved_cppflags}"
- fi
-
-
-# Check for ZT_SIG_MTP2
-
- if test "x${PBX_ZAPTEL_SIG_MTP2}" != "x1"; then
- { echo "$as_me:$LINENO: checking for ZT_SIG_MTP2 in zaptel/zaptel.h" >&5
-echo $ECHO_N "checking for ZT_SIG_MTP2 in zaptel/zaptel.h... $ECHO_C" >&6; }
- saved_cppflags="${CPPFLAGS}"
- if test "x${ZAPTEL_SIG_MTP2_DIR}" != "x"; then
- ZAPTEL_SIG_MTP2_INCLUDE="-I${ZAPTEL_SIG_MTP2_DIR}/include"
- fi
- CPPFLAGS="${CPPFLAGS} ${ZAPTEL_SIG_MTP2_INCLUDE}"
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
+# Is the header present?
+{ echo "$as_me:$LINENO: checking presence" >&5
+echo $ECHO_N "checking presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <zaptel/zaptel.h>
-int
-main ()
-{
-#if defined(ZT_SIG_MTP2)
- int foo = 0;
- #else
- int foo = bar;
- #endif
- 0
-
- ;
- return 0;
-}
+#include <>
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- PBX_ZAPTEL_SIG_MTP2=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_SIG_MTP2 1
-_ACEOF
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ ac_header_preproc=no
+fi
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ZAPTEL_SIG_MTP2_VERSION
-_ACEOF
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5
+echo "$as_me: WARNING: : present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5
+echo "$as_me: WARNING: : see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ------------------------------- ##
+## Report this to www.asterisk.org ##
+## ------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for " >&5
+echo $ECHO_N "checking for ... $ECHO_C" >&6; }
+if test "${ac_cv_header_+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
+echo "${ECHO_T}$ac_cv_header_" >&6; }
+fi
+if test $ac_cv_header_ = yes; then
+ TINFO_HEADER_FOUND=1
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ TINFO_HEADER_FOUND=0
+fi
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
+ CPPFLAGS="${saved_cppflags}"
+ fi
+ if test "x${TINFO_HEADER_FOUND}" = "x0" ; then
+ TINFO_LIB=""
+ TINFO_INCLUDE=""
+ else
+ if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
+ TINFO_LIB=""
+ fi
+ PBX_TINFO=1
+ # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CPPFLAGS="${saved_cppflags}"
- fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_TINFO 1
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_TINFO_VERSION
+_ACEOF
+ fi
+ fi
+fi
-# On FreeBSD, try old zaptel (0.80 or so) and pretend we have vldtmf
-case "${host_os}" in
- freebsd*)
+if test "${host_os}" != "linux-gnu" ; then
+ tonezone_extra="-lm"
+fi
+
+# new tonezone, version 1.4.0
-if test "x${PBX_ZAPTEL}" != "x1" -a "${USE_ZAPTEL}" != "no"; then
+if test "x${PBX_TONEZONE}" != "x1" -a "${USE_TONEZONE}" != "no"; then
pbxlibdir=""
- # if --with-ZAPTEL=DIR has been specified, use it.
- if test "x${ZAPTEL_DIR}" != "x"; then
- if test -d ${ZAPTEL_DIR}/lib; then
- pbxlibdir="-L${ZAPTEL_DIR}/lib"
+ # if --with-TONEZONE=DIR has been specified, use it.
+ if test "x${TONEZONE_DIR}" != "x"; then
+ if test -d ${TONEZONE_DIR}/lib; then
+ pbxlibdir="-L${TONEZONE_DIR}/lib"
else
- pbxlibdir="-L${ZAPTEL_DIR}"
+ pbxlibdir="-L${TONEZONE_DIR}"
fi
fi
- pbxfuncname=""
+ pbxfuncname="tone_zone_find"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_ZAPTEL_FOUND=yes
+ AST_TONEZONE_FOUND=yes
else
- as_ac_Lib=`echo "ac_cv_lib_zaptel_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lzaptel" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lzaptel... $ECHO_C" >&6; }
+ as_ac_Lib=`echo "ac_cv_lib_tonezone_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -ltonezone" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -ltonezone... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lzaptel ${pbxlibdir} $LIBS"
+LIBS="-ltonezone ${pbxlibdir} ${tonezone_extra} $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_ZAPTEL_FOUND=yes
+ AST_TONEZONE_FOUND=yes
else
- AST_ZAPTEL_FOUND=no
+ AST_TONEZONE_FOUND=no
fi
fi
# now check for the header.
- if test "${AST_ZAPTEL_FOUND}" = "yes"; then
- ZAPTEL_LIB="${pbxlibdir} -lzaptel "
- # if --with-ZAPTEL=DIR has been specified, use it.
- if test "x${ZAPTEL_DIR}" != "x"; then
- ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
- fi
- ZAPTEL_INCLUDE="${ZAPTEL_INCLUDE} "
- if test "xzaptel.h" = "x" ; then # no header, assume found
- ZAPTEL_HEADER_FOUND="1"
+ if test "${AST_TONEZONE_FOUND}" = "yes"; then
+ TONEZONE_LIB="${pbxlibdir} -ltonezone ${tonezone_extra}"
+ # if --with-TONEZONE=DIR has been specified, use it.
+ if test "x${TONEZONE_DIR}" != "x"; then
+ TONEZONE_INCLUDE="-I${TONEZONE_DIR}/include"
+ fi
+ TONEZONE_INCLUDE="${TONEZONE_INCLUDE} "
+ if test "xdahdi/tonezone.h" = "x" ; then # no header, assume found
+ TONEZONE_HEADER_FOUND="1"
else # check for the header
saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${ZAPTEL_INCLUDE} "
- if test "${ac_cv_header_zaptel_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for zaptel.h" >&5
-echo $ECHO_N "checking for zaptel.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_zaptel_h+set}" = set; then
+ CPPFLAGS="${CPPFLAGS} ${TONEZONE_INCLUDE} "
+ if test "${ac_cv_header_dahdi_tonezone_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for dahdi/tonezone.h" >&5
+echo $ECHO_N "checking for dahdi/tonezone.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_dahdi_tonezone_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zaptel_h" >&5
-echo "${ECHO_T}$ac_cv_header_zaptel_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_dahdi_tonezone_h" >&5
+echo "${ECHO_T}$ac_cv_header_dahdi_tonezone_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking zaptel.h usability" >&5
-echo $ECHO_N "checking zaptel.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking dahdi/tonezone.h usability" >&5
+echo $ECHO_N "checking dahdi/tonezone.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <zaptel.h>
+#include <dahdi/tonezone.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking zaptel.h presence" >&5
-echo $ECHO_N "checking zaptel.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking dahdi/tonezone.h presence" >&5
+echo $ECHO_N "checking dahdi/tonezone.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <zaptel.h>
+#include <dahdi/tonezone.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: zaptel.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: zaptel.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: zaptel.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dahdi/tonezone.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: dahdi/tonezone.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dahdi/tonezone.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: dahdi/tonezone.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: zaptel.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: zaptel.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: zaptel.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: zaptel.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: zaptel.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: zaptel.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: zaptel.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dahdi/tonezone.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: dahdi/tonezone.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dahdi/tonezone.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: dahdi/tonezone.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dahdi/tonezone.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: dahdi/tonezone.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dahdi/tonezone.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: dahdi/tonezone.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dahdi/tonezone.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: dahdi/tonezone.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dahdi/tonezone.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: dahdi/tonezone.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------- ##
## Report this to www.asterisk.org ##
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for zaptel.h" >&5
-echo $ECHO_N "checking for zaptel.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_zaptel_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for dahdi/tonezone.h" >&5
+echo $ECHO_N "checking for dahdi/tonezone.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_dahdi_tonezone_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_header_zaptel_h=$ac_header_preproc
+ ac_cv_header_dahdi_tonezone_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zaptel_h" >&5
-echo "${ECHO_T}$ac_cv_header_zaptel_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_dahdi_tonezone_h" >&5
+echo "${ECHO_T}$ac_cv_header_dahdi_tonezone_h" >&6; }
fi
-if test $ac_cv_header_zaptel_h = yes; then
- ZAPTEL_HEADER_FOUND=1
+if test $ac_cv_header_dahdi_tonezone_h = yes; then
+ TONEZONE_HEADER_FOUND=1
else
- ZAPTEL_HEADER_FOUND=0
+ TONEZONE_HEADER_FOUND=0
fi
CPPFLAGS="${saved_cppflags}"
fi
- if test "x${ZAPTEL_HEADER_FOUND}" = "x0" ; then
- ZAPTEL_LIB=""
- ZAPTEL_INCLUDE=""
+ if test "x${TONEZONE_HEADER_FOUND}" = "x0" ; then
+ TONEZONE_LIB=""
+ TONEZONE_INCLUDE=""
else
if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- ZAPTEL_LIB=""
+ TONEZONE_LIB=""
fi
- PBX_ZAPTEL=1
+ PBX_TONEZONE=1
# XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
cat >>confdefs.h <<_ACEOF
-#define HAVE_ZAPTEL 1
+#define HAVE_TONEZONE 1
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define HAVE_ZAPTEL_VERSION 80
+#define HAVE_TONEZONE_VERSION
_ACEOF
fi
fi
-if test "x${PBX_ZAPTEL_VLDTMF}" != "x1" -a "${USE_ZAPTEL_VLDTMF}" != "no"; then
+
+if test "x${PBX_USB}" != "x1" -a "${USE_USB}" != "no"; then
pbxlibdir=""
- # if --with-ZAPTEL_VLDTMF=DIR has been specified, use it.
- if test "x${ZAPTEL_VLDTMF_DIR}" != "x"; then
- if test -d ${ZAPTEL_VLDTMF_DIR}/lib; then
- pbxlibdir="-L${ZAPTEL_VLDTMF_DIR}/lib"
+ # if --with-USB=DIR has been specified, use it.
+ if test "x${USB_DIR}" != "x"; then
+ if test -d ${USB_DIR}/lib; then
+ pbxlibdir="-L${USB_DIR}/lib"
else
- pbxlibdir="-L${ZAPTEL_VLDTMF_DIR}"
+ pbxlibdir="-L${USB_DIR}"
fi
fi
- pbxfuncname=""
+ pbxfuncname="usb_init"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_ZAPTEL_VLDTMF_FOUND=yes
+ AST_USB_FOUND=yes
else
- as_ac_Lib=`echo "ac_cv_lib_zaptel_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lzaptel" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lzaptel... $ECHO_C" >&6; }
+ as_ac_Lib=`echo "ac_cv_lib_usb_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lusb" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lusb... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lzaptel ${pbxlibdir} $LIBS"
+LIBS="-lusb ${pbxlibdir} $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_ZAPTEL_VLDTMF_FOUND=yes
+ AST_USB_FOUND=yes
else
- AST_ZAPTEL_VLDTMF_FOUND=no
+ AST_USB_FOUND=no
fi
fi
# now check for the header.
- if test "${AST_ZAPTEL_VLDTMF_FOUND}" = "yes"; then
- ZAPTEL_VLDTMF_LIB="${pbxlibdir} -lzaptel "
- # if --with-ZAPTEL_VLDTMF=DIR has been specified, use it.
- if test "x${ZAPTEL_VLDTMF_DIR}" != "x"; then
- ZAPTEL_VLDTMF_INCLUDE="-I${ZAPTEL_VLDTMF_DIR}/include"
- fi
- ZAPTEL_VLDTMF_INCLUDE="${ZAPTEL_VLDTMF_INCLUDE} "
- if test "xzaptel/zaptel.h" = "x" ; then # no header, assume found
- ZAPTEL_VLDTMF_HEADER_FOUND="1"
+ if test "${AST_USB_FOUND}" = "yes"; then
+ USB_LIB="${pbxlibdir} -lusb "
+ # if --with-USB=DIR has been specified, use it.
+ if test "x${USB_DIR}" != "x"; then
+ USB_INCLUDE="-I${USB_DIR}/include"
+ fi
+ USB_INCLUDE="${USB_INCLUDE} "
+ if test "xusb.h" = "x" ; then # no header, assume found
+ USB_HEADER_FOUND="1"
else # check for the header
saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${ZAPTEL_VLDTMF_INCLUDE} "
- if test "${ac_cv_header_zaptel_zaptel_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for zaptel/zaptel.h" >&5
-echo $ECHO_N "checking for zaptel/zaptel.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_zaptel_zaptel_h+set}" = set; then
+ CPPFLAGS="${CPPFLAGS} ${USB_INCLUDE} "
+ if test "${ac_cv_header_usb_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for usb.h" >&5
+echo $ECHO_N "checking for usb.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_usb_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zaptel_zaptel_h" >&5
-echo "${ECHO_T}$ac_cv_header_zaptel_zaptel_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_usb_h" >&5
+echo "${ECHO_T}$ac_cv_header_usb_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking zaptel/zaptel.h usability" >&5
-echo $ECHO_N "checking zaptel/zaptel.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking usb.h usability" >&5
+echo $ECHO_N "checking usb.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <zaptel/zaptel.h>
+#include <usb.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking zaptel/zaptel.h presence" >&5
-echo $ECHO_N "checking zaptel/zaptel.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking usb.h presence" >&5
+echo $ECHO_N "checking usb.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <zaptel/zaptel.h>
+#include <usb.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: usb.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: usb.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: usb.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: usb.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel/zaptel.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: zaptel/zaptel.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: usb.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: usb.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: usb.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: usb.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: usb.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: usb.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: usb.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: usb.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: usb.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: usb.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: usb.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: usb.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------- ##
## Report this to www.asterisk.org ##
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for zaptel/zaptel.h" >&5
-echo $ECHO_N "checking for zaptel/zaptel.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_zaptel_zaptel_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for usb.h" >&5
+echo $ECHO_N "checking for usb.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_usb_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_header_zaptel_zaptel_h=$ac_header_preproc
+ ac_cv_header_usb_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zaptel_zaptel_h" >&5
-echo "${ECHO_T}$ac_cv_header_zaptel_zaptel_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_usb_h" >&5
+echo "${ECHO_T}$ac_cv_header_usb_h" >&6; }
fi
-if test $ac_cv_header_zaptel_zaptel_h = yes; then
- ZAPTEL_VLDTMF_HEADER_FOUND=1
+if test $ac_cv_header_usb_h = yes; then
+ USB_HEADER_FOUND=1
else
- ZAPTEL_VLDTMF_HEADER_FOUND=0
+ USB_HEADER_FOUND=0
fi
CPPFLAGS="${saved_cppflags}"
fi
- if test "x${ZAPTEL_VLDTMF_HEADER_FOUND}" = "x0" ; then
- ZAPTEL_VLDTMF_LIB=""
- ZAPTEL_VLDTMF_INCLUDE=""
+ if test "x${USB_HEADER_FOUND}" = "x0" ; then
+ USB_LIB=""
+ USB_INCLUDE=""
else
if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- ZAPTEL_VLDTMF_LIB=""
+ USB_LIB=""
fi
- PBX_ZAPTEL_VLDTMF=1
+ PBX_USB=1
# XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
cat >>confdefs.h <<_ACEOF
-#define HAVE_ZAPTEL_VLDTMF 1
+#define HAVE_USB 1
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define HAVE_ZAPTEL_VLDTMF_VERSION 90
+#define HAVE_USB_VERSION
_ACEOF
fi
fi
-if test "x${PBX_ZAPTEL_VLDTMF}" != "x1" -a "${USE_ZAPTEL_VLDTMF}" != "no"; then
+
+if test "x${PBX_VORBIS}" != "x1" -a "${USE_VORBIS}" != "no"; then
pbxlibdir=""
- # if --with-ZAPTEL_VLDTMF=DIR has been specified, use it.
- if test "x${ZAPTEL_VLDTMF_DIR}" != "x"; then
- if test -d ${ZAPTEL_VLDTMF_DIR}/lib; then
- pbxlibdir="-L${ZAPTEL_VLDTMF_DIR}/lib"
+ # if --with-VORBIS=DIR has been specified, use it.
+ if test "x${VORBIS_DIR}" != "x"; then
+ if test -d ${VORBIS_DIR}/lib; then
+ pbxlibdir="-L${VORBIS_DIR}/lib"
else
- pbxlibdir="-L${ZAPTEL_VLDTMF_DIR}"
+ pbxlibdir="-L${VORBIS_DIR}"
fi
fi
- pbxfuncname=""
+ pbxfuncname="vorbis_info_init"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_ZAPTEL_VLDTMF_FOUND=yes
+ AST_VORBIS_FOUND=yes
else
- as_ac_Lib=`echo "ac_cv_lib_zaptel_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lzaptel" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -lzaptel... $ECHO_C" >&6; }
+ as_ac_Lib=`echo "ac_cv_lib_vorbis_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lvorbis" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lvorbis... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lzaptel ${pbxlibdir} $LIBS"
+LIBS="-lvorbis ${pbxlibdir} -lm -lvorbisenc $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_ZAPTEL_VLDTMF_FOUND=yes
+ AST_VORBIS_FOUND=yes
else
- AST_ZAPTEL_VLDTMF_FOUND=no
+ AST_VORBIS_FOUND=no
fi
fi
# now check for the header.
- if test "${AST_ZAPTEL_VLDTMF_FOUND}" = "yes"; then
- ZAPTEL_VLDTMF_LIB="${pbxlibdir} -lzaptel "
- # if --with-ZAPTEL_VLDTMF=DIR has been specified, use it.
- if test "x${ZAPTEL_VLDTMF_DIR}" != "x"; then
- ZAPTEL_VLDTMF_INCLUDE="-I${ZAPTEL_VLDTMF_DIR}/include"
- fi
- ZAPTEL_VLDTMF_INCLUDE="${ZAPTEL_VLDTMF_INCLUDE} "
- if test "xzaptel.h" = "x" ; then # no header, assume found
- ZAPTEL_VLDTMF_HEADER_FOUND="1"
+ if test "${AST_VORBIS_FOUND}" = "yes"; then
+ VORBIS_LIB="${pbxlibdir} -lvorbis -lm -lvorbisenc"
+ # if --with-VORBIS=DIR has been specified, use it.
+ if test "x${VORBIS_DIR}" != "x"; then
+ VORBIS_INCLUDE="-I${VORBIS_DIR}/include"
+ fi
+ VORBIS_INCLUDE="${VORBIS_INCLUDE} "
+ if test "xvorbis/codec.h" = "x" ; then # no header, assume found
+ VORBIS_HEADER_FOUND="1"
else # check for the header
saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${ZAPTEL_VLDTMF_INCLUDE} "
- if test "${ac_cv_header_zaptel_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for zaptel.h" >&5
-echo $ECHO_N "checking for zaptel.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_zaptel_h+set}" = set; then
+ CPPFLAGS="${CPPFLAGS} ${VORBIS_INCLUDE} "
+ if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for vorbis/codec.h" >&5
+echo $ECHO_N "checking for vorbis/codec.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zaptel_h" >&5
-echo "${ECHO_T}$ac_cv_header_zaptel_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_vorbis_codec_h" >&5
+echo "${ECHO_T}$ac_cv_header_vorbis_codec_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking zaptel.h usability" >&5
-echo $ECHO_N "checking zaptel.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking vorbis/codec.h usability" >&5
+echo $ECHO_N "checking vorbis/codec.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <zaptel.h>
+#include <vorbis/codec.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking zaptel.h presence" >&5
-echo $ECHO_N "checking zaptel.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking vorbis/codec.h presence" >&5
+echo $ECHO_N "checking vorbis/codec.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <zaptel.h>
+#include <vorbis/codec.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: zaptel.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: zaptel.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: zaptel.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: vorbis/codec.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: vorbis/codec.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: zaptel.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: zaptel.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: zaptel.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: zaptel.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: zaptel.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: zaptel.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: zaptel.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: vorbis/codec.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: vorbis/codec.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: vorbis/codec.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: vorbis/codec.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: vorbis/codec.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: vorbis/codec.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------- ##
## Report this to www.asterisk.org ##
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for zaptel.h" >&5
-echo $ECHO_N "checking for zaptel.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_zaptel_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for vorbis/codec.h" >&5
+echo $ECHO_N "checking for vorbis/codec.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_header_zaptel_h=$ac_header_preproc
+ ac_cv_header_vorbis_codec_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zaptel_h" >&5
-echo "${ECHO_T}$ac_cv_header_zaptel_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_vorbis_codec_h" >&5
+echo "${ECHO_T}$ac_cv_header_vorbis_codec_h" >&6; }
fi
-if test $ac_cv_header_zaptel_h = yes; then
- ZAPTEL_VLDTMF_HEADER_FOUND=1
+if test $ac_cv_header_vorbis_codec_h = yes; then
+ VORBIS_HEADER_FOUND=1
else
- ZAPTEL_VLDTMF_HEADER_FOUND=0
+ VORBIS_HEADER_FOUND=0
fi
CPPFLAGS="${saved_cppflags}"
fi
- if test "x${ZAPTEL_VLDTMF_HEADER_FOUND}" = "x0" ; then
- ZAPTEL_VLDTMF_LIB=""
- ZAPTEL_VLDTMF_INCLUDE=""
+ if test "x${VORBIS_HEADER_FOUND}" = "x0" ; then
+ VORBIS_LIB=""
+ VORBIS_INCLUDE=""
else
if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- ZAPTEL_VLDTMF_LIB=""
+ VORBIS_LIB=""
fi
- PBX_ZAPTEL_VLDTMF=1
+ PBX_VORBIS=1
# XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
cat >>confdefs.h <<_ACEOF
-#define HAVE_ZAPTEL_VLDTMF 1
+#define HAVE_VORBIS 1
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define HAVE_ZAPTEL_VLDTMF_VERSION 80
+#define HAVE_VORBIS_VERSION
_ACEOF
fi
fi
- # other case, old tonezone (0.80)
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test "x${PBX_TONEZONE}" != "x1" -a "${USE_TONEZONE}" != "no"; then
+
+if test "${USE_VPB}" != "no"; then
+ { echo "$as_me:$LINENO: checking for vpb_open in -lvpb" >&5
+echo $ECHO_N "checking for vpb_open in -lvpb... $ECHO_C" >&6; }
+ saved_libs="${LIBS}"
+ saved_cppflags="${CPPFLAGS}"
+ if test "x${VPB_DIR}" != "x"; then
+ if test -d ${VPB_DIR}/lib; then
+ vpblibdir=${VPB_DIR}/lib
+ else
+ vpblibdir=${VPB_DIR}
+ fi
+ LIBS="${LIBS} -L${vpblibdir}"
+ CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
+ fi
+ LIBS="${LIBS} -lvpb -lpthread"
+ cat >conftest.$ac_ext <<_ACEOF
+
+ /* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <vpbapi.h>
+int
+main ()
+{
+int q = vpb_open(0,0);
+ ;
+ return 0;
+}
+
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ ac_cv_lib_vpb_vpb_open="yes"
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ ac_cv_lib_vpb_vpb_open="no"
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="${saved_libs}"
+ CPPFLAGS="${saved_cppflags}"
+ if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
+ VPB_LIB="-lvpb"
+ if test "${VPB_DIR}" != ""; then
+ VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
+ VPB_INCLUDE="-I${VPB_DIR}/include"
+ fi
+ PBX_VPB=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_VPB 1
+_ACEOF
+
+ fi
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+if test "x${PBX_ZLIB}" != "x1" -a "${USE_ZLIB}" != "no"; then
pbxlibdir=""
- # if --with-TONEZONE=DIR has been specified, use it.
- if test "x${TONEZONE_DIR}" != "x"; then
- if test -d ${TONEZONE_DIR}/lib; then
- pbxlibdir="-L${TONEZONE_DIR}/lib"
+ # if --with-ZLIB=DIR has been specified, use it.
+ if test "x${ZLIB_DIR}" != "x"; then
+ if test -d ${ZLIB_DIR}/lib; then
+ pbxlibdir="-L${ZLIB_DIR}/lib"
else
- pbxlibdir="-L${TONEZONE_DIR}"
+ pbxlibdir="-L${ZLIB_DIR}"
fi
fi
- pbxfuncname="tone_zone_find"
+ pbxfuncname="compress"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
- AST_TONEZONE_FOUND=yes
+ AST_ZLIB_FOUND=yes
else
- as_ac_Lib=`echo "ac_cv_lib_tonezone_${pbxfuncname}" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -ltonezone" >&5
-echo $ECHO_N "checking for ${pbxfuncname} in -ltonezone... $ECHO_C" >&6; }
+ as_ac_Lib=`echo "ac_cv_lib_z_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lz" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lz... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltonezone ${pbxlibdir} ${tonezone_extra} $LIBS"
+LIBS="-lz ${pbxlibdir} $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- AST_TONEZONE_FOUND=yes
+ AST_ZLIB_FOUND=yes
else
- AST_TONEZONE_FOUND=no
+ AST_ZLIB_FOUND=no
fi
fi
# now check for the header.
- if test "${AST_TONEZONE_FOUND}" = "yes"; then
- TONEZONE_LIB="${pbxlibdir} -ltonezone ${tonezone_extra}"
- # if --with-TONEZONE=DIR has been specified, use it.
- if test "x${TONEZONE_DIR}" != "x"; then
- TONEZONE_INCLUDE="-I${TONEZONE_DIR}/include"
+ if test "${AST_ZLIB_FOUND}" = "yes"; then
+ ZLIB_LIB="${pbxlibdir} -lz "
+ # if --with-ZLIB=DIR has been specified, use it.
+ if test "x${ZLIB_DIR}" != "x"; then
+ ZLIB_INCLUDE="-I${ZLIB_DIR}/include"
fi
- TONEZONE_INCLUDE="${TONEZONE_INCLUDE} "
- if test "xzaptel.h" = "x" ; then # no header, assume found
- TONEZONE_HEADER_FOUND="1"
+ ZLIB_INCLUDE="${ZLIB_INCLUDE} "
+ if test "xzlib.h" = "x" ; then # no header, assume found
+ ZLIB_HEADER_FOUND="1"
else # check for the header
saved_cppflags="${CPPFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${TONEZONE_INCLUDE} "
- if test "${ac_cv_header_zaptel_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for zaptel.h" >&5
-echo $ECHO_N "checking for zaptel.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_zaptel_h+set}" = set; then
+ CPPFLAGS="${CPPFLAGS} ${ZLIB_INCLUDE} "
+ if test "${ac_cv_header_zlib_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for zlib.h" >&5
+echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_zlib_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zaptel_h" >&5
-echo "${ECHO_T}$ac_cv_header_zaptel_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; }
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking zaptel.h usability" >&5
-echo $ECHO_N "checking zaptel.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking zlib.h usability" >&5
+echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-#include <zaptel.h>
+#include <zlib.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-{ echo "$as_me:$LINENO: checking zaptel.h presence" >&5
-echo $ECHO_N "checking zaptel.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking zlib.h presence" >&5
+echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <zaptel.h>
+#include <zlib.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
- { echo "$as_me:$LINENO: WARNING: zaptel.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: zaptel.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: zaptel.h: proceeding with the compiler's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
- { echo "$as_me:$LINENO: WARNING: zaptel.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: zaptel.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: zaptel.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: zaptel.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: zaptel.h: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: zaptel.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: zaptel.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: zaptel.h: in the future, the compiler will take precedence" >&2;}
+ { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------- ##
## Report this to www.asterisk.org ##
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for zaptel.h" >&5
-echo $ECHO_N "checking for zaptel.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_zaptel_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for zlib.h" >&5
+echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_zlib_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_header_zaptel_h=$ac_header_preproc
+ ac_cv_header_zlib_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zaptel_h" >&5
-echo "${ECHO_T}$ac_cv_header_zaptel_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; }
fi
-if test $ac_cv_header_zaptel_h = yes; then
- TONEZONE_HEADER_FOUND=1
+if test $ac_cv_header_zlib_h = yes; then
+ ZLIB_HEADER_FOUND=1
else
- TONEZONE_HEADER_FOUND=0
+ ZLIB_HEADER_FOUND=0
fi
CPPFLAGS="${saved_cppflags}"
fi
- if test "x${TONEZONE_HEADER_FOUND}" = "x0" ; then
- TONEZONE_LIB=""
- TONEZONE_INCLUDE=""
+ if test "x${ZLIB_HEADER_FOUND}" = "x0" ; then
+ ZLIB_LIB=""
+ ZLIB_INCLUDE=""
else
if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
- TONEZONE_LIB=""
+ ZLIB_LIB=""
fi
- PBX_TONEZONE=1
+ PBX_ZLIB=1
# XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
cat >>confdefs.h <<_ACEOF
-#define HAVE_TONEZONE 1
+#define HAVE_ZLIB 1
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define HAVE_TONEZONE_VERSION 80
+#define HAVE_ZLIB_VERSION
_ACEOF
fi
fi
fi
- ;;
-esac
EDITLINE_LIB=""
if test "x$TERMCAP_LIB" != "x" ; then
CRYPTO_INCLUDE!$CRYPTO_INCLUDE$ac_delim
CRYPTO_DIR!$CRYPTO_DIR$ac_delim
PBX_CRYPTO!$PBX_CRYPTO$ac_delim
+DAHDI_LIB!$DAHDI_LIB$ac_delim
+DAHDI_INCLUDE!$DAHDI_INCLUDE$ac_delim
+DAHDI_DIR!$DAHDI_DIR$ac_delim
+PBX_DAHDI!$PBX_DAHDI$ac_delim
FFMPEG_LIB!$FFMPEG_LIB$ac_delim
FFMPEG_INCLUDE!$FFMPEG_INCLUDE$ac_delim
FFMPEG_DIR!$FFMPEG_DIR$ac_delim
NCURSES_DIR!$NCURSES_DIR$ac_delim
PBX_NCURSES!$PBX_NCURSES$ac_delim
NETSNMP_LIB!$NETSNMP_LIB$ac_delim
-NETSNMP_INCLUDE!$NETSNMP_INCLUDE$ac_delim
-NETSNMP_DIR!$NETSNMP_DIR$ac_delim
-PBX_NETSNMP!$PBX_NETSNMP$ac_delim
-NEWT_LIB!$NEWT_LIB$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
+NETSNMP_INCLUDE!$NETSNMP_INCLUDE$ac_delim
+NETSNMP_DIR!$NETSNMP_DIR$ac_delim
+PBX_NETSNMP!$PBX_NETSNMP$ac_delim
+NEWT_LIB!$NEWT_LIB$ac_delim
NEWT_INCLUDE!$NEWT_INCLUDE$ac_delim
NEWT_DIR!$NEWT_DIR$ac_delim
PBX_NEWT!$PBX_NEWT$ac_delim
PRI_INCLUDE!$PRI_INCLUDE$ac_delim
PRI_DIR!$PRI_DIR$ac_delim
PBX_PRI!$PBX_PRI$ac_delim
-SPANDSP_LIB!$SPANDSP_LIB$ac_delim
-SPANDSP_INCLUDE!$SPANDSP_INCLUDE$ac_delim
-SPANDSP_DIR!$SPANDSP_DIR$ac_delim
-PBX_SPANDSP!$PBX_SPANDSP$ac_delim
SS7_LIB!$SS7_LIB$ac_delim
SS7_INCLUDE!$SS7_INCLUDE$ac_delim
SS7_DIR!$SS7_DIR$ac_delim
SDL_IMAGE_INCLUDE!$SDL_IMAGE_INCLUDE$ac_delim
SDL_IMAGE_DIR!$SDL_IMAGE_DIR$ac_delim
PBX_SDL_IMAGE!$PBX_SDL_IMAGE$ac_delim
-SACLM_LIB!$SACLM_LIB$ac_delim
-SACLM_INCLUDE!$SACLM_INCLUDE$ac_delim
-SACLM_DIR!$SACLM_DIR$ac_delim
-PBX_SACLM!$PBX_SACLM$ac_delim
-SAEVT_LIB!$SAEVT_LIB$ac_delim
-SAEVT_INCLUDE!$SAEVT_INCLUDE$ac_delim
-SAEVT_DIR!$SAEVT_DIR$ac_delim
-PBX_SAEVT!$PBX_SAEVT$ac_delim
SPEEX_LIB!$SPEEX_LIB$ac_delim
SPEEX_INCLUDE!$SPEEX_INCLUDE$ac_delim
SPEEX_DIR!$SPEEX_DIR$ac_delim
PBX_OPENSSL!$PBX_OPENSSL$ac_delim
FREETDS_LIB!$FREETDS_LIB$ac_delim
FREETDS_INCLUDE!$FREETDS_INCLUDE$ac_delim
+FREETDS_DIR!$FREETDS_DIR$ac_delim
+PBX_FREETDS!$PBX_FREETDS$ac_delim
+TERMCAP_LIB!$TERMCAP_LIB$ac_delim
+TERMCAP_INCLUDE!$TERMCAP_INCLUDE$ac_delim
+TERMCAP_DIR!$TERMCAP_DIR$ac_delim
+PBX_TERMCAP!$PBX_TERMCAP$ac_delim
+TINFO_LIB!$TINFO_LIB$ac_delim
+TINFO_INCLUDE!$TINFO_INCLUDE$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
-FREETDS_DIR!$FREETDS_DIR$ac_delim
-PBX_FREETDS!$PBX_FREETDS$ac_delim
-TERMCAP_LIB!$TERMCAP_LIB$ac_delim
-TERMCAP_INCLUDE!$TERMCAP_INCLUDE$ac_delim
-TERMCAP_DIR!$TERMCAP_DIR$ac_delim
-PBX_TERMCAP!$PBX_TERMCAP$ac_delim
-TINFO_LIB!$TINFO_LIB$ac_delim
-TINFO_INCLUDE!$TINFO_INCLUDE$ac_delim
TINFO_DIR!$TINFO_DIR$ac_delim
PBX_TINFO!$PBX_TINFO$ac_delim
TONEZONE_LIB!$TONEZONE_LIB$ac_delim
ZLIB_INCLUDE!$ZLIB_INCLUDE$ac_delim
ZLIB_DIR!$ZLIB_DIR$ac_delim
PBX_ZLIB!$PBX_ZLIB$ac_delim
-ZAPTEL_LIB!$ZAPTEL_LIB$ac_delim
-ZAPTEL_INCLUDE!$ZAPTEL_INCLUDE$ac_delim
-ZAPTEL_DIR!$ZAPTEL_DIR$ac_delim
-PBX_ZAPTEL!$PBX_ZAPTEL$ac_delim
ALLOCA!$ALLOCA$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
POW_LIB!$POW_LIB$ac_delim
OPENH323_BUILD!$OPENH323_BUILD$ac_delim
PBX_SPEEX_PREPROCESS!$PBX_SPEEX_PREPROCESS$ac_delim
CONFIG_GMIME!$CONFIG_GMIME$ac_delim
-PBX_ZAPTEL_VLDTMF!$PBX_ZAPTEL_VLDTMF$ac_delim
-PBX_ZAPTEL_ECHOCANPARAMS!$PBX_ZAPTEL_ECHOCANPARAMS$ac_delim
-PBX_ZAPTEL_TRANSCODE!$PBX_ZAPTEL_TRANSCODE$ac_delim
-PBX_ZAPTEL_HWGAIN!$PBX_ZAPTEL_HWGAIN$ac_delim
-PBX_ZAPTEL_NEONMWI!$PBX_ZAPTEL_NEONMWI$ac_delim
-PBX_ZAPTEL_SIG_MTP2!$PBX_ZAPTEL_SIG_MTP2$ac_delim
EDITLINE_LIB!$EDITLINE_LIB$ac_delim
PBX_H323!$PBX_H323$ac_delim
PBX_IXJUSER!$PBX_IXJUSER$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 81; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 63; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
AST_EXT_LIB_SETUP([CRYPTO], [OpenSSL Cryptography support], [crypto])
+AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
AST_EXT_LIB_SETUP([FFMPEG], [Ffmpeg and avcodec library], [avcodec])
AST_EXT_LIB_SETUP([GSM], [External GSM library], [gsm], [, use 'internal' GSM otherwise])
AST_EXT_LIB_SETUP([GTK], [gtk libraries], [gtk])
AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
AST_EXT_LIB_SETUP([X11], [X11 support], [x11])
AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
-AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
# check for basic system features and functionality before
# checking for package libraries
AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
fi
+AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h])
+
# BSD might not have exp2, and/or log2
AST_EXT_LIB_CHECK([EXP2L], [m], [exp2l])
AST_EXT_LIB_CHECK([LOG2L], [m], [log2l])
fi
# new tonezone, version 1.4.0
-AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}], [], [140])
-# other case, old tonezone (0.80)
-AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/zaptel.h], [${tonezone_extra}], [], [80])
+AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [dahdi/tonezone.h], [${tonezone_extra}])
AST_EXT_LIB_CHECK([USB], [usb], [usb_init], [usb.h], [])
AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
-# Check for various zaptel features and locations.
-# The version number, which goes into HAVE_ZAPTEL_VERSION,
-# will be used in the system headers to determine the location
-# of the zaptel.h header.
-
-AST_C_DEFINE_CHECK([ZAPTEL], [ZT_TONE_DTMF_BASE], [zaptel/zaptel.h], [140])
-AST_C_DEFINE_CHECK([ZAPTEL], [ZT_DIAL_OP_CANCEL], [zaptel/zaptel.h], [90])
-
-# Check for VLDTMF support
-AST_C_DEFINE_CHECK([ZAPTEL_VLDTMF], [ZT_EVENT_REMOVED], [zaptel/zaptel.h])
-
-# Check for echo canceler parameters support
-AST_C_DEFINE_CHECK([ZAPTEL_ECHOCANPARAMS], [ZT_ECHOCANCEL_PARAMS], [zaptel/zaptel.h])
-
-# Check for transcoder support
-AST_C_DEFINE_CHECK([ZAPTEL_TRANSCODE], [ZT_TCOP_ALLOCATE], [zaptel/zaptel.h])
-
-# Check for hwgain support
-AST_C_DEFINE_CHECK([ZAPTEL_HWGAIN], [ZT_SET_HWGAIN], [zaptel/zaptel.h])
-
-# Check for neon mwi support
-AST_C_DEFINE_CHECK([ZAPTEL_NEONMWI], [ZT_EVENT_NEONMWI_ACTIVE], [zaptel/zaptel.h])
-
-# Check for channel alarm support
-AST_C_COMPILE_CHECK([ZAPTEL_CHANALARMS], [size_t foo = sizeof(struct zt_params_v1)], [zaptel/zaptel.h])
-
-# Check for ZT_SIG_MTP2
-AST_C_DEFINE_CHECK([ZAPTEL_SIG_MTP2], [ZT_SIG_MTP2], [zaptel/zaptel.h])
-
-# On FreeBSD, try old zaptel (0.80 or so) and pretend we have vldtmf
-case "${host_os}" in
- freebsd*)
- AST_EXT_LIB_CHECK([ZAPTEL], [zaptel],, [zaptel.h],,, [80])
- AST_EXT_LIB_CHECK([ZAPTEL_VLDTMF], [zaptel],, [zaptel/zaptel.h],,, [90])
- AST_EXT_LIB_CHECK([ZAPTEL_VLDTMF], [zaptel],, [zaptel.h],,, [80])
-
- # other case, old tonezone (0.80)
- AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel.h], [${tonezone_extra}],, [80])
- ;;
-esac
-
EDITLINE_LIB=""
if test "x$TERMCAP_LIB" != "x" ; then
EDITLINE_LIB="$TERMCAP_LIB"
;;
fullrestart)
$0 stop
- service zaptel restart
+ service dahdi restart
$0 start
;;
fullrestartnow)
$0 stopnow
- service zaptel restart
+ service dahdi restart
$0 start
;;
status)
#!/bin/sh
#
-# zaptel: Loads Asterisk modules
+# DAHDI: Loads Asterisk modules
#
-# Version: @(#) /etc/rc.d/init.d/zaptel 1.0
+# Version: @(#) /etc/rc.d/init.d/dahdi 1.0
#
# chkconfig: 2345 90 10
-# description: Loads and unloads zaptel modules at boot time and shutdown.
+# description: Loads and unloads DAHDI modules at boot time and shutdown.
#
# hide: true
# Source function library.
. /etc/rc.d/init.d/functions
-# Default modules - override in /etc/sysconfig/zaptel
+# Default modules - override in /etc/sysconfig/dahdi
######################################
-MODULES="usb-uhci zaptel wcfxo wcusb"
+MODULES="usb-uhci dahdi wcfxo wcusb"
######################################
-# Resolve back to the basename (i.e. zaptel, not S90zaptel)
+# Resolve back to the basename (i.e. dahdi, not S90dahdi)
if [ 0`readlink $0` = "0" ]; then
CONFIGFILE=/etc/sysconfig/`basename $0`
else
### BEGIN INIT INFO
# Provides: asterisk
-# Required-Start: +zaptel $network $named
+# Required-Start: +dahdi $network $named
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 4 6
-# Description: zaptel - zaptel modules for Asterisk
+# Description: dahdi - dahdi modules for Asterisk
### END INIT INFO
# Source function library.
echo >> $OUTPUT;
echo "------------------" >> $OUTPUT;
- echo "ZAPTEL MODULE INFO" >> $OUTPUT;
+ echo "DAHDI MODULE INFO" >> $OUTPUT;
echo "------------------" >> $OUTPUT;
- modinfo /lib/modules/$(uname -r)/misc/*.ko >> $OUTPUT;
+ modinfo /lib/modules/$(uname -r)/dahdi/*.ko >> $OUTPUT;
echo >> $OUTPUT;
echo >> $OUTPUT;
echo >> $OUTPUT;
echo >> $OUTPUT;
+ #jpeeler: REVISIT
echo "------------------" >> $OUTPUT;
echo "ZAPTEL CONFIG" >> $OUTPUT;
echo "------------------" >> $OUTPUT;
- grep -v '^#' /etc/zaptel.conf >> $OUTPUT;
+ grep -v '^#' /etc/dahdi.conf >> $OUTPUT;
echo >> $OUTPUT;
echo >> $OUTPUT;
echo "------------------" >> $OUTPUT;
echo "ZAPATA CONFIG" >> $OUTPUT;
echo "------------------" >> $OUTPUT;
- grep -v '^;' /etc/asterisk/zapata.conf >> $OUTPUT;
+ grep -v '^;' /etc/asterisk/chan_dahdi.conf >> $OUTPUT;
echo >> $OUTPUT;
echo >> $OUTPUT;
#
# Create a (huge) bunch of call files to dial via pbx_spool.
# Defaults are selected with 'Enter' and, if all defaults
-# are selected, you'll dial Zap/1/s into default|s|1
+# are selected, you'll dial DAHDI/1/s into default|s|1
#
}
# prompt the user for some info
-get technology "Zap" "\nEnter technology type
-Zap, IAX, SIP, etc."
+get technology "DAHDI" "\nEnter technology type
+DAHDI, IAX, SIP, etc."
get chans "1" "\nEnter channel(s) or group to test in formats like
2\n1-4\n3 5 7 9\n1-23,25-47,49-71,73-95\ng4\ng2,g1"
set channels [splitchans $chans]
void print_tone_zone_sound(struct ind_tone_zone *zone_data, const char* name,
int toneid) {
int i;
- for (i=0; i<ZT_TONE_MAX; i++) {
+ for (i=0; i<DAHDI_TONE_MAX; i++) {
if (zone_data->tones[i].toneid == toneid){
printf("%s = %s\n", name, zone_data->tones[i].data);
break;
}
putchar('\n');
- print_tone_zone_sound(zone_data, "dial", ZT_TONE_DIALTONE);
- print_tone_zone_sound(zone_data, "busy", ZT_TONE_BUSY);
- print_tone_zone_sound(zone_data, "ring", ZT_TONE_RINGTONE);
- print_tone_zone_sound(zone_data, "congestion", ZT_TONE_CONGESTION);
- print_tone_zone_sound(zone_data, "callwaiting", ZT_TONE_CALLWAIT);
- print_tone_zone_sound(zone_data, "dialrecall", ZT_TONE_DIALRECALL);
- print_tone_zone_sound(zone_data, "record", ZT_TONE_RECORDTONE);
- print_tone_zone_sound(zone_data, "info", ZT_TONE_INFO);
- print_tone_zone_sound(zone_data, "stutter", ZT_TONE_STUTTER);
+ print_tone_zone_sound(zone_data, "dial", DAHDI_TONE_DIALTONE);
+ print_tone_zone_sound(zone_data, "busy", DAHDI_TONE_BUSY);
+ print_tone_zone_sound(zone_data, "ring", DAHDI_TONE_RINGTONE);
+ print_tone_zone_sound(zone_data, "congestion", DAHDI_TONE_CONGESTION);
+ print_tone_zone_sound(zone_data, "callwaiting", DAHDI_TONE_CALLWAIT);
+ print_tone_zone_sound(zone_data, "dialrecall", DAHDI_TONE_DIALRECALL);
+ print_tone_zone_sound(zone_data, "record", DAHDI_TONE_RECORDTONE);
+ print_tone_zone_sound(zone_data, "info", DAHDI_TONE_INFO);
+ print_tone_zone_sound(zone_data, "stutter", DAHDI_TONE_STUTTER);
printf("\n\n");
}
Asterisk console. Used in conjunction with \fB-r\fR or \fB-R\fR.
.TP
\fB-I\fR
-Enable internal timing if Zaptel timer is available
+Enable internal timing if DAHDI timer is available
The default behaviour is that outbound packets are phase locked
to inbound packets. Enabling this switch causes them to be
-locked to the internal Zaptel timer instead.
+locked to the internal DAHDI timer instead.
.TP
\fB-t\fR
When recording files, write them first into a temporary holding directory,
<term>-I</term>
<listitem>
<para>
- Enable internal timing if Zaptel timing is available.
+ Enable internal timing if DAHDI timing is available.
The default behaviour is that outbound packets are phase locked
to inbound packets. Enabling this switch causes them to be
- locked to the internal Zaptel timer instead.
+ locked to the internal DAHDI timer instead.
</para>
</listitem>
</varlistentry>
#10 0x000000a0 in ?? ()
#11 0x000000a0 in ?? ()
#12 0x00000000 in ?? ()
-#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "Zap/pseudo-1324221520") at app_meetme.c:262
+#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "DAHDI/pseudo-1324221520") at app_meetme.c:262
#14 0x40751332 in streamconfthread (args=0x8180bf8) at app_meetme.c:1965
#15 0xbcdffbe0 in ?? ()
#16 0x40028e51 in pthread_start_thread () from /lib/libpthread.so.0
No symbol table info available.
#12 0x00000000 in ?? ()
No symbol table info available.
-#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "Zap/pseudo-1324221520") at app_meetme.c:262
+#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "DAHDI/pseudo-1324221520") at app_meetme.c:262
f = (struct ast_frame *) 0x8180bf8
trans = (struct ast_trans_pvt *) 0x0
#14 0x40751332 in streamconfthread (args=0x8180bf8) at app_meetme.c:1965
#10 0x000000a0 in ?? ()
#11 0x000000a0 in ?? ()
#12 0x00000000 in ?? ()
-#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "Zap/pseudo-1324221520") at app_meetme.c:262
+#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "DAHDI/pseudo-1324221520") at app_meetme.c:262
#14 0x40751332 in streamconfthread (args=0x8180bf8) at app_meetme.c:1965
#15 0xbcdffbe0 in ?? ()
#16 0x40028e51 in pthread_start_thread () from /lib/libpthread.so.0
-- Convert all existing uses of astobj.h to astobj2.h
-- (chan_sip already in progress in a branch)
- -- There are many places where large character buffers are allocated in structures. There is a new system for string handling that uses dynamically allocatted memory pools which is documented in include/asterisk/stringfields.h. Examples of where they are currently used are the ast_channel structure defined in include/asterisk/channel.h, some structures in chan_sip.c, and chan_zap.c.
+ -- There are many places where large character buffers are allocated in structures. There is a new system for string handling that uses dynamically allocatted memory pools which is documented in include/asterisk/stringfields.h. Examples of where they are currently used are the ast_channel structure defined in include/asterisk/channel.h, some structures in chan_sip.c, and chan_dahdi.c.
-- There is a convenient set of macros defined in include/asterisk/linkedlists.h for handling linked lists. However, there are some open-coded lists throughout the code. Converting linked lists to use these macros will make list handling more consistent and reduce the possibility of coding errors.
- The MeetmeJoin now has caller ID name and Caller ID number fields (like MeetMeLeave)
-- Action ZapShowChannels
+- Action DAHDIShowChannels
Header changes
- - Channel: -> ZapChannel
+ - Channel: -> DAHDIChannel
For active channels, the Channel: and Uniqueid: headers are added
- You can now add a "ZapChannel: " argument to zapshowchannels actions
+ You can now add a "DAHDIChannel: " argument to DAHDIshowchannels actions
to only get information about one channel.
-- Event ZapShowChannelsComplete
+- Event DAHDIShowChannelsComplete
New header
- (new) -> Items: Reports number of channels reported
3.1.1 Build Asterisk with OSP Toolkit 8
3.1.2 osp.conf 8
3.1.3 extensions.conf 10
-3.1.4 zapata/sip/iax/h323/ooh323.conf 13
+3.1.4 dahdi/sip/iax/h323/ooh323.conf 13
3.2 OSP Dial Plan Functions 13
3.2.1 OSPAuth 13
3.2.2 OSPLookup 14
; --------------------------------------------------------------
exten => s,1000,MacroExit
-3.1.4 zapata/sip/iax/h323/ooh323.conf
+3.1.4 dahdi/sip/iax/h323/ooh323.conf
There is no configuration required for OSP.
3.2 OSP Dial Plan Functions
Basically it allows sending and receiving of text messages over the PSTN. It is
compatible with BT Text service in the UK and works on ISDN and PSTN lines. It is
-designed to connect to an ISDN or zap interface directly and uses FSK so would
+designed to connect to an ISDN or DAHDI interface directly and uses FSK so would
probably not work over any sort of compressed link (like a VoIP call using GSM codec).
Typical applications include:-
These are the commands you would type to install them:
+#jpeeler: REVISIT
`svn co http://svn.digium.com/svn/zaptel/branches/1.4 zaptel-1.4`
`cd zaptel-1.4`
`make; make install`
\section{Asterisk in a Nutshell}
-Asterisk acts as a server. Devices involved in telephony, like Zapata
+Asterisk acts as a server. Devices involved in telephony, like DAHDI
cards, or Voip phones, all indicate some context that should be
activated in their behalf. See the config file formats for IAX, SIP,
-zapata.conf, etc. They all help describe a device, and they all
+dahdi.conf, etc. They all help describe a device, and they all
specify a context to activate when somebody picks up a phone, or a
call comes in from the phone company, or a voip phone, etc.
\begin{verbatim}
globals {
CONSOLE=Console/dsp;
- TRUNK=Zap/g2;
+ TRUNK=DAHDI/g2;
}
\end{verbatim}
\end{astlisting}
\end{astlisting}
Alternatively, if you have the correct national prefix on incoming
- CLI, e.g. using zaphfc, you might use:
+ CLI, e.g. using dahdi_hfc, you might use:
\begin{astlisting}
\begin{verbatim}
exten = _X./08005875290,1,Goto(smsmtrx,${EXTEN},1)
#10 0x000000a0 in ?? ()
#11 0x000000a0 in ?? ()
#12 0x00000000 in ?? ()
-#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "Zap/pseudo-1324221520") at app_meetme.c:262
+#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "DAHDI/pseudo-1324221520") at app_meetme.c:262
#14 0x40751332 in streamconfthread (args=0x8180bf8) at app_meetme.c:1965
#15 0xbcdffbe0 in ?? ()
#16 0x40028e51 in pthread_start_thread () from /lib/libpthread.so.0
No symbol table info available.
#12 0x00000000 in ?? ()
No symbol table info available.
-#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "Zap/pseudo-1324221520") at app_meetme.c:262
+#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "DAHDI/pseudo-1324221520") at app_meetme.c:262
f = (struct ast_frame *) 0x8180bf8
trans = (struct ast_trans_pvt *) 0x0
#14 0x40751332 in streamconfthread (args=0x8180bf8) at app_meetme.c:1965
#10 0x000000a0 in ?? ()
#11 0x000000a0 in ?? ()
#12 0x00000000 in ?? ()
-#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "Zap/pseudo-1324221520") at app_meetme.c:262
+#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "DAHDI/pseudo-1324221520") at app_meetme.c:262
#14 0x40751332 in streamconfthread (args=0x8180bf8) at app_meetme.c:1965
#15 0xbcdffbe0 in ?? ()
#16 0x40028e51 in pthread_start_thread () from /lib/libpthread.so.0
the "r" option
${MEETME_RECORDINGFORMAT} Format of file to be recorded
${MEETME_EXIT_CONTEXT} Context for exit out of meetme meeting
-${MEETME_AGI_BACKGROUND} AGI script for Meetme (zap only)
+${MEETME_AGI_BACKGROUND} AGI script for Meetme (DAHDI only)
${MEETMESECS} * Number of seconds a user participated in a MeetMe conference
${CONF_LIMIT_TIMEOUT_FILE} File to play when time is up. Used with the L() option.
${CONF_LIMIT_WARNING_FILE} File to play as warning if 'y' is defined.
${DUNDDEST} * The Destination of the result from a call to DUNDiLookup()
\end{verbatim}
-\subsection{chan\_zap}
+\subsection{chan\_dahdi}
\begin{verbatim}
${ANI2} * The ANI2 Code provided by the network on the incoming call.
(ie, Code 29 identifies call as a Prison/Inmate Call)
\end{verbatim}
\end{astlisting}
-In some files, (e.g. mgcp.conf, zapata.conf and agents.conf), the syntax
+In some files, (e.g. mgcp.conf, dahdi.conf and agents.conf), the syntax
is a bit different. In these files the syntax is as follows:
\begin{astlisting}
;
exten => _011.,1,Set(enumresult=${ENUMLOOKUP(+${EXTEN:3})})
exten => _011.,n,Dial(SIP/${enumresult})
-exten => _011.,n,Dial(Zap/g1/${EXTEN})
+exten => _011.,n,Dial(DAHDI/g1/${EXTEN})
;
; end example 1
exten => _011.,n,Set(counter=$[${counter}+1])
exten => _011.,n,Dial(SIP/${ENUMLOOKUP(+${EXTEN:3},sip,,${counter})})
exten => _011.,n,EndWhile
-exten => _011.,n,Dial(Zap/g1/${EXTEN})
+exten => _011.,n,Dial(DAHDI/g1/${EXTEN})
;
; end example 2
; 14102241145 or 437203001721)
; Search through e164.arpa and then also search through e164.org
; to see if there are any valid SIP or IAX termination capabilities.
-; If none, send call out via Zap channel 1.
+; If none, send call out via DAHDI channel 1.
;
; Start first with e164.arpa zone...
;
;
; ...then send out PRI.
;
-exten => _X.,22,NoOp("No valid entries in e164.org for ${EXTEN} - sending out via Zap")
-exten => _X.,23,Dial(Zap/g1/${EXTEN})
+exten => _X.,22,NoOp("No valid entries in e164.org for ${EXTEN} - sending out via DAHDI")
+exten => _X.,23,Dial(DAHDI/g1/${EXTEN})
;
; end example 3
can use Asterisk with VoIP calls (SIP, H.323, IAX, etc.), but you can also
talk to the real PSTN through various cards.
-Supported Hardware is divided into two general groups: Zaptel devices and
-non-zaptel devices. The Zaptel compatible hardware supports pseudo-TDM
-conferencing and all call features through chan\_zap, whereas non-zaptel
+Supported Hardware is divided into two general groups: DAHDI devices and
+non-DAHDI devices. The DAHDI compatible hardware supports pseudo-TDM
+conferencing and all call features through chan\_dahdi, whereas non-DAHDI
compatible hardware may have different features.
-\subsection{Zaptel compatible hardware}
+\subsection{DAHDI compatible hardware}
\begin{itemize}
\item Digium, Inc. (Primary Developer of Asterisk)
\end{itemize}
\end{itemize}
-\subsection{Non-zaptel compatible hardware}
+\subsection{Non-DAHDI compatible hardware}
\begin{itemize}
\item QuickNet, Inc.
exten => 200,1,Dial(sip/blah)
exten => 200,102,VoiceMail(${EXTEN}@default)
-exten => 201,1,Dial(zap/1)
+exten => 201,1,Dial(DAHDI/1)
exten => 201,102,VoiceMail(${EXTEN}@default)
-exten => _0.,1,Dial(Zap/g1/${EXTEN:1}) ; outgoing calls with 0+number
+exten => _0.,1,Dial(DAHDI/g1/${EXTEN:1}) ; outgoing calls with 0+number
\end{verbatim}
\end{astlisting}
\begin{verbatim}
Action: Redirect
- Channel: Zap/1-1
+ Channel: DAHDI/1-1
ExtraChannel: SIP/3064-7e00 (varies)
Exten: 680
Priority: 1
Channel: <dialstring> -- Dialstring in Originate
Channel: <tech/[peer/username]> -- Channel in Registry events (SIP, IAX2)
Channel: <tech> -- Technology (SIP/IAX2 etc) in Registry events
- ChannelType: -- Tech: SIP, IAX2, ZAP, MGCP etc
+ ChannelType: -- Tech: SIP, IAX2, DAHDI, MGCP etc
Channel1: -- Link channel 1
Channel2: -- Link channel 2
ChanObjectType: -- "peer", "user"
To use these options, set your Dial to something like:
\begin{astlisting}
\begin{verbatim}
-exten => 3,3,Dial(Zap/5r3&Zap/6r3,35,tmPA(beep))
+exten => 3,3,Dial(DAHDI/5r3&DAHDI/6r3,35,tmPA(beep))
or
-exten => 3,3,Dial(Zap/5r3&Zap/6r3,35,tmP(something)A(beep))
+exten => 3,3,Dial(DAHDI/5r3&DAHDI/6r3,35,tmP(something)A(beep))
or
-exten => 3,3,Dial(Zap/5r3&Zap/6r3,35,tmpA(beep))
+exten => 3,3,Dial(DAHDI/5r3&DAHDI/6r3,35,tmpA(beep))
\end{verbatim}
\end{astlisting}
In the above, the variables \$\{RAQUEL\}, etc stand for
actual devices to ring that person's
-phone (like Zap/37).
+phone (like DAHDI/37).
The 8010, 8011, and 8013 extensions are purely for transferring
incoming callers to queues. For instance, a customer service
\begin{astlisting}
\begin{verbatim}
[longdistance]
-exten => _91NXXNXXXXXX,1,Dial(Zap/g2/${EXTEN:1})
+exten => _91NXXNXXXXXX,1,Dial(DAHDI/g2/${EXTEN:1})
include => local
[local]
-exten => _9NXXNXXX,1,Dial(Zap/g2/${EXTEN:1})
+exten => _9NXXNXXX,1,Dial(DAHDI/g2/${EXTEN:1})
include => default
[default]
-exten => 6123,Dial(Zap/1)
+exten => 6123,Dial(DAHDI/1)
\end{verbatim}
\end{astlisting}
An SLA system is built up of virtual trunks and stations mapped to real
Asterisk devices. The configuration for all of this is done in three
different files: extensions.conf, sla.conf, and the channel specific
-configuration file such as sip.conf or zapata.conf.
+configuration file such as sip.conf or dahdi.conf.
\subsection{Dialplan}
An SLA trunk is a mapping between a virtual trunk and a real Asterisk device.
This device may be an analog FXO line, or something like a SIP trunk. A trunk
must be configured in two places. First, configure the device itself in the
-channel specific configuration file such as zapata.conf or sip.conf. Once the
+channel specific configuration file such as dahdi.conf or sip.conf. Once the
trunk is configured, then map it to an SLA trunk in sla.conf.
\begin{astlisting}
\begin{verbatim}
[line1]
type=trunk
-device=Zap/1
+device=DAHDI/1
\end{verbatim}
\end{astlisting}
Be sure to configure the trunk's context to be the same one that is set for the
"autocontext" option in sla.conf if automatic dialplan configuration is used.
-This would be done in the regular device entry in zapata.conf, sip.conf, etc.
+This would be done in the regular device entry in dahdi.conf, sip.conf, etc.
Note that the automatic dialplan generation creates the SLATrunk() extension
-at extension 's'. This is perfect for Zap channels that are FXO trunks, for
+at extension 's'. This is perfect for DAHDI channels that are FXO trunks, for
example. However, it may not be good enough for an IP trunk, since the call
coming in over the trunk may specify an actual number.
\begin{verbatim}
[line1]
type=trunk
-device=Zap/1
+device=DAHDI/1
autocontext=line1
[line2]
type=trunk
-device=Zap/2
+device=DAHDI/2
autocontext=line2
[station](!)
\end{astlisting}
With this configuration, the dialplan is generated automatically. The first
-zap channel should have its context set to "line1" and the second should be
-set to "line2" in zapata.conf. In sip.conf, station1, station2, and station3
+DAHDI channel should have its context set to "line1" and the second should be
+set to "line2" in dahdi.conf. In sip.conf, station1, station2, and station3
should all have their context set to "sla\_stations".
For reference, here is the automatically generated dialplan for this situation:
would be configured in voicemail.conf.
For this example, assume that there are 2 trunks and 3 stations. The trunks
-are Zap/1 and Zap/2. The stations are SIP/station1, SIP/station2, and
+are DAHDI/1 and DAHDI/2. The stations are SIP/station1, SIP/station2, and
SIP/station3.
-In zapata.conf, channel 1 has context=line1 and channel 2 has context=line2.
+In dahdi.conf, channel 1 has context=line1 and channel 2 has context=line2.
In sip.conf, all three stations are configured with context=sla\_stations.
[line1_outbound]
exten => disa,1,Disa(no-password,line1_outbound)
-exten => _1NXXNXXXXXX,1,Dial(Zap/1/${EXTEN})
+exten => _1NXXNXXXXXX,1,Dial(DAHDI/1/${EXTEN})
exten => 8500,1,VoicemailMain(1234)
[line2_outbound]
exten => disa,1,Disa(no-password|line2_outbound)
-exten => _1NXXNXXXXXX,1,Dial(Zap/2/${EXTEN})
+exten => _1NXXNXXXXXX,1,Dial(DAHDI/2/${EXTEN})
exten => 8500,1,VoicemailMain(1234)
[sla_stations]
/* Define to indicate the ${CURSES_DESCRIP} library version */
#undef HAVE_CURSES_VERSION
+/* Define if your system has the DAHDI headers. */
+#undef HAVE_DAHDI
+
+/* Define DAHDI headers version */
+#undef HAVE_DAHDI_VERSION
+
/* Define to 1 if your system has /dev/urandom. */
#undef HAVE_DEV_URANDOM
/* Define to indicate the ${X11_DESCRIP} library version */
#undef HAVE_X11_VERSION
-/* Define this to indicate the ${ZAPTEL_DESCRIP} library */
-#undef HAVE_ZAPTEL
-
-/* Define if your system has the ZAPTEL_CHANALARMS headers. */
-#undef HAVE_ZAPTEL_CHANALARMS
-
-/* Define ZAPTEL_CHANALARMS headers version */
-#undef HAVE_ZAPTEL_CHANALARMS_VERSION
-
-/* Define if your system has the ZAPTEL_ECHOCANPARAMS headers. */
-#undef HAVE_ZAPTEL_ECHOCANPARAMS
-
-/* Define ZAPTEL_ECHOCANPARAMS headers version */
-#undef HAVE_ZAPTEL_ECHOCANPARAMS_VERSION
-
-/* Define if your system has the ZAPTEL_HWGAIN headers. */
-#undef HAVE_ZAPTEL_HWGAIN
-
-/* Define ZAPTEL_HWGAIN headers version */
-#undef HAVE_ZAPTEL_HWGAIN_VERSION
-
-/* Define if your system has the ZAPTEL_NEONMWI headers. */
-#undef HAVE_ZAPTEL_NEONMWI
-
-/* Define ZAPTEL_NEONMWI headers version */
-#undef HAVE_ZAPTEL_NEONMWI_VERSION
-
-/* Define if your system has the ZAPTEL_SIG_MTP2 headers. */
-#undef HAVE_ZAPTEL_SIG_MTP2
-
-/* Define ZAPTEL_SIG_MTP2 headers version */
-#undef HAVE_ZAPTEL_SIG_MTP2_VERSION
-
-/* Define if your system has the ZAPTEL_TRANSCODE headers. */
-#undef HAVE_ZAPTEL_TRANSCODE
-
-/* Define ZAPTEL_TRANSCODE headers version */
-#undef HAVE_ZAPTEL_TRANSCODE_VERSION
-
-/* Define to indicate the ${ZAPTEL_DESCRIP} library version */
-#undef HAVE_ZAPTEL_VERSION
-
-/* Define this to indicate the ${ZAPTEL_VLDTMF_DESCRIP} library */
-#undef HAVE_ZAPTEL_VLDTMF
-
-/* Define to indicate the ${ZAPTEL_VLDTMF_DESCRIP} library version */
-#undef HAVE_ZAPTEL_VLDTMF_VERSION
-
/* Define this to indicate the ${ZLIB_DESCRIP} library */
#undef HAVE_ZLIB
A phone call through Asterisk consists of an incoming
connection and an outbound connection. Each call comes
in through a channel driver that supports one technology,
- like SIP, ZAP, IAX2 etc.
+ like SIP, DAHDI, IAX2 etc.
\par
Each channel driver, technology, has it's own private
channel or dialog structure, that is technology-dependent.
them together.
The conference bridge (meetme) handles several channels simultaneously
- with the support of an external timer (zaptel timer). This is used
+ with the support of an external timer (DAHDI timer). This is used
not only by the Conference application (meetme) but also by the
page application and the SLA system introduced in 1.4.
The conference bridge does not handle video.
*
* SIP and IAX2 has utf8 encoded Unicode caller ID names.
* In some cases, we also have an alternative (RPID) E.164 number that can be used
- * as caller ID on numeric E.164 phone networks (zaptel or SIP/IAX2 to pstn gateway).
+ * as caller ID on numeric E.164 phone networks (DAHDI or SIP/IAX2 to pstn gateway).
*
* \todo Implement settings for transliteration between UTF8 caller ID names in
- * to Ascii Caller ID's (Zaptel). Östen Åsklund might be transliterated into
+ * to Ascii Caller ID's (DAHDI). Östen Åsklund might be transliterated into
* Osten Asklund or Oesten Aasklund depending upon language and person...
* We need automatic routines for incoming calls and static settings for
* our own accounts.
See for examples:
\arg chan_iax2.c - The Inter-Asterisk exchange protocol
\arg chan_sip.c - The SIP channel driver
- \arg chan_zap.c - PSTN connectivity (TDM, PRI, T1/E1, FXO, FXS)
+ \arg chan_dahdi.c - PSTN connectivity (TDM, PRI, T1/E1, FXO, FXS)
If you develop your own channel driver, this is where you
tell the PBX at registration of your driver what properties
*/
int ast_autoservice_stop(struct ast_channel *chan);
-/* If built with zaptel optimizations, force a scheduled expiration on the
+/* If built with dahdi optimizations, force a scheduled expiration on the
timer fd, at which point we call the callback function / data */
int ast_settimeout(struct ast_channel *c, int samples, int (*func)(const void *data), void *data);
*/
/*! \file
- * \brief Stub to find zaptel headers
+ * \brief Stub to find DAHDI headers
*
- * Stub to find the zaptel headers. The configure script will
- * define HAVE_ZAPTEL_VERSION according to what it has found.
- * Applications should include "zapata.h" and not (directly)
- * <foo/zaptel.h> or <foo/tonezone.h>.
+ * Stub to find the DAHDI headers. The configure script will
+ * define HAVE_DAHDI_VERSION according to what it has found.
+ * Applications should include "user.h" and not (directly)
+ * <foo/user.h>
* For the mapping of version numbers to location see below.
*
*/
-#ifndef _AST_ZAPATA_H
-#define _AST_ZAPATA_H
+#ifndef _AST_DAHDI_H
+#define _AST_DAHDI_H
-#ifdef HAVE_ZAPTEL
+#ifdef HAVE_DAHDI
#include <sys/ioctl.h>
-#if defined(HAVE_ZAPTEL_VERSION) && HAVE_ZAPTEL_VERSION < 100
-/* Very old versions of zaptel drivers on FreeBSD install in ${PREFIX} */
-#include <zaptel.h>
-#include <tonezone.h>
-#else
-/* newer versions install in ${PREFIX}/zaptel */
-#include <zaptel/zaptel.h>
-#include <zaptel/tonezone.h>
-#endif /* HAVE_ZAPTEL_VERSION < 100 */
+/* newer versions install in ${PREFIX}/dahdi */
+#include <dahdi/user.h>
+#include <dahdi/tonezone.h>
-#endif /* HAVE_ZAPTEL */
+#endif /* HAVE_DAHDI */
-#endif /* _AST_ZAPATA_H */
+#endif /* _AST_DAHDI_H */
* \arg \link Config_sip SIP configuration \endlink
* \arg \link Config_mgcp MGCP configuration \endlink
* \arg \link Config_rtp RTP configuration \endlink
- * \arg \link Config_zap Zaptel configuration \endlink
+ * \arg \link Config_dahdi DAHDI configuration \endlink
* \arg \link Config_oss OSS (sound card) configuration \endlink
* \arg \link Config_alsa ALSA (sound card) configuration \endlink
* \arg \link Config_agent Agent (proxy channel) configuration \endlink
* \verbinclude voicemail.conf.sample
*/
-/*! \page Config_zap Zaptel configuration
- * \section zapconf zapata.conf
- * \arg Implemented in \ref chan_zap.c
- * \verbinclude zapata.conf.sample
+/*! \page Config_dahdi DAHDI configuration
+ * \section dahdiconf dahdi.conf
+ * \arg Implemented in \ref chan_dahdi.c
+ * \verbinclude dahdi.conf.sample
*/
/*! \page Config_h323 H.323 channel driver information
*
* This is called from ast_frame_free if AST_FRFLAG_FROM_DSP is set. This occurs
* because it is possible for the dsp to be freed while someone still holds a reference
- * to the frame that is in that dsp. This has been known to happen when the dsp on a Zap
+ * to the frame that is in that dsp. This has been known to happen when the dsp on a DAHDI
* channel detects a busy signal. The channel is hung up, and the application that read the
* frame to begin with still has a reference to the frame.
*
#define AST_CACHE_DIR_LEN 512
#define AST_FILENAME_MAX 80
+#define AST_CHANNEL_NAME 80 /*!< Max length of an ast_channel name */
+
/*! \ingroup main_options */
enum ast_option_flags {
AST_OPT_FLAG_DONT_WARN = (1 << 18),
/*! End CDRs before the 'h' extension */
AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN = (1 << 19),
- /*! Use Zaptel Timing for generators if available */
+ /*! Use DAHDI Timing for generators if available */
AST_OPT_FLAG_INTERNAL_TIMING = (1 << 20),
/*! Always fork, even if verbose or debug settings are non-zero */
AST_OPT_FLAG_ALWAYS_FORK = (1 << 21),
extern pid_t ast_mainpid;
extern char record_cache_dir[AST_CACHE_DIR_LEN];
+extern char dahdi_chan_name[AST_CHANNEL_NAME];
extern int ast_language_is_prefix;
#include <sys/loadavg.h>
#endif
-#include "asterisk/zapata.h"
+#include "asterisk/dahdi.h"
#ifdef linux
#include <sys/prctl.h>
#if defined(HAVE_SYSINFO)
long option_minmemfree; /*!< Minimum amount of free system memory - stop accepting calls if free memory falls below this watermark */
#endif
+char dahdi_chan_name[AST_CHANNEL_NAME] = "ZAP";
/*! @} */
printf(" -g Dump core in case of a crash\n");
printf(" -h This help screen\n");
printf(" -i Initialize crypto keys at startup\n");
- printf(" -I Enable internal timing if Zaptel timer is available\n");
+ printf(" -I Enable internal timing if DAHDI timer is available\n");
printf(" -L <load> Limit the maximum load average before rejecting new calls\n");
printf(" -M <value> Limit the maximum number of calls to the specified value\n");
printf(" -m Mute debugging and console output on the console\n");
option_minmemfree = 0;
}
#endif
+ } else if (!strcasecmp(v->name, "dahdichanname")) {
+ if (!strcasecmp(v->value, "yes")) {
+ ast_copy_string(dahdi_chan_name, "DAHDI", sizeof(dahdi_chan_name));
+ }
} else if (!strcasecmp(v->name, "entityid")) {
struct ast_eid tmp_eid;
if (!ast_str_to_eid(&tmp_eid, v->value)) {
printf("%s", term_quit());
exit(1);
}
-#ifdef HAVE_ZAPTEL
+#ifdef HAVE_DAHDI
{
int fd;
int x = 160;
- fd = open("/dev/zap/timer", O_RDWR);
+ fd = open("/dev/dahdi/timer", O_RDWR);
if (fd >= 0) {
- if (ioctl(fd, ZT_TIMERCONFIG, &x)) {
- ast_log(LOG_ERROR, "You have Zaptel built and drivers loaded, but the Zaptel timer test failed to set ZT_TIMERCONFIG to %d.\n", x);
+ if (ioctl(fd, DAHDI_TIMERCONFIG, &x)) {
+ ast_log(LOG_ERROR, "You have DAHDI built and drivers loaded, but the DAHDI timer test failed to set DAHDI_TIMERCONFIG to %d.\n", x);
exit(1);
}
if ((x = ast_wait_for_input(fd, 300)) < 0) {
- ast_log(LOG_ERROR, "You have Zaptel built and drivers loaded, but the Zaptel timer could not be polled during the Zaptel timer test.\n");
+ ast_log(LOG_ERROR, "You have DAHDI built and drivers loaded, but the DAHDI timer could not be polled during the DAHDI timer test.\n");
exit(1);
}
if (!x) {
- const char zaptel_timer_error[] = {
- "Asterisk has detected a problem with your Zaptel configuration and will shutdown for your protection. You have options:"
- "\n\t1. You only have to compile Zaptel support into Asterisk if you need it. One option is to recompile without Zaptel support."
- "\n\t2. You only have to load Zaptel drivers if you want to take advantage of Zaptel services. One option is to unload zaptel modules if you don't need them."
- "\n\t3. If you need Zaptel services, you must correctly configure Zaptel."
+ const char dahdi_timer_error[] = {
+ "Asterisk has detected a problem with your DAHDI configuration and will shutdown for your protection. You have options:"
+ "\n\t1. You only have to compile DAHDI support into Asterisk if you need it. One option is to recompile without DAHDI support."
+ "\n\t2. You only have to load DAHDI drivers if you want to take advantage of DAHDI services. One option is to unload DAHDI modules if you don't need them."
+ "\n\t3. If you need DAHDI services, you must correctly configure DAHDI."
};
- ast_log(LOG_ERROR, "%s\n", zaptel_timer_error);
+ ast_log(LOG_ERROR, "%s\n", dahdi_timer_error);
usleep(100);
exit(1);
}
#include <math.h>
#include "asterisk/paths.h" /* use ast_config_AST_SYSTEM_NAME */
-#include "asterisk/zapata.h"
+#include "asterisk/dahdi.h"
#include "asterisk/pbx.h"
#include "asterisk/frame.h"
#endif
}
-#ifdef HAVE_ZAPTEL
- tmp->timingfd = open("/dev/zap/timer", O_RDWR);
+#ifdef HAVE_DAHDI
+ tmp->timingfd = open("/dev/dahdi/timer", O_RDWR);
if (tmp->timingfd > -1) {
/* Check if timing interface supports new
ping/pong scheme */
flags = 1;
- if (!ioctl(tmp->timingfd, ZT_TIMERPONG, &flags))
+ if (!ioctl(tmp->timingfd, DAHDI_TIMERPONG, &flags))
needqueue = 0;
}
#else
if (pipe(tmp->alertpipe)) {
ast_log(LOG_WARNING, "Channel allocation failed: Can't create alert pipe!\n");
alertpipe_failed:
-#ifdef HAVE_ZAPTEL
+#ifdef HAVE_DAHDI
if (tmp->timingfd > -1)
close(tmp->timingfd);
#endif
if (write(chan->alertpipe[1], &blah, sizeof(blah)) != sizeof(blah))
ast_log(LOG_WARNING, "Unable to write to alert pipe on %s, frametype/subclass %d/%d (qlen = %d): %s!\n",
chan->name, f->frametype, f->subclass, qlen, strerror(errno));
-#ifdef HAVE_ZAPTEL
+#ifdef HAVE_DAHDI
} else if (chan->timingfd > -1) {
- ioctl(chan->timingfd, ZT_TIMERPING, &blah);
+ ioctl(chan->timingfd, DAHDI_TIMERPING, &blah);
#endif
} else if (ast_test_flag(chan, AST_FLAG_BLOCKING)) {
pthread_kill(chan->blocker, SIGURG);
int ast_settimeout(struct ast_channel *c, int samples, int (*func)(const void *data), void *data)
{
int res = -1;
-#ifdef HAVE_ZAPTEL
+#ifdef HAVE_DAHDI
if (c->timingfd > -1) {
if (!func) {
samples = 0;
data = 0;
}
ast_debug(1, "Scheduling timer at %d sample intervals\n", samples);
- res = ioctl(c->timingfd, ZT_TIMERCONFIG, &samples);
+ res = ioctl(c->timingfd, DAHDI_TIMERCONFIG, &samples);
c->timingfunc = func;
c->timingdata = data;
}
read(chan->alertpipe[0], &blah, sizeof(blah));
}
-#ifdef HAVE_ZAPTEL
+#ifdef HAVE_DAHDI
if (chan->timingfd > -1 && chan->fdno == AST_TIMING_FD && ast_test_flag(chan, AST_FLAG_EXCEPTION)) {
int res;
ast_clear_flag(chan, AST_FLAG_EXCEPTION);
blah = -1;
/* IF we can't get event, assume it's an expired as-per the old interface */
- res = ioctl(chan->timingfd, ZT_GETEVENT, &blah);
+ res = ioctl(chan->timingfd, DAHDI_GETEVENT, &blah);
if (res)
- blah = ZT_EVENT_TIMER_EXPIRED;
+ blah = DAHDI_EVENT_TIMER_EXPIRED;
- if (blah == ZT_EVENT_TIMER_PING) {
+ if (blah == DAHDI_EVENT_TIMER_PING) {
if (AST_LIST_EMPTY(&chan->readq) || !AST_LIST_NEXT(AST_LIST_FIRST(&chan->readq), frame_list)) {
/* Acknowledge PONG unless we need it again */
- if (ioctl(chan->timingfd, ZT_TIMERPONG, &blah)) {
+ if (ioctl(chan->timingfd, DAHDI_TIMERPONG, &blah)) {
ast_log(LOG_WARNING, "Failed to pong timer on '%s': %s\n", chan->name, strerror(errno));
}
}
- } else if (blah == ZT_EVENT_TIMER_EXPIRED) {
- ioctl(chan->timingfd, ZT_TIMERACK, &blah);
+ } else if (blah == DAHDI_EVENT_TIMER_EXPIRED) {
+ ioctl(chan->timingfd, DAHDI_TIMERACK, &blah);
if (chan->timingfunc) {
/* save a copy of func/data before unlocking the channel */
int (*func)(const void *) = chan->timingfunc;
func(data);
} else {
blah = 0;
- ioctl(chan->timingfd, ZT_TIMERCONFIG, &blah);
+ ioctl(chan->timingfd, DAHDI_TIMERCONFIG, &blah);
chan->timingdata = NULL;
ast_channel_unlock(chan);
}
return NULL;
}
+ if (!strcasecmp(type, "Zap")) {
+ type = "DAHDI";
+ ast_log(LOG_NOTICE, "Zap interface translated to DAHDI.\n");
+ }
+
AST_LIST_TRAVERSE(&backends, chan, list) {
if (strcasecmp(type, chan->tech->type))
continue;
if (pu->peername[0]) {
char *peername = ast_strdupa(pu->peername);
char *cp = strrchr(peername, '-');
- char peername_flat[AST_MAX_EXTENSION]; /* using something like Zap/52 for an extension name is NOT a good idea */
+ char peername_flat[AST_MAX_EXTENSION]; /* using something like DAHDI/52 for an extension name is NOT a good idea */
int i;
if (cp)
}
}
if (whennext != s->lasttimeout) {
-#ifdef HAVE_ZAPTEL
+#ifdef HAVE_DAHDI
if (s->owner->timingfd > -1) {
int zap_timer_samples = whennext;
int rate;
- /* whennext is in samples, but zaptel timers operate in 8 kHz samples. */
+ /* whennext is in samples, but DAHDI timers operate in 8 kHz samples. */
if ((rate = ast_format_rate(s->fmt->format)) != 8000) {
float factor;
factor = ((float) rate) / ((float) 8000.0);
return_failure:
s->owner->streamid = -1;
-#ifdef HAVE_ZAPTEL
+#ifdef HAVE_DAHDI
ast_settimeout(s->owner, 0, NULL, NULL);
#endif
return FSREAD_FAILURE;
if (f->fmt->format & AST_FORMAT_AUDIO_MASK) {
f->owner->stream = NULL;
AST_SCHED_DEL(f->owner->sched, f->owner->streamid);
-#ifdef HAVE_ZAPTEL
+#ifdef HAVE_DAHDI
ast_settimeout(f->owner, 0, NULL, NULL);
#endif
} else {
return order;
}
+
+static int translate_module_name(const char *oldname, char *newname)
+{
+ if (!strcasecmp(oldname, "app_zapbarge.so"))
+ ast_copy_string(newname, "app_dahdibarge.so", 18);
+ else if(!strcasecmp(oldname, "app_zapras.so"))
+ ast_copy_string(newname, "app_dahdiras.so", 16);
+ else if(!strcasecmp(oldname, "app_zapscan.so"))
+ ast_copy_string(newname, "app_dahdiscan.so", 17);
+ else if(!strcasecmp(oldname, "codec_zap.so"))
+ ast_copy_string(newname, "codec_dahdi.so", 16);
+ else
+ return -1; /* no use for newname, oldname is fine */
+
+ return 0;
+}
+
int load_modules(unsigned int preload_only)
{
struct ast_config *cfg;
int res = 0;
struct ast_flags config_flags = { 0 };
int modulecount = 0;
+
+ int translate_status;
+ char newname[18]; /* although this would normally be 80, max length in translate_module_name is 18 */
#ifdef LOADABLE_MODULES
struct dirent *dirent;
DIR *dir;
/* first, find all the modules we have been explicitly requested to load */
for (v = ast_variable_browse(cfg, "modules"); v; v = v->next) {
- if (!strcasecmp(v->name, preload_only ? "preload" : "load"))
- add_to_load_order(v->value, &load_order);
+ if (!strcasecmp(v->name, preload_only ? "preload" : "load")) {
+ translate_status = translate_module_name(v->value, newname);
+ if (!translate_status)
+ ast_log(LOG_WARNING, "Use of old module name %s is deprecated, please use %s instead.\n", v->value, newname);
+ add_to_load_order(translate_status ? v->value : newname, &load_order);
+ }
}
/* check if 'autoload' is on */
continue;
AST_LIST_TRAVERSE_SAFE_BEGIN(&load_order, order, entry) {
- if (!resource_name_match(order->resource, v->value)) {
+ translate_status = translate_module_name(v->value, newname);
+ if (!resource_name_match(order->resource, translate_status ? v->value : newname)) {
+ if (!translate_status)
+ ast_log(LOG_WARNING, "Use of old module name %s is deprecated, please use %s instead.\n", v->value, newname);
AST_LIST_REMOVE_CURRENT(entry);
ast_free(order->resource);
ast_free(order);
VPBAPI_INCLUDE=@VPB_INCLUDE@
VPBAPI_LIB=@VPB_LIB@
-ZAPTEL_INCLUDE=@ZAPTEL_INCLUDE@
+DAHDI_INCLUDE=@DAHDI_INCLUDE@
ZLIB_INCLUDE=@ZLIB_INCLUDE@
ZLIB_LIB=@ZLIB_LIB@
{
struct ast_config *cfg;
char *cat, *chan;
- const char *zapchan;
+ const char *dahdichan;
const char *hasexten;
char tmp[256];
char iface[256];
- char zapcopy[256];
+ char dahdicopy[256];
char *c;
int len;
int hasvoicemail;
if (hasexten && !ast_true(hasexten))
continue;
hasvoicemail = ast_true(ast_config_option(cfg, cat, "hasvoicemail"));
- zapchan = ast_variable_retrieve(cfg, cat, "zapchan");
- if (!zapchan)
- zapchan = ast_variable_retrieve(cfg, "general", "zapchan");
- if (!ast_strlen_zero(zapchan)) {
- ast_copy_string(zapcopy, zapchan, sizeof(zapcopy));
- c = zapcopy;
+ dahdichan = ast_variable_retrieve(cfg, cat, "dahdichan");
+ if (!dahdichan)
+ dahdichan = ast_variable_retrieve(cfg, "general", "dahdichan");
+ if (!dahdichan) {
+ /* no dahdichan, but look for zapchan too */
+ dahdichan = ast_variable_retrieve(cfg, cat, "zapchan");
+ if (!dahdichan) {
+ dahdichan = ast_variable_retrieve(cfg, "general", "zapchan");
+ }
+ if (!ast_strlen_zero(dahdichan)) {
+ ast_log(LOG_WARNING, "Use of zapchan in users.conf is deprecated. Please update configuration to use dahdichan instead.\n");
+ }
+ }
+ if (!ast_strlen_zero(dahdichan)) {
+ ast_copy_string(dahdicopy, dahdichan, sizeof(dahdicopy));
+ c = dahdicopy;
chan = strsep(&c, ",");
while (chan) {
if (sscanf(chan, "%d-%d", &start, &finish) == 2) {
start = x;
}
for (x = start; x <= finish; x++) {
- snprintf(tmp, sizeof(tmp), "Zap/%d", x);
+ snprintf(tmp, sizeof(tmp), "DAHDI/%d", x);
append_interface(iface, sizeof(iface), tmp);
}
chan = strsep(&c, ",");
/*** MODULEINFO
<conflict>win32</conflict>
- <use>zaptel</use>
+ <use>dahdi</use>
***/
#include "asterisk.h"
#include <thread.h>
#endif
-#include "asterisk/zapata.h"
+#include "asterisk/dahdi.h"
#include "asterisk/lock.h"
#include "asterisk/file.h"
static int moh_register(struct mohclass *moh, int reload)
{
-#ifdef HAVE_ZAPTEL
+#ifdef HAVE_DAHDI
int x;
#endif
struct mohclass *mohclass = NULL;
ast_set_flag(moh, MOH_QUIET);
moh->srcfd = -1;
-#ifdef HAVE_ZAPTEL
- /* Open /dev/zap/pseudo for timing... Is
+#ifdef HAVE_DAHDI
+ /* Open /dev/dahdi/pseudo for timing... Is
there a better, yet reliable way to do this? */
- moh->pseudofd = open("/dev/zap/pseudo", O_RDONLY);
+ moh->pseudofd = open("/dev/dahdi/pseudo", O_RDONLY);
if (moh->pseudofd < 0) {
ast_log(LOG_WARNING, "Unable to open pseudo channel for timing... Sound may be choppy.\n");
} else {
x = 320;
- ioctl(moh->pseudofd, ZT_SET_BLOCKSIZE, &x);
+ ioctl(moh->pseudofd, DAHDI_SET_BLOCKSIZE, &x);
}
#else
moh->pseudofd = -1;
struct ast_variable *var = NULL;
struct ast_variable *tmp = NULL;
struct moh_files_state *state = chan->music_state;
-#ifdef HAVE_ZAPTEL
+#ifdef HAVE_DAHDI
int x;
#endif
ast_set_flag(mohclass, MOH_QUIET);
mohclass->srcfd = -1;
-#ifdef HAVE_ZAPTEL
- /* Open /dev/zap/pseudo for timing... Is
+#ifdef HAVE_DAHDI
+ /* Open /dev/dahdi/pseudo for timing... Is
there a better, yet reliable way to do this? */
- mohclass->pseudofd = open("/dev/zap/pseudo", O_RDONLY);
+ mohclass->pseudofd = open("/dev/dahdi/pseudo", O_RDONLY);
if (mohclass->pseudofd < 0) {
ast_log(LOG_WARNING, "Unable to open pseudo channel for timing... Sound may be choppy.\n");
} else {
x = 320;
- ioctl(mohclass->pseudofd, ZT_SET_BLOCKSIZE, &x);
+ ioctl(mohclass->pseudofd, DAHDI_SET_BLOCKSIZE, &x);
}
#else
mohclass->pseudofd = -1;
AST_OPT_FLAG_DONT_WARN = (1 << 18),
/*! End CDRs before the 'h' extension */
AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN = (1 << 19),
- /*! Use Zaptel Timing for generators if available */
+ /*! Use DAHDI Timing for generators if available */
AST_OPT_FLAG_INTERNAL_TIMING = (1 << 20),
/*! Always fork, even if verbose or debug settings are non-zero */
AST_OPT_FLAG_ALWAYS_FORK = (1 << 21),