aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/app_chanisavail.c2
-rw-r--r--apps/app_chanspy.c25
-rw-r--r--apps/app_dahdiras.c (renamed from apps/app_zapras.c)48
-rw-r--r--apps/app_dahdiscan.c (renamed from apps/app_zapscan.c)94
-rw-r--r--apps/app_dial.c10
-rw-r--r--apps/app_fax.c741
-rw-r--r--apps/app_flash.c38
-rw-r--r--apps/app_getcpeid.c2
-rw-r--r--apps/app_meetme.c186
-rw-r--r--apps/app_page.c2
-rw-r--r--apps/app_queue.c4
-rw-r--r--apps/app_rpt.c134
12 files changed, 274 insertions, 1012 deletions
diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c
index d0b29bdd2..3425bc35a 100644
--- a/apps/app_chanisavail.c
+++ b/apps/app_chanisavail.c
@@ -71,7 +71,7 @@ static int chanavail_exec(struct ast_channel *chan, void *data)
);
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;
}
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 458f1cea3..992059a4e 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -47,6 +47,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/translate.h"
#include "asterisk/module.h"
#include "asterisk/lock.h"
+#include "asterisk/options.h"
#define AST_NAME_STRLEN 256
@@ -497,30 +498,32 @@ static struct chanspy_ds *next_channel(struct ast_channel *chan,
const struct ast_channel *last, const char *spec,
const char *exten, const char *context, struct chanspy_ds *chanspy_ds)
{
- struct ast_channel *this;
+ struct ast_channel *next;
+ char channel_name[AST_CHANNEL_NAME];
redo:
if (!ast_strlen_zero(spec))
- this = ast_walk_channel_by_name_prefix_locked(last, spec, strlen(spec));
+ next = ast_walk_channel_by_name_prefix_locked(last, spec, strlen(spec));
else if (!ast_strlen_zero(exten))
- this = ast_walk_channel_by_exten_locked(last, exten, context);
+ next = ast_walk_channel_by_exten_locked(last, exten, context);
else
- this = ast_channel_walk_locked(last);
+ next = ast_channel_walk_locked(last);
- if (!this)
+ if (!next)
return NULL;
- if (!strncmp(this->name, "Zap/pseudo", 10)) {
- ast_channel_unlock(this);
+ 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 (this == chan) {
- last = this;
- ast_channel_unlock(this);
+ } else if (next == chan) {
+ last = next;
+ ast_channel_unlock(next);
goto redo;
}
- return setup_chanspy_ds(this, chanspy_ds);
+ return setup_chanspy_ds(next, chanspy_ds);
}
static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
diff --git a/apps/app_zapras.c b/apps/app_dahdiras.c
index 231a9f2a6..979724789 100644
--- a/apps/app_zapras.c
+++ b/apps/app_dahdiras.c
@@ -26,7 +26,7 @@
*/
/*** MODULEINFO
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
***/
#include "asterisk.h"
@@ -43,7 +43,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <fcntl.h>
-#include "asterisk/zapata.h"
+#include "asterisk/dahdi.h"
#include "asterisk/lock.h"
#include "asterisk/file.h"
@@ -51,15 +51,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/pbx.h"
#include "asterisk/module.h"
-static char *app = "ZapRAS";
+static char *app = "DAHDIRAS";
-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";
@@ -108,7 +108,7 @@ static pid_t spawn_ras(struct ast_channel *chan, char *args)
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";
@@ -121,7 +121,7 @@ static pid_t spawn_ras(struct ast_channel *chan, char *args)
}
argv[argc++] = "plugin";
- argv[argc++] = "zaptel.so";
+ argv[argc++] = "dahdi.so";
argv[argc++] = "stdin";
/* Finally launch PPP */
@@ -136,10 +136,10 @@ static void run_ras(struct ast_channel *chan, char *args)
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;
@@ -175,10 +175,10 @@ static void run_ras(struct ast_channel *chan, char *args)
}
/* 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);
}
@@ -187,11 +187,11 @@ static void run_ras(struct ast_channel *chan, char *args)
}
}
-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 = "";
@@ -201,16 +201,16 @@ static int zapras_exec(struct ast_channel *chan, void *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. */
@@ -229,8 +229,8 @@ static int unload_module(void)
static int load_module(void)
{
- return ((ast_register_application(app, zapras_exec, synopsis, descrip)) ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_SUCCESS);
+ 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");
diff --git a/apps/app_zapscan.c b/apps/app_dahdiscan.c
index 5367d99d1..d7b100eac 100644
--- a/apps/app_zapscan.c
+++ b/apps/app_dahdiscan.c
@@ -5,7 +5,7 @@
*
* Mark Spencer <markster@digium.com>
*
- * Modified from app_zapbarge by David Troy <dave@toad.net>
+ * Modified from app_dahdibarge by David Troy <dave@toad.net>
*
* Special thanks to comphealth.com for sponsoring this
* GPL application.
@@ -23,7 +23,7 @@
/*! \file
*
- * \brief Zap Scanner
+ * \brief DAHDI Scanner
*
* \author Mark Spencer <markster@digium.com>
*
@@ -31,14 +31,14 @@
*/
/*** 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"
@@ -51,22 +51,22 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/cli.h"
#include "asterisk/say.h"
-static char *app = "ZapScan";
+static char *app = "DAHDIScan";
-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);
}
@@ -91,7 +91,7 @@ static int careful_write(int fd, unsigned char *data, int len)
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;
@@ -100,13 +100,13 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
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;
@@ -122,11 +122,11 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
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;
@@ -136,7 +136,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
if (flags < 0) {
ast_log(LOG_WARNING, "Unable to get flags: %s\n", strerror(errno));
close(fd);
- goto outrun;
+ goto outrun;
}
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK)) {
ast_log(LOG_WARNING, "Unable to set flags: %s\n", strerror(errno));
@@ -146,48 +146,48 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
/* 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;
}
- nfds = 1;
+ nfds = 1;
} else {
/* XXX Make sure we're not running on a pseudo channel XXX */
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;
@@ -195,13 +195,13 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
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)
@@ -223,7 +223,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
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;
}
}
@@ -263,10 +263,10 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
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");
}
}
@@ -310,7 +310,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
ast_frfree(f);
ichan = NULL;
if(input) {
- ichan = get_zap_channel_locked(input);
+ ichan = get_dahdi_channel_locked(input);
input = 0;
}
@@ -329,8 +329,8 @@ static int conf_exec(struct ast_channel *chan, void *data)
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,'-'))) {
@@ -359,5 +359,5 @@ static int load_module(void)
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");
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 5dd160217..d7b21f6cb 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -168,8 +168,8 @@ static char *descrip =
" 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"
@@ -1873,9 +1873,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
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;
diff --git a/apps/app_fax.c b/apps/app_fax.c
deleted file mode 100644
index a670ccad4..000000000
--- a/apps/app_fax.c
+++ /dev/null
@@ -1,741 +0,0 @@
-/*
- * 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, 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);
- 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, 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);
-
- 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,
- );
-
-
diff --git a/apps/app_flash.c b/apps/app_flash.c
index d57feeb91..dd13f414f 100644
--- a/apps/app_flash.c
+++ b/apps/app_flash.c
@@ -18,7 +18,7 @@
/*! \file
*
- * \brief App to flash a zap trunk
+ * \brief App to flash a DAHDI trunk
*
* \author Mark Spencer <markster@digium.com>
*
@@ -26,14 +26,14 @@
*/
/*** 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"
@@ -45,22 +45,22 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
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;
}
@@ -68,23 +68,23 @@ static int flash_exec(struct ast_channel *chan, void *data)
{
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);
diff --git a/apps/app_getcpeid.c b/apps/app_getcpeid.c
index 1bab819b7..6ff051899 100644
--- a/apps/app_getcpeid.c
+++ b/apps/app_getcpeid.c
@@ -42,7 +42,7 @@ static char *synopsis = "Get ADSI CPE ID";
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)
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 8ae533d12..1dc33bd0f 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -30,14 +30,14 @@
*/
/*** 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"
@@ -229,15 +229,15 @@ static const char *descrip =
"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"
@@ -362,7 +362,7 @@ struct ast_conference {
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 */
@@ -404,7 +404,7 @@ struct ast_conf_user {
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 */
@@ -640,8 +640,8 @@ static int careful_write(int fd, unsigned char *data, int len, int block)
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)
@@ -802,7 +802,7 @@ static void conf_play(struct ast_channel *chan, struct ast_conference *conf, enu
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);
@@ -828,11 +828,11 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin
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);
@@ -841,17 +841,17 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin
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);
@@ -868,7 +868,7 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin
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 */
@@ -1310,8 +1310,8 @@ static void conf_flush(int fd, struct ast_channel *chan)
}
/* 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");
}
@@ -1480,7 +1480,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
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;
@@ -1489,7 +1489,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
int nfds;
int res;
int flags;
- int retryzap;
+ int retrydahdi;
int origfd;
int musiconhold = 0;
int firstpass = 0;
@@ -1516,7 +1516,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
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;
@@ -1625,13 +1625,13 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
}
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;
@@ -1805,13 +1805,13 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
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;
@@ -1832,16 +1832,16 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
/* 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;
@@ -1852,27 +1852,27 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
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);
@@ -1886,21 +1886,21 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
}
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",
@@ -1937,8 +1937,8 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
if (!agifile)
agifile = agifiledefault;
- 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);
}
@@ -1951,14 +1951,14 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
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);
}
@@ -2109,8 +2109,8 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
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;
@@ -2125,12 +2125,12 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
/* 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;
@@ -2174,9 +2174,9 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
/* 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;
@@ -2192,9 +2192,9 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
}
/* 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;
@@ -2253,16 +2253,16 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
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);
@@ -2328,7 +2328,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int 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);
@@ -2483,7 +2483,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
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);
@@ -2595,10 +2595,10 @@ bailoutandtrynormal:
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");
}
}
@@ -2800,13 +2800,13 @@ static struct ast_conference *find_conf_realtime(struct ast_channel *chan, char
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);
}
}
@@ -2898,13 +2898,13 @@ static struct ast_conference *find_conf(struct ast_channel *chan, char *confno,
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);
}
}
@@ -3688,9 +3688,9 @@ static void load_config_meetme(void)
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)
diff --git a/apps/app_page.c b/apps/app_page.c
index 5db858ce9..9f94b491d 100644
--- a/apps/app_page.c
+++ b/apps/app_page.c
@@ -26,7 +26,7 @@
*/
/*** MODULEINFO
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
<depend>app_meetme</depend>
***/
diff --git a/apps/app_queue.c b/apps/app_queue.c
index bf020331d..1b08165fd 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -3285,9 +3285,9 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
/* 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);
diff --git a/apps/app_rpt.c b/apps/app_rpt.c
index 1246e39e8..1671d699e 100644
--- a/apps/app_rpt.c
+++ b/apps/app_rpt.c
@@ -116,7 +116,7 @@
*/
/*** MODULEINFO
- <depend>zaptel</depend>
+ <depend>dahdi</depend>
<depend>tonezone</depend>
<defaultenabled>no</defaultenabled>
***/
@@ -236,7 +236,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/localtime.h"
#include "asterisk/app.h"
-#include "asterisk/zapata.h"
+#include "asterisk/dahdi.h"
static char *app = "Rpt";
@@ -1634,13 +1634,13 @@ static int send_morse(struct ast_channel *chan, const char *string, int speed, i
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;
@@ -1685,13 +1685,13 @@ static int send_tone_telemetry(struct ast_channel *chan, const char *tonestring)
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;
@@ -1892,7 +1892,7 @@ static void wait_interval(struct rpt *myrpt, int type, struct ast_channel *chan)
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;
@@ -1936,9 +1936,9 @@ static void *rpt_tele_thread(void *this)
ci.confno = (((mytele->mode == ID) || (mytele->mode == IDTALKOVER) || (mytele->mode == UNKEY) ||
(mytele->mode == TAILMSG)) ?
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);
remque((struct qelem *)mytele);
@@ -2118,9 +2118,9 @@ static void *rpt_tele_thread(void *this)
/* 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);
remque((struct qelem *)mytele);
@@ -2145,9 +2145,9 @@ static void *rpt_tele_thread(void *this)
/* 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);
remque((struct qelem *)mytele);
@@ -2525,7 +2525,7 @@ static void rpt_telemetry(struct rpt *myrpt, int mode, void *data)
static void *rpt_call(void *this)
{
- ZT_CONFINFO ci; /* conference info */
+ DAHDI_CONFINFO ci; /* conference info */
struct rpt *myrpt = (struct rpt *)this;
int res;
struct ast_frame wf;
@@ -2541,10 +2541,10 @@ static void *rpt_call(void *this)
}
ci.chan = 0;
ci.confno = myrpt->conf; /* use the pseudo conference */
- 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(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);
myrpt->callmode = 0;
@@ -2559,10 +2559,10 @@ static void *rpt_call(void *this)
}
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);
ast_hangup(genchannel);
@@ -2584,7 +2584,7 @@ static void *rpt_call(void *this)
pthread_exit(NULL);
}
/* start dialtone if patchquiet is 0. Special patch modes don't send dial tone */
- if ((!myrpt->patchquiet) && (tone_zone_play_tone(mychannel->fds[0], ZT_TONE_DIALTONE) < 0)) {
+ if ((!myrpt->patchquiet) && (tone_zone_play_tone(mychannel->fds[0], DAHDI_TONE_DIALTONE) < 0)) {
ast_log(LOG_WARNING, "Cannot start dialtone\n");
ast_hangup(mychannel);
ast_hangup(genchannel);
@@ -2620,7 +2620,7 @@ static void *rpt_call(void *this)
if (!congstarted) {
congstarted = 1;
/* start congestion tone */
- tone_zone_play_tone(mychannel->fds[0], ZT_TONE_CONGESTION);
+ tone_zone_play_tone(mychannel->fds[0], DAHDI_TONE_CONGESTION);
}
}
res = ast_safe_sleep(mychannel, MSWAIT);
@@ -2689,10 +2689,10 @@ static void *rpt_call(void *this)
/* 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);
ast_hangup(genchannel);
@@ -2712,7 +2712,7 @@ static void *rpt_call(void *this)
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);
}
}
@@ -2744,10 +2744,10 @@ static void *rpt_call(void *this)
/* 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");
}
pthread_exit(NULL);
@@ -2805,7 +2805,7 @@ static int function_ilink(struct rpt *myrpt, char *param, char *digits, int comm
char digitbuf[MAXNODESTR];
struct rpt_link *l;
int reconnects = 0;
- ZT_CONFINFO ci; /* conference info */
+ DAHDI_CONFINFO ci; /* conference info */
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(s1);
AST_APP_ARG(s2); /* XXX Never used. Scratch? XXX */
@@ -2959,9 +2959,9 @@ static int function_ilink(struct rpt *myrpt, char *param, char *digits, int comm
/* make a conference for the pseudo-one */
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);
ast_hangup(l->pchan);
@@ -3070,9 +3070,9 @@ static int function_ilink(struct rpt *myrpt, char *param, char *digits, int comm
/* 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);
ast_hangup(l->pchan);
@@ -3927,18 +3927,18 @@ static void rbi_out_parallel(struct rpt *myrpt, unsigned char *data)
static void rbi_out(struct rpt *myrpt, unsigned char *data)
{
- struct zt_radio_param r = { 0, };
+ struct dahdi_radio_param r = { 0, };
- r.radpar = ZT_RADPAR_REMMODE;
- r.data = ZT_RADPAR_REM_RBI1;
+ r.radpar = DAHDI_RADPAR_REMMODE;
+ r.data = DAHDI_RADPAR_REM_RBI1;
/* if setparam ioctl fails, its probably not a pciradio card */
- if (ioctl(myrpt->rxchannel->fds[0], ZT_RADIO_SETPARAM, &r) == -1) {
+ if (ioctl(myrpt->rxchannel->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->rxchannel->fds[0], ZT_RADIO_SETPARAM, &r) == -1) {
+ if (ioctl(myrpt->rxchannel->fds[0], DAHDI_RADIO_SETPARAM, &r) == -1) {
ast_log(LOG_WARNING, "Cannot send RBI command for channel %s\n", myrpt->rxchannel->name);
return;
}
@@ -3947,7 +3947,7 @@ static void rbi_out(struct rpt *myrpt, unsigned char *data)
static int serial_remote_io(struct rpt *myrpt, unsigned char *txbuf, int txbytes, char *rxbuf, int rxmaxbytes, int asciiflag)
{
int i;
- struct zt_radio_param prm;
+ struct dahdi_radio_param prm;
char *buf = alloca(30 + txbytes * 3);
int len;
@@ -3958,18 +3958,18 @@ static int serial_remote_io(struct rpt *myrpt, unsigned char *txbuf, int txbytes
strcat(buf + len, "\n");
ast_debug(1, "%s", buf);
- prm.radpar = ZT_RADPAR_REMMODE;
+ prm.radpar = DAHDI_RADPAR_REMMODE;
if (asciiflag)
- prm.data = ZT_RADPAR_REM_SERIAL_ASCII;
+ prm.data = DAHDI_RADPAR_REM_SERIAL_ASCII;
else
- prm.data = ZT_RADPAR_REM_SERIAL;
- if (ioctl(myrpt->rxchannel->fds[0], ZT_RADIO_SETPARAM, &prm) == -1)
+ prm.data = DAHDI_RADPAR_REM_SERIAL;
+ if (ioctl(myrpt->rxchannel->fds[0], DAHDI_RADIO_SETPARAM, &prm) == -1)
return -1;
- prm.radpar = ZT_RADPAR_REMCOMMAND;
+ prm.radpar = DAHDI_RADPAR_REMCOMMAND;
prm.data = rxmaxbytes;
memcpy(prm.buf, txbuf, txbytes);
prm.index = txbytes;
- if (ioctl(myrpt->rxchannel->fds[0], ZT_RADIO_SETPARAM, &prm) == -1)
+ if (ioctl(myrpt->rxchannel->fds[0], DAHDI_RADIO_SETPARAM, &prm) == -1)
return -1;
if (rxbuf) {
*rxbuf = 0;
@@ -4581,9 +4581,9 @@ static int rmt_telem_start(struct rpt *myrpt, struct ast_channel *chan, int dela
static int rmt_telem_finish(struct rpt *myrpt, struct ast_channel *chan)
{
- struct zt_params par;
+ struct dahdi_params par;
- if (ioctl(myrpt->txchannel->fds[0], ZT_GET_PARAMS, &par) == -1) {
+ if (ioctl(myrpt->txchannel->fds[0], DAHDI_GET_PARAMS, &par) == -1) {
return -1;
}
@@ -5657,7 +5657,7 @@ static void *rpt(void *this)
const char *idtalkover;
int ms = MSWAIT, i, lasttx=0, val, remrx=0, identqueued, othertelemqueued, tailmessagequeued, ctqueued;
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;
@@ -5779,9 +5779,9 @@ static void *rpt(void *this)
/* 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->txchannel->fds[0], ZT_SETCONF, &ci) == -1) {
+ if (ioctl(myrpt->txchannel->fds[0], DAHDI_SETCONF, &ci) == -1) {
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
rpt_mutex_unlock(&myrpt->lock);
ast_hangup(myrpt->pchannel);
@@ -5796,10 +5796,10 @@ static void *rpt(void *this)
/* 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);
ast_hangup(myrpt->pchannel);
@@ -5826,9 +5826,9 @@ static void *rpt(void *this)
/* 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);
ast_hangup(myrpt->txpchannel);
@@ -6816,8 +6816,8 @@ static int rpt_exec(struct ast_channel *chan, void *data)
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;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(node);
@@ -7055,9 +7055,9 @@ static int rpt_exec(struct ast_channel *chan, void *data)
/* 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);
}
@@ -7179,13 +7179,13 @@ static int rpt_exec(struct ast_channel *chan, void *data)
/* if we are on 2w loop and are a remote, turn EC on */
if (myrpt->remote && (myrpt->rxchannel == myrpt->txchannel)) {
i = 128;
- ioctl(myrpt->rxchannel->fds[0], ZT_ECHOCANCEL, &i);
+ ioctl(myrpt->rxchannel->fds[0], DAHDI_ECHOCANCEL, &i);
}
if (chan->_state != AST_STATE_UP) {
ast_answer(chan);
}
- if (ioctl(myrpt->txchannel->fds[0], ZT_GET_PARAMS, &par) != -1) {
+ if (ioctl(myrpt->txchannel->fds[0], DAHDI_GET_PARAMS, &par) != -1) {
if (par.rxisoffhook) {
ast_indicate(chan, AST_CONTROL_RADIO_KEY);
myrpt->remoterx = 1;