Adds DAHDI support alongside Zaptel. DAHDI usage favored, but all Zap stuff should continue working. Release announcement to follow.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Jeff Peeler 17 years ago
parent 9f669a3a09
commit f9818af8dd

@ -101,6 +101,54 @@ if test "${USE_$1}" != "no"; then
fi
])
# The next three functions check for the availability of a given package.
# AST_C_DEFINE_CHECK looks for the presence of a #define in a header file,
# AST_C_COMPILE_CHECK can be used for testing for various items in header files,
# AST_EXT_LIB_CHECK looks for a symbol in a given library, or at least
# for the presence of a header file.
# AST_EXT_TOOL_CHECK looks for a symbol in using $1-config to determine CFLAGS and LIBS
#
# They are only run if PBX_$1 != 1 (where $1 is the package),
# so you can call them multiple times and stop at the first matching one.
# On success, they both set PBX_$1 = 1, set $1_INCLUDE and $1_LIB as applicable,
# and also #define HAVE_$1 1 and #define HAVE_$1_VERSION ${last_argument}
# in autoconfig.h so you can tell which test succeeded.
# They should be called after AST_EXT_LIB_SETUP($1, ...)
# Check if a given macro is defined in a certain header.
# AST_C_DEFINE_CHECK([package], [macro name], [header file], [version])
AC_DEFUN([AST_C_DEFINE_CHECK],
[
if test "x${PBX_$1}" != "x1"; then
AC_MSG_CHECKING([for $2 in $3])
saved_cppflags="${CPPFLAGS}"
if test "x${$1_DIR}" != "x"; then
$1_INCLUDE="-I${$1_DIR}/include"
fi
CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM( [#include <$3>],
[#if defined($2)
int foo = 0;
#else
int foo = bar;
#endif
0
])],
[ AC_MSG_RESULT(yes)
PBX_$1=1
AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])
],
[ AC_MSG_RESULT(no) ]
)
CPPFLAGS="${saved_cppflags}"
fi
AC_SUBST(PBX_$1)
])
# AST_C_COMPILE_CHECK can be used for testing for various items in header files
# AST_C_COMPILE_CHECK([package], [expression], [header file], [version])

@ -461,6 +461,7 @@ static struct chanspy_ds *next_channel(struct ast_channel *chan,
const char *exten, const char *context, struct chanspy_ds *chanspy_ds)
{
struct ast_channel *this;
char channel_name[AST_CHANNEL_NAME];
redo:
if (spec)
@ -473,7 +474,8 @@ redo:
if (!this)
return NULL;
if (!strncmp(this->name, "Zap/pseudo", 10)) {
snprintf(channel_name, AST_CHANNEL_NAME, "%s/pseudo", dahdi_chan_name);
if (!strncmp(this->name, channel_name, 10)) {
ast_channel_unlock(this);
goto redo;
} else if (this == chan) {

@ -32,7 +32,7 @@
*/
/*** MODULEINFO
<depend>zaptel</depend>
<depend>dahdi</depend>
***/
#include "asterisk.h"
@ -45,7 +45,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <unistd.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <zaptel/zaptel.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
@ -60,7 +59,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/say.h"
#include "asterisk/utils.h"
static char *app = "ZapBarge";
#include "asterisk/dahdi_compat.h"
static char *app = "DAHDIBarge";
static char *deprecated_app = "ZapBarge";
static char *synopsis = "Barge in (monitor) Zap channel";
@ -94,7 +96,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;
DAHDI_CONFINFO ztc;
struct ast_frame *f;
struct ast_channel *c;
struct ast_frame fr;
@ -107,7 +109,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
int origfd;
int ret = -1;
ZT_BUFFERINFO bi;
DAHDI_BUFFERINFO bi;
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
char *buf = __buf + AST_FRIENDLY_OFFSET;
@ -147,10 +149,10 @@ zapretry:
/* 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;
@ -164,7 +166,7 @@ zapretry:
memset(&ztc, 0, sizeof(ztc));
/* Check to see if we're in a conference... */
ztc.chan = 0;
if (ioctl(fd, ZT_GETCONF, &ztc)) {
if (ioctl(fd, DAHDI_GETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error getting conference\n");
close(fd);
goto outrun;
@ -181,9 +183,9 @@ zapretry:
/* Add us to the conference */
ztc.chan = 0;
ztc.confno = confno;
ztc.confmode = ZT_CONF_MONITORBOTH;
ztc.confmode = DAHDI_CONF_MONITORBOTH;
if (ioctl(fd, ZT_SETCONF, &ztc)) {
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
goto outrun;
@ -247,7 +249,7 @@ zapretry:
ztc.chan = 0;
ztc.confno = 0;
ztc.confmode = 0;
if (ioctl(fd, ZT_SETCONF, &ztc)) {
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
}
}
@ -299,6 +301,13 @@ out:
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)
{
int res;
@ -312,6 +321,7 @@ static int unload_module(void)
static int load_module(void)
{
ast_register_application(deprecated_app, conf_exec_warn, synopsis, descrip);
return ast_register_application(app, conf_exec, synopsis, descrip);
}

@ -26,7 +26,7 @@
*/
/*** MODULEINFO
<depend>zaptel</depend>
<depend>dahdi</depend>
***/
#include "asterisk.h"
@ -48,7 +48,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
#include <zaptel/zaptel.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
@ -58,7 +57,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/module.h"
#include "asterisk/options.h"
static char *app = "ZapRAS";
#include "asterisk/dahdi_compat.h"
static char *app = "DAHDIRAS";
static char *deprecated_app = "ZapRAS";
static char *synopsis = "Executes Zaptel ISDN RAS application";
@ -143,10 +145,10 @@ static void run_ras(struct ast_channel *chan, char *args)
int status;
int res;
int signalled = 0;
struct zt_bufferinfo savebi;
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;
@ -184,10 +186,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);
}
@ -201,7 +203,7 @@ static int zapras_exec(struct ast_channel *chan, void *data)
int res=-1;
char *args;
struct ast_module_user *u;
ZT_PARAMS ztp;
DAHDI_PARAMS ztp;
if (!data)
data = "";
@ -221,9 +223,9 @@ static int zapras_exec(struct ast_channel *chan, void *data)
sleep(2);
} else {
memset(&ztp, 0, sizeof(ztp));
if (ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp)) {
if (ioctl(chan->fds[0], DAHDI_GET_PARAMS, &ztp)) {
ast_log(LOG_WARNING, "Unable to get zaptel parameters\n");
} else if (ztp.sigtype != ZT_SIG_CLEAR) {
} else if (ztp.sigtype != DAHDI_SIG_CLEAR) {
if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "Channel %s is not a clear channel\n", chan->name);
} else {
@ -238,6 +240,13 @@ static int zapras_exec(struct ast_channel *chan, void *data)
return res;
}
static int zapras_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 zapras_exec(chan, data);
}
static int unload_module(void)
{
int res;
@ -251,6 +260,7 @@ static int unload_module(void)
static int load_module(void)
{
ast_register_application(deprecated_app, zapras_exec_warn, synopsis, descrip);
return ast_register_application(app, zapras_exec, synopsis, descrip);
}

@ -31,7 +31,7 @@
*/
/*** MODULEINFO
<depend>zaptel</depend>
<depend>dahdi</depend>
***/
#include "asterisk.h"
@ -44,7 +44,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <unistd.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <zaptel/zaptel.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
@ -59,7 +58,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/cli.h"
#include "asterisk/say.h"
static char *app = "ZapScan";
#include "asterisk/dahdi_compat.h"
static char *app = "DAHDIScan";
static char *deprecated_app = "ZapScan";
static char *synopsis = "Scan Zap channels to monitor calls";
@ -74,7 +76,7 @@ static char *descrip =
static struct ast_channel *get_zap_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);
}
@ -99,7 +101,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;
DAHDI_CONFINFO ztc;
struct ast_frame *f;
struct ast_channel *c;
struct ast_frame fr;
@ -114,7 +116,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
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;
@ -154,10 +156,10 @@ 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;
@ -171,7 +173,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
memset(&ztc, 0, sizeof(ztc));
/* Check to see if we're in a conference... */
ztc.chan = 0;
if (ioctl(fd, ZT_GETCONF, &ztc)) {
if (ioctl(fd, DAHDI_GETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error getting conference\n");
close(fd);
goto outrun;
@ -188,9 +190,9 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
/* Add us to the conference */
ztc.chan = 0;
ztc.confno = confno;
ztc.confmode = ZT_CONF_MONITORBOTH;
ztc.confmode = DAHDI_CONF_MONITORBOTH;
if (ioctl(fd, ZT_SETCONF, &ztc)) {
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
goto outrun;
@ -274,7 +276,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
ztc.chan = 0;
ztc.confno = 0;
ztc.confmode = 0;
if (ioctl(fd, ZT_SETCONF, &ztc)) {
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
}
}
@ -361,6 +363,12 @@ static int conf_exec(struct ast_channel *chan, void *data)
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)
{
int res;
@ -374,6 +382,7 @@ static int unload_module(void)
static int load_module(void)
{
ast_register_application(deprecated_app, conf_exec_warn, synopsis, descrip);
return ast_register_application(app, conf_exec, synopsis, descrip);
}

@ -98,7 +98,7 @@ static char *descrip =
static void play_dialtone(struct ast_channel *chan, char *mailbox)
{
const struct tone_zone_sound *ts = NULL;
const struct ind_tone_zone_sound *ts = NULL;
if(ast_app_has_voicemail(mailbox, NULL))
ts = ast_get_indication_tone(chan->zone, "dialrecall");
else

@ -26,7 +26,7 @@
*/
/*** MODULEINFO
<depend>zaptel</depend>
<depend>dahdi</depend>
***/
#include "asterisk.h"
@ -38,7 +38,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <zaptel/zaptel.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
@ -50,6 +49,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/image.h"
#include "asterisk/options.h"
#include "asterisk/dahdi_compat.h"
static char *app = "Flash";
static char *synopsis = "Flashes a Zap Trunk";
@ -65,9 +66,9 @@ static inline int zt_wait_event(int fd)
{
/* Avoid the silly zt_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;
}
@ -76,15 +77,15 @@ static int flash_exec(struct ast_channel *chan, void *data)
int res = -1;
int x;
struct ast_module_user *u;
struct zt_params ztp;
DAHDI_PARAMS ztp;
u = ast_module_user_add(chan);
if (!strcasecmp(chan->tech->type, "Zap")) {
memset(&ztp, 0, sizeof(ztp));
res = ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp);
res = ioctl(chan->fds[0], DAHDI_GET_PARAMS, &ztp);
if (!res) {
if (ztp.sigtype & __ZT_SIG_FXS) {
x = ZT_FLASH;
res = ioctl(chan->fds[0], ZT_HOOK, &x);
if (ztp.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 */

@ -49,7 +49,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 chan_dahdi.conf for on-hook operations.\n";
static int cpeid_setstatus(struct ast_channel *chan, char *stuff[], int voice)

@ -30,7 +30,7 @@
*/
/*** MODULEINFO
<depend>zaptel</depend>
<depend>dahdi</depend>
***/
#include "asterisk.h"
@ -45,7 +45,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <zaptel/zaptel.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
@ -69,6 +68,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/dial.h"
#include "asterisk/causes.h"
#include "asterisk/dahdi_compat.h"
#include "enter.h"
#include "leave.h"
@ -580,8 +581,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)
@ -741,7 +742,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)
{
struct ast_conference *cnf;
struct zt_confinfo ztc = { 0, };
DAHDI_CONFINFO ztc = { 0, };
int confno_int = 0;
AST_LIST_LOCK(&confs);
@ -768,9 +769,9 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin
/* Setup a new zap conference */
ztc.confno = -1;
ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
ztc.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
cnf->fd = open("/dev/zap/pseudo", O_RDWR);
if (cnf->fd < 0 || ioctl(cnf->fd, ZT_SETCONF, &ztc)) {
if (cnf->fd < 0 || ioctl(cnf->fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Unable to open pseudo device\n");
if (cnf->fd >= 0)
close(cnf->fd);
@ -788,8 +789,8 @@ static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin
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)) {
ztc.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
if (ioctl(cnf->chan->fds[0], DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
if (cnf->chan)
ast_hangup(cnf->chan);
@ -1218,8 +1219,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");
}
@ -1372,7 +1373,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;
DAHDI_CONFINFO ztc, ztc_empty;
struct ast_frame *f;
struct ast_channel *c;
struct ast_frame fr;
@ -1405,7 +1406,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;
int setusercount = 0;
@ -1444,8 +1445,8 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
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)) {
ztc.confmode = DAHDI_CONF_CONFANN | DAHDI_CONF_CONFANNMON;
if (ioctl(conf->lchan->fds[0], DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error starting listen channel\n");
ast_hangup(conf->lchan);
conf->lchan = NULL;
@ -1616,16 +1617,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;
@ -1640,7 +1641,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
memset(&ztc_empty, 0, sizeof(ztc_empty));
/* Check to see if we're in a conference... */
ztc.chan = 0;
if (ioctl(fd, ZT_GETCONF, &ztc)) {
if (ioctl(fd, DAHDI_GETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error getting conference\n");
close(fd);
goto outrun;
@ -1670,15 +1671,15 @@ 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;
ztc.confmode = DAHDI_CONF_CONF;
else if (confflags & CONFFLAG_MONITOR)
ztc.confmode = ZT_CONF_CONFMON | ZT_CONF_LISTENER;
ztc.confmode = DAHDI_CONF_CONFMON | DAHDI_CONF_LISTENER;
else if (confflags & CONFFLAG_TALKER)
ztc.confmode = ZT_CONF_CONF | ZT_CONF_TALKER;
ztc.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER;
else
ztc.confmode = ZT_CONF_CONF | ZT_CONF_TALKER | ZT_CONF_LISTENER;
ztc.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
if (ioctl(fd, ZT_SETCONF, &ztc)) {
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
ast_mutex_unlock(&conf->playlock);
@ -1796,8 +1797,8 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
if(confflags & CONFFLAG_MARKEDEXIT)
break;
else {
ztc.confmode = ZT_CONF_CONF;
if (ioctl(fd, ZT_SETCONF, &ztc)) {
ztc.confmode = DAHDI_CONF_CONF;
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
goto outrun;
@ -1812,12 +1813,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;
ztc.confmode = DAHDI_CONF_CONFMON | DAHDI_CONF_LISTENER;
else if (confflags & CONFFLAG_TALKER)
ztc.confmode = ZT_CONF_CONF | ZT_CONF_TALKER;
ztc.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)) {
ztc.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER;
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
goto outrun;
@ -1858,9 +1859,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)) && (ztc.confmode & DAHDI_CONF_TALKER)) {
ztc.confmode ^= DAHDI_CONF_TALKER;
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference - Un/Mute \n");
ret = -1;
break;
@ -1876,9 +1877,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) && !(ztc.confmode & DAHDI_CONF_TALKER)) {
ztc.confmode |= DAHDI_CONF_TALKER;
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference - Un/Mute \n");
ret = -1;
break;
@ -1992,7 +1993,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, &ztc_empty)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
ast_frfree(f);
@ -2138,7 +2139,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
if (musiconhold)
ast_moh_start(chan, NULL, NULL);
if (ioctl(fd, ZT_SETCONF, &ztc)) {
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
ast_frfree(f);
@ -2245,7 +2246,7 @@ bailoutandtrynormal:
ztc.chan = 0;
ztc.confno = 0;
ztc.confmode = 0;
if (ioctl(fd, ZT_SETCONF, &ztc)) {
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
}
}
@ -3112,9 +3113,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)

@ -26,7 +26,7 @@
*/
/*** MODULEINFO
<depend>zaptel</depend>
<depend>dahdi</depend>
<depend>app_meetme</depend>
***/

@ -1565,9 +1565,8 @@ static int say_position(struct queue_ent *qe)
/* If the hold time is >1 min, if it's enabled, and if it's not
supposed to be only once and we have already said it, say it */
if ((avgholdmins+avgholdsecs) > 0 && qe->parent->announceholdtime &&
((qe->parent->announceholdtime == ANNOUNCEHOLDTIME_ONCE && !qe->last_pos) ||
!(qe->parent->announceholdtime == ANNOUNCEHOLDTIME_ONCE))) {
if ((avgholdmins+avgholdsecs) > 0 && (qe->parent->announceholdtime) &&
(!(qe->parent->announceholdtime == ANNOUNCEHOLDTIME_ONCE) && qe->last_pos)) {
res = play_file(qe->chan, qe->parent->sound_holdtime);
if (res)
goto playout;

@ -92,7 +92,7 @@ static int read_exec(struct ast_channel *chan, void *data)
int maxdigits = 255;
int tries = 1, to = 0, x = 0;
char *argcopy = NULL;
struct tone_zone_sound *ts;
struct ind_tone_zone_sound *ts;
struct ast_flags flags = {0};
AST_DECLARE_APP_ARGS(arglist,

@ -2609,9 +2609,9 @@ static struct morse_bits mbits[] = {
*/
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 | ZT_IOMUX_NOWAIT;
res = ioctl(chan->fds[0], DAHDI_IOMUX, &flags);
if(flags & DAHDI_IOMUX_WRITEEMPTY)
break;
if( ast_safe_sleep(chan, 50)){
res = -1;
@ -2660,9 +2660,9 @@ static int send_tone_telemetry(struct ast_channel *chan, char *tonestring)
*/
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 | ZT_IOMUX_NOWAIT;
res = ioctl(chan->fds[0], DAHDI_IOMUX, &flags);
if(flags & DAHDI_IOMUX_WRITEEMPTY)
break;
if( ast_safe_sleep(chan, 50)){
res = -1;
@ -2905,7 +2905,7 @@ static int split_freq(char *mhz, char *decimals, char *freq);
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;
@ -2959,9 +2959,9 @@ struct zt_params par;
ci.confno = (((mytele->mode == ID) || (mytele->mode == IDTALKOVER) || (mytele->mode == UNKEY) ||
(mytele->mode == TAILMSG) || (mytele->mode == LINKUNKEY)) || (mytele->mode == TIMEOUT) ?
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);
@ -3144,9 +3144,9 @@ struct zt_params par;
/* 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);
@ -3174,9 +3174,9 @@ struct zt_params par;
/* 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);
@ -3385,15 +3385,15 @@ struct zt_params par;
res = -1;
break;
}
i = ZT_FLUSH_EVENT;
if (ioctl(myrpt->zaptxchannel->fds[0],ZT_FLUSH,&i) == -1)
i = DAHDI_FLUSH_EVENT;
if (ioctl(myrpt->zaptxchannel->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->zaprxchannel->fds[0],DAHDI_GET_PARAMS,&par) == -1)
{
ast_mutex_unlock(&myrpt->remlock);
ast_log(LOG_ERROR,"Cant get params");
@ -4161,7 +4161,7 @@ pthread_attr_t attr;
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;
@ -4181,10 +4181,10 @@ struct ast_channel *mychannel,*genchannel;
#endif
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 | ZT_CONF_TALKER | ZT_CONF_LISTENER
| DAHDI_CONF_PSEUDO_TALKER | ZT_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);
@ -4204,10 +4204,10 @@ struct ast_channel *mychannel,*genchannel;
#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 | ZT_CONF_TALKER | ZT_CONF_LISTENER
| DAHDI_CONF_PSEUDO_TALKER | ZT_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);
@ -4232,7 +4232,7 @@ struct ast_channel *mychannel,*genchannel;
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);
@ -4274,7 +4274,7 @@ struct ast_channel *mychannel,*genchannel;
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);
@ -4346,10 +4346,10 @@ struct ast_channel *mychannel,*genchannel;
/* 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 | ZT_CONF_LISTENER | ZT_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);
@ -4373,7 +4373,7 @@ struct ast_channel *mychannel,*genchannel;
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);
}
}
@ -4401,10 +4401,10 @@ struct ast_channel *mychannel,*genchannel;
/* 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 | ZT_CONF_LISTENER | ZT_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");
}
@ -4471,7 +4471,7 @@ static int connect_link(struct rpt *myrpt, char* node, int mode, int perma)
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){
@ -4610,9 +4610,9 @@ static int connect_link(struct rpt *myrpt, char* node, int mode, int perma)
/* 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 | ZT_CONF_LISTENER | ZT_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);
@ -5850,17 +5850,17 @@ static void rbi_out(struct rpt *myrpt,unsigned char *data)
struct zt_radio_param r;
memset(&r,0,sizeof(struct zt_radio_param));
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->zaprxchannel->fds[0],ZT_RADIO_SETPARAM,&r) == -1)
if (ioctl(myrpt->zaprxchannel->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->zaprxchannel->fds[0],DAHDI_RADIO_SETPARAM,&r) == -1)
{
ast_log(LOG_WARNING,"Cannot send RBI command for channel %s\n",myrpt->zaprxchannel->name);
return;
@ -5909,47 +5909,47 @@ static int serial_remote_io(struct rpt *myrpt, unsigned char *txbuf, int txbytes
/* if not a zap channel, cant use pciradio stuff */
if (myrpt->rxchannel != myrpt->zaprxchannel) 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->zaprxchannel->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->zaprxchannel->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->zaprxchannel->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->zaprxchannel->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->zaprxchannel->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->zaprxchannel->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->zaprxchannel->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->zaprxchannel->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->zaprxchannel->fds[0],DAHDI_RADIO_SETPARAM,&prm) == -1) return -1;
return(index);
}
@ -8763,7 +8763,7 @@ char *tele,*idtalkover,c;
int ms = MSWAIT,i,lasttx=0,val,remrx=0,identqueued,othertelemqueued;
int tailmessagequeued,ctqueued,dtmfed;
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;
@ -8963,9 +8963,9 @@ char tmpstr[300],lstr[MAXLINKLIST];
/* 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 | ZT_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->zaptxchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
{
ast_log(LOG_WARNING, "Unable to set conference mode to Announce\n");
rpt_mutex_unlock(&myrpt->lock);
@ -8982,10 +8982,10 @@ char tmpstr[300],lstr[MAXLINKLIST];
/* 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 | ZT_CONF_LISTENER | ZT_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);
@ -9005,7 +9005,7 @@ char tmpstr[300],lstr[MAXLINKLIST];
(myrpt->zaptxchannel == 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);
@ -9017,15 +9017,15 @@ char tmpstr[300],lstr[MAXLINKLIST];
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);
@ -9057,9 +9057,9 @@ char tmpstr[300],lstr[MAXLINKLIST];
/* 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 | ZT_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);
@ -9786,7 +9786,7 @@ char tmpstr[300],lstr[MAXLINKLIST];
/* 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->zaprxchannel->fds[0], DAHDI_GETCONFMUTE, &ismuted) == -1)
{
ismuted = 0;
}
@ -10076,7 +10076,7 @@ char tmpstr[300],lstr[MAXLINKLIST];
if (l->phonemode)
{
if (ioctl(l->chan->fds[0], ZT_GETCONFMUTE, &ismuted) == -1)
if (ioctl(l->chan->fds[0], DAHDI_GETCONFMUTE, &ismuted) == -1)
{
ismuted = 0;
}
@ -10568,8 +10568,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,nullfd;
time_t t,last_timeout_warning;
struct zt_radio_param z;
@ -10948,9 +10948,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 | ZT_CONF_LISTENER | ZT_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);
@ -11115,9 +11115,9 @@ static int rpt_exec(struct ast_channel *chan, void *data)
/* 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);
@ -11144,28 +11144,28 @@ static int rpt_exec(struct ast_channel *chan, void *data)
memset(&z,0,sizeof(z));
if ((myrpt->iofd < 1) && (myrpt->txchannel == myrpt->zaptxchannel))
{
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->zaptxchannel->fds[0],DAHDI_RADIO_SETPARAM,&z);
/* if PCIRADIO and kenwood selected */
if ((!res) && (!strcmp(myrpt->remote,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->zaptxchannel->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->zaptxchannel->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->zaptxchannel->fds[0],DAHDI_HOOK,&i) == -1)
{
ast_log(LOG_ERROR,"Cannot set hook\n");
return -1;
@ -11175,23 +11175,23 @@ static int rpt_exec(struct ast_channel *chan, void *data)
}
if (myrpt->txchannel == myrpt->zaptxchannel)
{
i = ZT_ONHOOK;
ioctl(myrpt->zaptxchannel->fds[0],ZT_HOOK,&i);
i = DAHDI_ONHOOK;
ioctl(myrpt->zaptxchannel->fds[0],DAHDI_HOOK,&i);
/* if PCIRADIO and Yaesu ft897/ICOM IC-706 selected */
if ((myrpt->iofd < 1) && (!res) &&
(!strcmp(myrpt->remote,remote_rig_ft897) ||
(!strcmp(myrpt->remote,remote_rig_ic706))))
{
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->zaptxchannel->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->zaptxchannel->fds[0],DAHDI_RADIO_SETPARAM,&z) == -1)
{
ast_log(LOG_ERROR,"Cannot set UIODATA\n");
return -1;
@ -11227,7 +11227,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
if (myrpt->remote && (myrpt->rxchannel == myrpt->txchannel))
{
i = 128;
ioctl(myrpt->zaprxchannel->fds[0],ZT_ECHOCANCEL,&i);
ioctl(myrpt->zaprxchannel->fds[0],DAHDI_ECHOCANCEL,&i);
}
if (chan->_state != AST_STATE_UP) {
ast_answer(chan);
@ -11235,7 +11235,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
if (myrpt->rxchannel == myrpt->zaprxchannel)
{
if (ioctl(myrpt->zaprxchannel->fds[0],ZT_GET_PARAMS,&par) != -1)
if (ioctl(myrpt->zaprxchannel->fds[0],DAHDI_GET_PARAMS,&par) != -1)
{
if (par.rxisoffhook)
{
@ -11500,9 +11500,9 @@ static int rpt_exec(struct ast_channel *chan, void *data)
time(&myrpt->last_activity_time);
if ((iskenwood_pci4) && (myrpt->txchannel == myrpt->zaptxchannel))
{
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->zaptxchannel->fds[0],DAHDI_RADIO_SETPARAM,&z) == -1)
{
ast_log(LOG_ERROR,"Cannot set UIODATA\n");
return -1;
@ -11524,9 +11524,9 @@ static int rpt_exec(struct ast_channel *chan, void *data)
}
if ((iskenwood_pci4) && (myrpt->txchannel == myrpt->zaptxchannel))
{
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->zaptxchannel->fds[0],DAHDI_RADIO_SETPARAM,&z) == -1)
{
ast_log(LOG_ERROR,"Cannot set UIODATA\n");
return -1;
@ -11576,7 +11576,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
}
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;
}
@ -11801,22 +11801,22 @@ static int rpt_exec(struct ast_channel *chan, void *data)
myrpt->lastf2 = NULL;
if ((iskenwood_pci4) && (myrpt->txchannel == myrpt->zaptxchannel))
{
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->zaptxchannel->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->zaptxchannel->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->zaptxchannel->fds[0],DAHDI_HOOK,&i) == -1)
{
ast_log(LOG_ERROR,"Cannot set hook\n");
return -1;

@ -1,5 +1,6 @@
ASOUND=@PBX_ALSA@
CURL=@PBX_CURL@
DAHDI=@PBX_DAHDI@
FREETDS=@PBX_FREETDS@
GSM=@PBX_GSM@
GTK=@PBX_GTK@
@ -32,8 +33,7 @@ UNIXODBC=@PBX_UNIXODBC@
VORBIS=@PBX_VORBIS@
VPBAPI=@PBX_VPB@
ZAPTEL=@PBX_ZAPTEL@
ZAPTEL_VLDTMF=@PBX_ZAPTEL_VLDTMF@
ZAPTEL_TRANSCODE=@PBX_ZAPTEL_TRANSCODE@
DAHDI_TRANSCODE=@PBX_ZAPTEL_TRANSCODE@
ZLIB=@PBX_ZLIB@
ISDNNET=@PBX_ISDNNET@
MISDN=@PBX_MISDN@

File diff suppressed because it is too large Load Diff

@ -29,7 +29,7 @@
*/
/*** MODULEINFO
<use>zaptel</use>
<use>dahdi</use>
<depend>res_features</depend>
***/
@ -59,9 +59,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <sys/stat.h>
#include <regex.h>
#ifdef HAVE_ZAPTEL
#if defined(HAVE_ZAPTEL) || defined (HAVE_DAHDI)
#include <sys/ioctl.h>
#include <zaptel/zaptel.h>
#include "asterisk/dahdi_compat.h"
#endif
#include "asterisk/lock.h"
@ -6538,7 +6538,7 @@ static int timing_read(int *id, int fd, short events, void *cbdata)
struct iax2_trunk_peer *tpeer, *prev = NULL, *drop=NULL;
int processed = 0;
int totalcalls = 0;
#ifdef ZT_TIMERACK
#ifdef DAHDI_TIMERACK
int x = 1;
#endif
struct timeval now;
@ -6546,9 +6546,9 @@ static int timing_read(int *id, int fd, short events, void *cbdata)
ast_verbose("Beginning trunk processing. Trunk queue ceiling is %d bytes per host\n", MAX_TRUNKDATA);
gettimeofday(&now, NULL);
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)) {
if (ioctl(fd, DAHDI_TIMERACK, &x)) {
ast_log(LOG_WARNING, "Unable to acknowledge zap timer. IAX trunking will fail!\n");
usleep(1);
return -1;
@ -9810,14 +9810,14 @@ static void prune_peers(void)
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
@ -11093,14 +11093,22 @@ static int load_module(void)
jb_setoutput(jb_error_output, jb_warning_output, NULL);
#ifdef HAVE_ZAPTEL
#ifdef ZT_TIMERACK
#ifdef ZAPTEL_TIMERACK
timingfd = open("/dev/zap/timer", O_RDWR);
if (timingfd < 0)
#endif
timingfd = open("/dev/zap/pseudo", O_RDWR);
if (timingfd < 0)
ast_log(LOG_WARNING, "Unable to open IAX timing interface: %s\n", strerror(errno));
#endif
#elif defined(HAVE_DAHDI)
#ifdef DAHDI_TIMERACK
timingfd = open("/dev/dahdi/timer", O_RDWR);
if (timingfd < 0)
#endif
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
memset(iaxs, 0, sizeof(iaxs));

@ -2677,7 +2677,7 @@ static void *mgcp_ss(void *data)
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)) {
@ -2689,7 +2689,7 @@ static void *mgcp_ss(void *data)
ast_verbose(VERBOSE_PREFIX_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;
@ -2698,7 +2698,7 @@ static void *mgcp_ss(void *data)
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;
@ -2720,7 +2720,7 @@ static void *mgcp_ss(void *data)
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");
}
@ -2733,7 +2733,7 @@ static void *mgcp_ss(void *data)
}
} else if (res == 0) {
ast_log(LOG_DEBUG, "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);*/
ast_hangup(chan);
@ -2745,7 +2745,7 @@ static void *mgcp_ss(void *data)
}
/* 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));
@ -2757,7 +2757,7 @@ static void *mgcp_ss(void *data)
*/
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));
@ -2770,7 +2770,7 @@ static void *mgcp_ss(void *data)
/* 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));
@ -2781,7 +2781,7 @@ static void *mgcp_ss(void *data)
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")) {
@ -2789,7 +2789,7 @@ static void *mgcp_ss(void *data)
if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_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;
@ -2800,14 +2800,14 @@ static void *mgcp_ss(void *data)
if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_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));
@ -2816,7 +2816,7 @@ static void *mgcp_ss(void *data)
if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_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;
@ -2837,7 +2837,7 @@ static void *mgcp_ss(void *data)
}
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;
@ -2849,7 +2849,7 @@ static void *mgcp_ss(void *data)
/* 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));

@ -211,7 +211,7 @@ struct chan_list {
int other_pid;
struct chan_list *other_ch;
const struct tone_zone_sound *ts;
const struct ind_tone_zone_sound *ts;
int overlap_dial;
int overlap_dial_task;
@ -2989,7 +2989,7 @@ static enum ast_bridge_result misdn_bridge (struct ast_channel *c0,
static int dialtone_indicate(struct chan_list *cl)
{
const struct tone_zone_sound *ts= NULL;
const struct ind_tone_zone_sound *ts= NULL;
struct ast_channel *ast=cl->ast;
int nd=0;

@ -27,8 +27,8 @@
*/
/*** MODULEINFO
<depend>zaptel_transcode</depend>
<depend>zaptel</depend>
<depend>dahdi_transcode</depend>
<depend>dahdi</depend>
***/
#include "asterisk.h"
@ -44,7 +44,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <sys/ioctl.h>
#include <errno.h>
#include <sys/mman.h>
#include <zaptel/zaptel.h>
#include "asterisk/lock.h"
#include "asterisk/translate.h"
@ -57,6 +56,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/utils.h"
#include "asterisk/linkedlists.h"
#include "asterisk/dahdi_compat.h"
#define BUFFER_SAMPLES 8000
static unsigned int global_useplc = 0;
@ -113,7 +114,7 @@ struct pvt {
int totalms;
int lasttotalms;
#endif
struct zt_transcode_header *hdr;
DAHDI_TRANSCODE_HEADER *hdr;
};
static int transcoder_show(int fd, int argc, char **argv)
@ -133,7 +134,7 @@ static int transcoder_show(int fd, int argc, char **argv)
static int zap_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
{
struct pvt *ztp = pvt->pvt;
struct zt_transcode_header *hdr = ztp->hdr;
DAHDI_TRANSCODE_HEADER *hdr = ztp->hdr;
if (!f->subclass) {
/* Fake a return frame for calculation purposes */
@ -180,7 +181,7 @@ static int zap_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
static struct ast_frame *zap_frameout(struct ast_trans_pvt *pvt)
{
struct pvt *ztp = pvt->pvt;
struct zt_transcode_header *hdr = ztp->hdr;
DAHDI_TRANSCODE_HEADER *hdr = ztp->hdr;
unsigned int x;
if (ztp->fake == 2) {
@ -219,8 +220,8 @@ static struct ast_frame *zap_frameout(struct ast_trans_pvt *pvt)
} 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(ztp->fd, DAHDI_TRANSCODE_OP, &x))
ast_log(LOG_WARNING, "Failed to transcode: %s\n", strerror(errno));
}
return NULL;
@ -235,8 +236,8 @@ static void zap_destroy(struct ast_trans_pvt *pvt)
struct pvt *ztp = pvt->pvt;
unsigned int x;
x = ZT_TCOP_RELEASE;
if (ioctl(ztp->fd, ZT_TRANSCODE_OP, &x))
x = DAHDI_TCOP_RELEASE;
if (ioctl(ztp->fd, DAHDI_TRANSCODE_OP, &x))
ast_log(LOG_WARNING, "Failed to release transcoder channel: %s\n", strerror(errno));
switch (ztp->hdr->dstfmt) {
@ -257,9 +258,9 @@ static int zap_translate(struct ast_trans_pvt *pvt, int dest, int source)
{
/* Request translation through zap if possible */
int fd;
unsigned int x = ZT_TCOP_ALLOCATE;
unsigned int x = DAHDI_TCOP_ALLOCATE;
struct pvt *ztp = pvt->pvt;
struct zt_transcode_header *hdr;
DAHDI_TRANSCODE_HEADER *hdr;
int flags;
if ((fd = open("/dev/zap/transcode", O_RDWR)) < 0)
@ -278,7 +279,7 @@ static int zap_translate(struct ast_trans_pvt *pvt, int dest, int source)
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);
@ -288,7 +289,7 @@ static int zap_translate(struct ast_trans_pvt *pvt, int dest, int source)
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);
@ -441,7 +442,7 @@ static void build_translators(struct format_map *map, unsigned int dstfmts, unsi
static int find_transcoders(void)
{
struct zt_transcode_info info = { 0, };
DAHDI_TRANSCODE_INFO info = { 0, };
struct format_map map = { { { 0 } } };
int fd, res;
unsigned int x, y;
@ -451,8 +452,8 @@ static int find_transcoders(void)
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++) {
if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "Found transcoder '%s'.\n", info.name);
build_translators(&map, info.dstfmts, info.srcfmts);

290
configure vendored

@ -1,5 +1,5 @@
#! /bin/sh
# From configure.ac Revision: 115341 .
# From configure.ac Revision: 121802 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for asterisk 1.4.
#
@ -733,6 +733,10 @@ CURSES_LIB
CURSES_INCLUDE
CURSES_DIR
PBX_CURSES
DAHDI_LIB
DAHDI_INCLUDE
DAHDI_DIR
PBX_DAHDI
GNUTLS_LIB
GNUTLS_INCLUDE
GNUTLS_DIR
@ -884,6 +888,7 @@ GC_CFLAGS
GC_LDFLAGS
AST_DECLARATION_AFTER_STATEMENT
AST_NO_STRICT_OVERFLOW
PBX_ZAPTEL_TRANSCODE
GSM_INTERNAL
KDEINIT
KDEDIR
@ -901,7 +906,6 @@ OPENH323_SUFFIX
OPENH323_BUILD
PBX_SPEEX_PREPROCESS
PBX_ZAPTEL_VLDTMF
PBX_ZAPTEL_TRANSCODE
EDITLINE_LIB
PBX_H323
PBX_IXJUSER
@ -1514,6 +1518,7 @@ Optional Packages:
--with-curl=PATH use cURL files in PATH
--with-cap=PATH use POSIX 1.e capabilities files in PATH
--with-curses=PATH use curses files in PATH
--with-dahdi=PATH use DAHDI files in PATH
--with-gnutls=PATH use GNU TLS support (used for iksemel only) files in
PATH
--with-gsm=PATH use GSM files in PATH , or 'internal'
@ -7856,6 +7861,34 @@ PBX_CURSES=0
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)
DAHDI_MANDATORY="yes"
;;
*)
DAHDI_DIR="${withval}"
DAHDI_MANDATORY="yes"
;;
esac
fi
PBX_DAHDI=0
GNUTLS_DESCRIP="GNU TLS support (used for iksemel only)"
GNUTLS_OPTION="gnutls"
@ -17537,6 +17570,89 @@ fi
fi
if test "${USE_DAHDI}" != "no" ; then
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. */
#include <dahdi/user.h>
int
main ()
{
#if defined(DAHDI_CODE)
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_DAHDI=1
cat >>confdefs.h <<\_ACEOF
#define HAVE_DAHDI 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define HAVE_DAHDI_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_DAHDI}" = "x1" ; then
PBX_ZAPTEL_TRANSCODE=1
fi
fi
if test "x${PBX_GETIFADDRS}" != "x1" -a "${USE_GETIFADDRS}" != "no"; then
{ echo "$as_me:$LINENO: checking if \"struct ifaddrs *p; getifaddrs(&p)\" compiles using ifaddrs.h" >&5
@ -32802,6 +32918,12 @@ if test "${host_os}" != "linux-gnu" ; then
tonezone_extra="-lm"
fi
if test "${USE_DAHDI}" != "no" ; then
tonezone_dir="dahdi"
else
tonezone_dir="zaptel"
fi
if test "${USE_TONEZONE}" != "no"; then
pbxlibdir=""
@ -32888,11 +33010,11 @@ fi
TONEZONE_INCLUDE="-I${TONEZONE_DIR}/include"
saved_cppflags="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} -I${TONEZONE_DIR}/include"
if test "xzaptel/tonezone.h" != "x" ; then
as_ac_Header=`echo "ac_cv_header_${TONEZONE_DIR}/include/zaptel/tonezone.h" | $as_tr_sh`
if test "x${tonezone_dir}/tonezone.h" != "x" ; then
as_ac_Header=`echo "ac_cv_header_${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
{ echo "$as_me:$LINENO: checking for ${TONEZONE_DIR}/include/zaptel/tonezone.h" >&5
echo $ECHO_N "checking for ${TONEZONE_DIR}/include/zaptel/tonezone.h... $ECHO_C" >&6; }
{ echo "$as_me:$LINENO: checking for ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h" >&5
echo $ECHO_N "checking for ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
@ -32901,8 +33023,8 @@ ac_res=`eval echo '${'$as_ac_Header'}'`
echo "${ECHO_T}$ac_res" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking ${TONEZONE_DIR}/include/zaptel/tonezone.h usability" >&5
echo $ECHO_N "checking ${TONEZONE_DIR}/include/zaptel/tonezone.h usability... $ECHO_C" >&6; }
{ echo "$as_me:$LINENO: checking ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h usability" >&5
echo $ECHO_N "checking ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@ -32910,7 +33032,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <${TONEZONE_DIR}/include/zaptel/tonezone.h>
#include <${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
@ -32942,15 +33064,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking ${TONEZONE_DIR}/include/zaptel/tonezone.h presence" >&5
echo $ECHO_N "checking ${TONEZONE_DIR}/include/zaptel/tonezone.h presence... $ECHO_C" >&6; }
{ echo "$as_me:$LINENO: checking ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h presence" >&5
echo $ECHO_N "checking ${TONEZONE_DIR}/include/${tonezone_dir}/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 <${TONEZONE_DIR}/include/zaptel/tonezone.h>
#include <${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
@ -32983,25 +33105,25 @@ 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: ${TONEZONE_DIR}/include/zaptel/tonezone.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: proceeding with the compiler's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/zaptel/tonezone.h: in the future, the compiler will take precedence" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------- ##
## Report this to www.asterisk.org ##
@ -33010,8 +33132,8 @@ _ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
{ echo "$as_me:$LINENO: checking for ${TONEZONE_DIR}/include/zaptel/tonezone.h" >&5
echo $ECHO_N "checking for ${TONEZONE_DIR}/include/zaptel/tonezone.h... $ECHO_C" >&6; }
{ echo "$as_me:$LINENO: checking for ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h" >&5
echo $ECHO_N "checking for ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@ -33032,19 +33154,21 @@ fi
fi
CPPFLAGS="${saved_cppflags}"
else
if test "xzaptel/tonezone.h" != "x" ; then
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
if test "x${tonezone_dir}/tonezone.h" != "x" ; then
as_ac_Header=`echo "ac_cv_header_${tonezone_dir}/tonezone.h" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
{ echo "$as_me:$LINENO: checking for ${tonezone_dir}/tonezone.h" >&5
echo $ECHO_N "checking for ${tonezone_dir}/tonezone.h... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+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; }
ac_res=`eval echo '${'$as_ac_Header'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&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; }
{ echo "$as_me:$LINENO: checking ${tonezone_dir}/tonezone.h usability" >&5
echo $ECHO_N "checking ${tonezone_dir}/tonezone.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@ -33052,7 +33176,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <zaptel/tonezone.h>
#include <${tonezone_dir}/tonezone.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
@ -33084,15 +33208,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
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; }
{ echo "$as_me:$LINENO: checking ${tonezone_dir}/tonezone.h presence" >&5
echo $ECHO_N "checking ${tonezone_dir}/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>
#include <${tonezone_dir}/tonezone.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
@ -33125,25 +33249,25 @@ 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;}
{ echo "$as_me:$LINENO: WARNING: ${tonezone_dir}/tonezone.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: ${tonezone_dir}/tonezone.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${tonezone_dir}/tonezone.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: ${tonezone_dir}/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;}
{ echo "$as_me:$LINENO: WARNING: ${tonezone_dir}/tonezone.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: ${tonezone_dir}/tonezone.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${tonezone_dir}/tonezone.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: ${tonezone_dir}/tonezone.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${tonezone_dir}/tonezone.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: ${tonezone_dir}/tonezone.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${tonezone_dir}/tonezone.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: ${tonezone_dir}/tonezone.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${tonezone_dir}/tonezone.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: ${tonezone_dir}/tonezone.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: ${tonezone_dir}/tonezone.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: ${tonezone_dir}/tonezone.h: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------- ##
## Report this to www.asterisk.org ##
@ -33152,18 +33276,19 @@ _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 "$as_me:$LINENO: checking for ${tonezone_dir}/tonezone.h" >&5
echo $ECHO_N "checking for ${tonezone_dir}/tonezone.h... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_zaptel_tonezone_h=$ac_header_preproc
eval "$as_ac_Header=\$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; }
ac_res=`eval echo '${'$as_ac_Header'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
fi
if test $ac_cv_header_zaptel_tonezone_h = yes; then
if test `eval echo '${'$as_ac_Header'}'` = yes; then
TONEZONE_HEADER_FOUND=1
else
TONEZONE_HEADER_FOUND=0
@ -34546,7 +34671,7 @@ echo "$as_me: *** without explicitly specifying --with-${ZLIB_OPTION}" >&6;}
fi
if test "${USE_ZAPTEL}" != "no"; then
if test "${USE_ZAPTEL}" != "no" && test "x${PBX_DAHDI}" != "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}"
@ -34628,7 +34753,7 @@ echo "$as_me: *** including --without-zaptel." >&6;}
fi
fi
if test "${PBX_ZAPTEL}" = 1; then
if test "${PBX_ZAPTEL}" = 1 && test "x${PBX_DAHDI}" != "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}"
@ -34753,6 +34878,11 @@ fi
if test "x${PBX_ZAPTEL}" = "x1" ; then
PBX_DAHDI=1
fi
EDITLINE_LIB=""
if test "x$TERMCAP_LIB" != "x" ; then
EDITLINE_LIB="$TERMCAP_LIB"
@ -36309,6 +36439,10 @@ CURSES_LIB!$CURSES_LIB$ac_delim
CURSES_INCLUDE!$CURSES_INCLUDE$ac_delim
CURSES_DIR!$CURSES_DIR$ac_delim
PBX_CURSES!$PBX_CURSES$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
GNUTLS_LIB!$GNUTLS_LIB$ac_delim
GNUTLS_INCLUDE!$GNUTLS_INCLUDE$ac_delim
GNUTLS_DIR!$GNUTLS_DIR$ac_delim
@ -36385,10 +36519,6 @@ PRI_LIB!$PRI_LIB$ac_delim
PRI_INCLUDE!$PRI_INCLUDE$ac_delim
PRI_DIR!$PRI_DIR$ac_delim
PBX_PRI!$PBX_PRI$ac_delim
PWLIB_LIB!$PWLIB_LIB$ac_delim
PWLIB_INCLUDE!$PWLIB_INCLUDE$ac_delim
PWLIB_DIR!$PWLIB_DIR$ac_delim
PBX_PWLIB!$PBX_PWLIB$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@ -36430,6 +36560,10 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
PWLIB_LIB!$PWLIB_LIB$ac_delim
PWLIB_INCLUDE!$PWLIB_INCLUDE$ac_delim
PWLIB_DIR!$PWLIB_DIR$ac_delim
PBX_PWLIB!$PBX_PWLIB$ac_delim
OPENH323_LIB!$OPENH323_LIB$ac_delim
OPENH323_INCLUDE!$OPENH323_INCLUDE$ac_delim
OPENH323_DIR!$OPENH323_DIR$ac_delim
@ -36501,6 +36635,7 @@ GC_CFLAGS!$GC_CFLAGS$ac_delim
GC_LDFLAGS!$GC_LDFLAGS$ac_delim
AST_DECLARATION_AFTER_STATEMENT!$AST_DECLARATION_AFTER_STATEMENT$ac_delim
AST_NO_STRICT_OVERFLOW!$AST_NO_STRICT_OVERFLOW$ac_delim
PBX_ZAPTEL_TRANSCODE!$PBX_ZAPTEL_TRANSCODE$ac_delim
GSM_INTERNAL!$GSM_INTERNAL$ac_delim
KDEINIT!$KDEINIT$ac_delim
KDEDIR!$KDEDIR$ac_delim
@ -36518,15 +36653,10 @@ OPENH323_SUFFIX!$OPENH323_SUFFIX$ac_delim
OPENH323_BUILD!$OPENH323_BUILD$ac_delim
PBX_SPEEX_PREPROCESS!$PBX_SPEEX_PREPROCESS$ac_delim
PBX_ZAPTEL_VLDTMF!$PBX_ZAPTEL_VLDTMF$ac_delim
PBX_ZAPTEL_TRANSCODE!$PBX_ZAPTEL_TRANSCODE$ac_delim
EDITLINE_LIB!$EDITLINE_LIB$ac_delim
PBX_H323!$PBX_H323$ac_delim
PBX_IXJUSER!$PBX_IXJUSER$ac_delim
GTKCONFIG!$GTKCONFIG$ac_delim
PBX_GTK!$PBX_GTK$ac_delim
GTK_INCLUDE!$GTK_INCLUDE$ac_delim
GTK_LIB!$GTK_LIB$ac_delim
PKGCONFIG!$PKGCONFIG$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@ -36568,6 +36698,10 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
PBX_GTK!$PBX_GTK$ac_delim
GTK_INCLUDE!$GTK_INCLUDE$ac_delim
GTK_LIB!$GTK_LIB$ac_delim
PKGCONFIG!$PKGCONFIG$ac_delim
PBX_GTK2!$PBX_GTK2$ac_delim
GTK2_INCLUDE!$GTK2_INCLUDE$ac_delim
GTK2_LIB!$GTK2_LIB$ac_delim
@ -36575,7 +36709,7 @@ CURL_CONFIG!$CURL_CONFIG$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 5; then
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 9; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

@ -176,6 +176,7 @@ AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
@ -435,6 +436,14 @@ if test "x${host_os}" = "xlinux-gnu" ; then
AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
fi
if test "${USE_DAHDI}" != "no" ; then
AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h])
if test "x${PBX_DAHDI}" = "x1" ; then
PBX_ZAPTEL_TRANSCODE=1
AC_SUBST(PBX_ZAPTEL_TRANSCODE)
fi
fi
AST_C_COMPILE_CHECK([GETIFADDRS], [struct ifaddrs *p; getifaddrs(&p)], [ifaddrs.h])
GSM_INTERNAL="yes"
@ -1349,7 +1358,13 @@ if test "${host_os}" != "linux-gnu" ; then
tonezone_extra="-lm"
fi
AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}])
if test "${USE_DAHDI}" != "no" ; then
tonezone_dir="dahdi"
else
tonezone_dir="zaptel"
fi
AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [${tonezone_dir}/tonezone.h], [${tonezone_extra}])
AST_EXT_LIB_CHECK([USB], [usb], [usb_init], [usb.h], [])
@ -1407,7 +1422,7 @@ AC_LANG_POP
AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
if test "${USE_ZAPTEL}" != "no"; then
if test "${USE_ZAPTEL}" != "no" && test "x${PBX_DAHDI}" != "x1"; then
AC_MSG_CHECKING(for ZT_DIAL_OP_CANCEL in zaptel/zaptel.h)
saved_cppflags="${CPPFLAGS}"
if test "x${ZAPTEL_DIR}" != "x"; then
@ -1443,7 +1458,7 @@ if test "${USE_ZAPTEL}" != "no"; then
fi
fi
if test "${PBX_ZAPTEL}" = 1; then
if test "${PBX_ZAPTEL}" = 1 && test "x${PBX_DAHDI}" != "x1"; then
AC_MSG_CHECKING(for ZT_EVENT_REMOVED in zaptel/zaptel.h)
saved_cppflags="${CPPFLAGS}"
if test "x${ZAPTEL_DIR}" != "x"; then
@ -1492,6 +1507,11 @@ fi
AC_SUBST(PBX_ZAPTEL_VLDTMF)
AC_SUBST(PBX_ZAPTEL_TRANSCODE)
if test "x${PBX_ZAPTEL}" = "x1" ; then
PBX_DAHDI=1
AC_SUBST(PBX_DAHDI)
fi
EDITLINE_LIB=""
if test "x$TERMCAP_LIB" != "x" ; then
EDITLINE_LIB="$TERMCAP_LIB"

@ -30,7 +30,7 @@
void print_tone_zone_sound(struct 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;
@ -61,15 +61,15 @@ void print_indications(struct tone_zone *zone_data) {
}
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");
}

@ -111,7 +111,7 @@ static int func_channel_write(struct ast_channel *chan, char *function,
else if (!strcasecmp(data, "musicclass"))
locked_string_field_set(chan, musicclass, value);
else if (!strcasecmp(data, "tonezone")) {
struct tone_zone *new_zone;
struct ind_tone_zone *new_zone;
if (!(new_zone = ast_get_indication_zone(value))) {
ast_log(LOG_ERROR, "Unknown country code '%s' for tonezone. Check indications.conf for available country codes.\n", value);
ret = -1;

@ -74,6 +74,12 @@
/* Define to indicate the ${CURSES_DESCRIP} library */
#undef HAVE_CURSES
/* Define if your system has the DAHDI headers. */
#undef HAVE_DAHDI
/* Define DAHDI headers version */
#undef HAVE_DAHDI_VERSION
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#undef HAVE_DIRENT_H

@ -414,7 +414,7 @@ struct ast_channel {
struct ast_cdr *cdr; /*!< Call Detail Record */
enum ast_channel_adsicpe adsicpe; /*!< Whether or not ADSI is detected on CPE */
struct tone_zone *zone; /*!< Tone zone as set in indications.conf or
struct ind_tone_zone *zone; /*!< Tone zone as set in indications.conf or
in the CHANNEL dialplan function */
struct ast_channel_monitor *monitor; /*!< Channel monitoring */

@ -0,0 +1,189 @@
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 2008, Digium, Inc.
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
/*!
* \file
* \brief DAHDI compatibility with zaptel
*/
#ifndef DAHDI_COMPAT_H
#define DAHDI_COMPAT_H
#ifndef HAVE_ZAPTEL
#include <dahdi/user.h>
#include <dahdi/tonezone.h>
#else
#include <zaptel/zaptel.h>
#include <zaptel/tonezone.h>
/* Compiling against Zaptel instead of DAHDI */
#define __DAHDI_SIG_FXO __ZT_SIG_FXO
#define __DAHDI_SIG_FXS __ZT_SIG_FXS
#define DAHDI_ALARM_BLUE ZT_ALARM_BLUE
#define DAHDI_ALARM_LOOPBACK ZT_ALARM_LOOPBACK
#define DAHDI_ALARM_NONE ZT_ALARM_NONE
#define DAHDI_ALARM_NOTOPEN ZT_ALARM_NOTOPEN
#define DAHDI_ALARM_RECOVER ZT_ALARM_RECOVER
#define DAHDI_ALARM_RED ZT_ALARM_RED
#define DAHDI_ALARM_YELLOW ZT_ALARM_YELLOW
#define DAHDI_AUDIOMODE ZT_AUDIOMODE
#define DAHDI_BUFFERINFO ZT_BUFFERINFO
#define DAHDI_CHANNO ZT_CHANNO
#define DAHDI_CHECK_HOOKSTATE ZT_CHECK_HOOKSTATE
#define DAHDI_CONF_CONF ZT_CONF_CONF
#define DAHDI_CONF_CONFANN ZT_CONF_CONFANN
#define DAHDI_CONF_CONFANNMON ZT_CONF_CONFANNMON
#define DAHDI_CONF_CONFMON ZT_CONF_CONFMON
#define DAHDI_CONF_DIGITALMON ZT_CONF_DIGITALMON
#define DAHDI_CONF_LISTENER ZT_CONF_LISTENER
#define DAHDI_CONF_MONITORBOTH ZT_CONF_MONITORBOTH
#define DAHDI_CONF_NORMAL ZT_CONF_NORMAL
#define DAHDI_CONF_PSEUDO_LISTENER ZT_CONF_PSEUDO_LISTENER
#define DAHDI_CONF_PSEUDO_TALKER ZT_CONF_PSEUDO_TALKER
#define DAHDI_CONF_REALANDPSEUDO ZT_CONF_REALANDPSEUDO
#define DAHDI_CONF_TALKER ZT_CONF_TALKER
#define DAHDI_CONFDIAG ZT_CONFDIAG
#define DAHDI_CONFINFO ZT_CONFINFO
#define DAHDI_CONFMUTE ZT_CONFMUTE
#define DAHDI_DEFAULT_NUM_BUFS ZT_DEFAULT_NUM_BUFS
#define DAHDI_DIAL ZT_DIAL
#define DAHDI_DIALING ZT_DIALING
#define DAHDI_DIAL_OP_APPEND ZT_DIAL_OP_APPEND
#define DAHDI_DIAL_OPERATION ZT_DIAL_OPERATION
#define DAHDI_DIAL_OP_REPLACE ZT_DIAL_OP_REPLACE
#define DAHDI_DIAL_PARAMS ZT_DIAL_PARAMS
#define DAHDI_ECHOCANCEL ZT_ECHOCANCEL
#define DAHDI_ECHOTRAIN ZT_ECHOTRAIN
#define DAHDI_EVENT_ALARM ZT_EVENT_ALARM
#define DAHDI_EVENT_BITSCHANGED ZT_EVENT_BITSCHANGED
#define DAHDI_EVENT_DIALCOMPLETE ZT_EVENT_DIALCOMPLETE
#define DAHDI_EVENT_DTMFDOWN ZT_EVENT_DTMFDOWN
#define DAHDI_EVENT_DTMFUP ZT_EVENT_DTMFUP
#define DAHDI_EVENT_EC_DISABLED ZT_EVENT_EC_DISABLED
#define DAHDI_EVENT_HOOKCOMPLETE ZT_EVENT_HOOKCOMPLETE
#define DAHDI_EVENT_NOALARM ZT_EVENT_NOALARM
#define DAHDI_EVENT_NONE ZT_EVENT_NONE
#define DAHDI_EVENT_ONHOOK ZT_EVENT_ONHOOK
#define DAHDI_EVENT_POLARITY ZT_EVENT_POLARITY
#define DAHDI_EVENT_PULSEDIGIT ZT_EVENT_PULSEDIGIT
#define DAHDI_EVENT_PULSE_START ZT_EVENT_PULSE_START
#define DAHDI_EVENT_REMOVED ZT_EVENT_REMOVED
#define DAHDI_EVENT_RINGBEGIN ZT_EVENT_RINGBEGIN
#define DAHDI_EVENT_RINGEROFF ZT_EVENT_RINGEROFF
#define DAHDI_EVENT_RINGERON ZT_EVENT_RINGERON
#define DAHDI_EVENT_RINGOFFHOOK ZT_EVENT_RINGOFFHOOK
#define DAHDI_EVENT_TIMER_EXPIRED ZT_EVENT_TIMER_EXPIRED
#define DAHDI_EVENT_TIMER_PING ZT_EVENT_TIMER_PING
#define DAHDI_EVENT_WINKFLASH ZT_EVENT_WINKFLASH
#define DAHDI_FLASH ZT_FLASH
#define DAHDI_FLUSH ZT_FLUSH
#define DAHDI_FLUSH_ALL ZT_FLUSH_ALL
#define DAHDI_FLUSH_BOTH ZT_FLUSH_BOTH
#define DAHDI_FLUSH_READ ZT_FLUSH_READ
#define DAHDI_FLUSH_WRITE ZT_FLUSH_WRITE
#define DAHDI_GAINS ZT_GAINS
#define DAHDI_GET_BUFINFO ZT_GET_BUFINFO
#define DAHDI_GETCONF ZT_GETCONF
#define DAHDI_GETCONFMUTE ZT_GETCONFMUTE
#define DAHDI_GETEVENT ZT_GETEVENT
#define DAHDI_GETGAINS ZT_GETGAINS
#define DAHDI_GET_PARAMS ZT_GET_PARAMS
#define DAHDI_HOOK ZT_HOOK
#define DAHDI_IOMUX ZT_IOMUX
#define DAHDI_IOMUX_READ ZT_IOMUX_READ
#define DAHDI_IOMUX_SIGEVENT ZT_IOMUX_SIGEVENT
#define DAHDI_IOMUX_WRITE ZT_IOMUX_WRITE
#define DAHDI_LAW_ALAW ZT_LAW_ALAW
#define DAHDI_LAW_DEFAULT ZT_LAW_DEFAULT
#define DAHDI_LAW_MULAW ZT_LAW_MULAW
#define DAHDI_MAX_NUM_BUFS ZT_MAX_NUM_BUFS
#define DAHDI_MAX_SPANS ZT_MAX_SPANS
#define DAHDI_OFFHOOK ZT_OFFHOOK
#define DAHDI_ONHOOK ZT_ONHOOK
#define DAHDI_ONHOOKTRANSFER ZT_ONHOOKTRANSFER
#define DAHDI_PARAMS ZT_PARAMS
#define DAHDI_POLICY_IMMEDIATE ZT_POLICY_IMMEDIATE
#define DAHDI_PRI ZT_PRI
#define DAHDI_RING ZT_RING
#define DAHDI_RINGOFF ZT_RINGOFF
#define DAHDI_SENDTONE ZT_SENDTONE
#define DAHDI_SET_BLOCKSIZE ZT_SET_BLOCKSIZE
#define DAHDI_SET_BUFINFO ZT_SET_BUFINFO
#define DAHDI_SETCADENCE ZT_SETCADENCE
#define DAHDI_SETCONF ZT_SETCONF
#define DAHDI_SET_DIALPARAMS ZT_SET_DIALPARAMS
#define DAHDI_SETGAINS ZT_SETGAINS
#define DAHDI_SETLAW ZT_SETLAW
#define DAHDI_SETLINEAR ZT_SETLINEAR
#define DAHDI_SET_PARAMS ZT_SET_PARAMS
#define DAHDI_SETTONEZONE ZT_SETTONEZONE
#define DAHDI_SIG_CLEAR ZT_SIG_CLEAR
#define DAHDI_SIG_EM ZT_SIG_EM
#define DAHDI_SIG_EM_E1 ZT_SIG_EM_E1
#define DAHDI_SIG_FXO ZT_SIG_FXO
#define DAHDI_SIG_FXOGS ZT_SIG_FXOGS
#define DAHDI_SIG_FXOKS ZT_SIG_FXOKS
#define DAHDI_SIG_FXOLS ZT_SIG_FXOLS
#define DAHDI_SIG_FXS ZT_SIG_FXS
#define DAHDI_SIG_FXSGS ZT_SIG_FXSGS
#define DAHDI_SIG_FXSKS ZT_SIG_FXSKS
#define DAHDI_SIG_FXSLS ZT_SIG_FXSLS
#define DAHDI_SIG_HARDHDLC ZT_SIG_HARDHDLC
#define DAHDI_SIG_HDLCFCS ZT_SIG_HDLCFCS
#define DAHDI_SIG_SF ZT_SIG_SF
#define DAHDI_SPANINFO ZT_SPANINFO
#define DAHDI_SPANSTAT ZT_SPANSTAT
#define DAHDI_SPECIFY ZT_SPECIFY
#define DAHDI_START ZT_START
#define DAHDI_TCOP_ALLOCATE ZT_TCOP_ALLOCATE
#define DAHDI_TCOP_GETINFO ZT_TCOP_GETINFO
#define DAHDI_TCOP_RELEASE ZT_TCOP_RELEASE
#define DAHDI_TCOP_TRANSCODE ZT_TCOP_TRANSCODE
#define DAHDI_TIMERACK ZT_TIMERACK
#define DAHDI_TIMERCONFIG ZT_TIMERCONFIG
#define DAHDI_TIMERPING ZT_TIMERPING
#define DAHDI_TIMERPONG ZT_TIMERPONG
#define DAHDI_TONE_BUSY ZT_TONE_BUSY
#define DAHDI_TONE_CONGESTION ZT_TONE_CONGESTION
#define DAHDI_TONEDETECT ZT_TONEDETECT
#define DAHDI_TONEDETECT_MUTE ZT_TONEDETECT_MUTE
#define DAHDI_TONEDETECT_ON ZT_TONEDETECT_ON
#define DAHDI_TONE_DIALRECALL ZT_TONE_DIALRECALL
#define DAHDI_TONE_DIALTONE ZT_TONE_DIALTONE
#define DAHDI_TONE_DTMF_A ZT_TONE_DTMF_A
#define DAHDI_TONE_DTMF_BASE ZT_TONE_DTMF_BASE
#define DAHDI_TONE_DTMF_p ZT_TONE_DTMF_p
#define DAHDI_TONE_DTMF_s ZT_TONE_DTMF_s
#define DAHDI_TONE_INFO ZT_TONE_INFO
#define DAHDI_TONE_RINGTONE ZT_TONE_RINGTONE
#define DAHDI_TONE_STUTTER ZT_TONE_STUTTER
#define DAHDI_TRANSCODE_HEADER ZT_TRANSCODE_HEADER
#define DAHDI_TRANSCODE_INFO ZT_TRANSCODE_INFO
#define DAHDI_TRANSCODE_MAGIC ZT_TRANSCODE_MAGIC
#define DAHDI_TRANSCODE_OP ZT_TRANSCODE_OP
#define DAHDI_vldtmf ZT_vldtmf
#define DAHDI_WINK ZT_WINK
#define HAVE_DAHDI HAVE_ZAPTEL
#define dahdi_ring_cadence zt_ring_cadence
#endif
#endif /* DAHDI_COMPAT_H */

@ -34,8 +34,8 @@
#include "asterisk/lock.h"
struct tone_zone_sound {
struct tone_zone_sound *next; /* next element */
struct ind_tone_zone_sound {
struct ind_tone_zone_sound *next; /* next element */
const char *name; /* Identifing name */
const char *data; /* Actual zone description */
/* Description is a series of tones of the format:
@ -45,33 +45,33 @@ struct tone_zone_sound {
specified in milliseconds */
};
struct tone_zone {
struct tone_zone* next; /* next in list */
struct ind_tone_zone {
struct ind_tone_zone* next; /* next in list */
char country[5]; /* Country code */
char alias[5]; /* is this an alias? */
char description[40]; /* Description */
int nrringcadence; /* # registered ringcadence elements */
int *ringcadence; /* Ring cadence */
struct tone_zone_sound *tones; /* The known tones for this zone */
struct ind_tone_zone_sound *tones; /* The known tones for this zone */
};
/* set the default tone country */
int ast_set_indication_country(const char *country);
/* locate tone_zone, given the country. if country == NULL, use the default country */
struct tone_zone *ast_get_indication_zone(const char *country);
/* locate a tone_zone_sound, given the tone_zone. if tone_zone == NULL, use the default tone_zone */
struct tone_zone_sound *ast_get_indication_tone(const struct tone_zone *zone, const char *indication);
/* locate ind_tone_zone, given the country. if country == NULL, use the default country */
struct ind_tone_zone *ast_get_indication_zone(const char *country);
/* locate a ind_tone_zone_sound, given the ind_tone_zone. if ind_tone_zone == NULL, use the default ind_tone_zone */
struct ind_tone_zone_sound *ast_get_indication_tone(const struct ind_tone_zone *zone, const char *indication);
/* add a new country, if country exists, it will be replaced. */
int ast_register_indication_country(struct tone_zone *country);
int ast_register_indication_country(struct ind_tone_zone *country);
/* remove an existing country and all its indications, country must exist */
int ast_unregister_indication_country(const char *country);
/* add a new indication to a tone_zone. tone_zone must exist. if the indication already
/* add a new indication to a ind_tone_zone. ind_tone_zone must exist. if the indication already
* exists, it will be replaced. */
int ast_register_indication(struct tone_zone *zone, const char *indication, const char *tonelist);
/* remove an existing tone_zone's indication. tone_zone must exist */
int ast_unregister_indication(struct tone_zone *zone, const char *indication);
int ast_register_indication(struct ind_tone_zone *zone, const char *indication, const char *tonelist);
/* remove an existing ind_tone_zone's indication. ind_tone_zone must exist */
int ast_unregister_indication(struct ind_tone_zone *zone, const char *indication);
/* Start a tone-list going */
int ast_playtones_start(struct ast_channel *chan, int vol, const char* tonelist, int interruptible);
@ -79,10 +79,10 @@ int ast_playtones_start(struct ast_channel *chan, int vol, const char* tonelist,
void ast_playtones_stop(struct ast_channel *chan);
/* support for walking through a list of indications */
struct tone_zone *ast_walk_indications(const struct tone_zone *cur);
struct ind_tone_zone *ast_walk_indications(const struct ind_tone_zone *cur);
#if 0
extern struct tone_zone *tone_zones;
extern struct ind_tone_zone *ind_tone_zones;
extern ast_mutex_t tzlock;
#endif

@ -29,6 +29,7 @@ extern "C" {
#define AST_CACHE_DIR_LEN 512
#define AST_FILENAME_MAX 80
#define AST_CHANNEL_NAME 80
/*! \ingroup main_options */
enum ast_option_flags {
@ -121,6 +122,7 @@ extern pid_t ast_mainpid;
extern char record_cache_dir[AST_CACHE_DIR_LEN];
extern char debug_filename[AST_FILENAME_MAX];
extern char dahdi_chan_name[AST_CHANNEL_NAME];
extern int ast_language_is_prefix;

@ -64,7 +64,7 @@ of 'maxlen' or 'size' minus the original strlen() of collect digits.
*/
int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect, size_t size, int maxlen, int timeout)
{
struct tone_zone_sound *ts;
struct ind_tone_zone_sound *ts;
int res=0, x=0;
if (maxlen > size)

@ -81,9 +81,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <pwd.h>
#include <sys/stat.h>
#ifdef HAVE_ZAPTEL
#if defined(HAVE_ZAPTEL) || defined (HAVE_DAHDI)
#include <sys/ioctl.h>
#include <zaptel/zaptel.h>
#include "asterisk/dahdi_compat.h"
#endif
#ifdef linux
@ -172,6 +172,7 @@ int option_maxcalls; /*!< Max number of active calls */
char record_cache_dir[AST_CACHE_DIR_LEN] = AST_TMP_DIR;
char debug_filename[AST_FILENAME_MAX] = "";
char dahdi_chan_name[AST_CHANNEL_NAME] = "ZAP";
static int ast_socket = -1; /*!< UNIX Socket for allowing remote control */
static int ast_consock = -1; /*!< UNIX Socket for controlling another asterisk */
@ -2578,6 +2579,10 @@ static void ast_readconfig(void)
ast_copy_string(ast_config_AST_SYSTEM_NAME, v->value, sizeof(ast_config_AST_SYSTEM_NAME));
} else if (!strcasecmp(v->name, "languageprefix")) {
ast_language_is_prefix = ast_true(v->value);
} else if (!strcasecmp(v->name, "dahdichanname")) {
if (!strcasecmp(v->value, "yes")) {
ast_copy_string(dahdi_chan_name, "DAHDI", sizeof(dahdi_chan_name));
}
}
}
ast_config_destroy(cfg);
@ -2964,7 +2969,7 @@ int main(int argc, char *argv[])
int x = 160;
fd = open("/dev/zap/timer", O_RDWR);
if (fd >= 0) {
if (ioctl(fd, ZT_TIMERCONFIG, &x)) {
if (ioctl(fd, DAHDI_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);
exit(1);
}
@ -2985,6 +2990,34 @@ int main(int argc, char *argv[])
close(fd);
}
}
#elif defined(HAVE_DAHDI)
{
int fd;
int x = 160;
fd = open("/dev/dahdi/timer", O_RDWR);
if (fd >= 0) {
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 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 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", dahdi_timer_error);
exit(1);
}
close(fd);
}
}
#endif
threadstorage_init();

@ -37,9 +37,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <unistd.h>
#include <math.h>
#ifdef HAVE_ZAPTEL
#if defined(HAVE_ZAPTEL) || defined (HAVE_DAHDI)
#include <sys/ioctl.h>
#include <zaptel/zaptel.h>
#include "asterisk/dahdi_compat.h"
#endif
#include "asterisk/pbx.h"
@ -742,13 +742,19 @@ struct ast_channel *ast_channel_alloc(int needqueue, int state, const char *cid_
for (x = 0; x < AST_MAX_FDS - 2; x++)
tmp->fds[x] = -1;
#ifdef HAVE_DAHDI
#ifdef HAVE_ZAPTEL
tmp->timingfd = open("/dev/zap/timer", O_RDWR);
#else
tmp->timingfd = open("/dev/dahdi/timer", O_RDWR);
#endif
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
@ -759,7 +765,7 @@ struct ast_channel *ast_channel_alloc(int needqueue, int state, const char *cid_
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
@ -937,9 +943,9 @@ int ast_queue_frame(struct ast_channel *chan, struct ast_frame *fin)
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);
@ -1805,7 +1811,7 @@ int ast_waitfordigit(struct ast_channel *c, int ms)
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;
@ -1813,7 +1819,7 @@ int ast_settimeout(struct ast_channel *c, int samples, int (*func)(const void *d
}
if (option_debug)
ast_log(LOG_DEBUG, "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;
}
@ -2020,26 +2026,26 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
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;
@ -2048,7 +2054,7 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
func(data);
} else {
blah = 0;
ioctl(chan->timingfd, ZT_TIMERCONFIG, &blah);
ioctl(chan->timingfd, DAHDI_TIMERCONFIG, &blah);
chan->timingdata = NULL;
ast_channel_unlock(chan);
}
@ -2405,7 +2411,7 @@ int ast_indicate_data(struct ast_channel *chan, int condition, const void *data,
if (condition < 0)
ast_playtones_stop(chan);
else {
const struct tone_zone_sound *ts = NULL;
const struct ind_tone_zone_sound *ts = NULL;
switch (condition) {
case AST_CONTROL_RINGING:
ts = ast_get_indication_tone(chan->zone, "ring");
@ -3024,6 +3030,11 @@ struct ast_channel *ast_request(const char *type, int format, void *data, int *c
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;

@ -679,7 +679,7 @@ static enum fsread_res ast_readaudio_callback(struct ast_filestream *s)
}
}
if (whennext != s->lasttimeout) {
#ifdef HAVE_ZAPTEL
#ifdef HAVE_DAHDI
if (s->owner->timingfd > -1) {
int zap_timer_samples = whennext;
int rate;
@ -702,7 +702,7 @@ static enum fsread_res ast_readaudio_callback(struct ast_filestream *s)
return_failure:
s->owner->streamid = -1;
#ifdef HAVE_ZAPTEL
#ifdef HAVE_DAHDI
ast_settimeout(s->owner, 0, NULL, NULL);
#endif
return FSREAD_FAILURE;
@ -813,7 +813,7 @@ int ast_closestream(struct ast_filestream *f)
if (f->fmt->format < AST_FORMAT_MAX_AUDIO) {
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 {

@ -329,21 +329,21 @@ void ast_playtones_stop(struct ast_channel *chan)
/*--------------------------------------------*/
static struct tone_zone *tone_zones;
static struct tone_zone *current_tonezone;
static struct ind_tone_zone *ind_tone_zones;
static struct ind_tone_zone *current_tonezone;
/* Protect the tone_zones list (highly unlikely that two things would change
/* Protect the ind_tone_zones list (highly unlikely that two things would change
* it at the same time, but still! */
AST_MUTEX_DEFINE_STATIC(tzlock);
struct tone_zone *ast_walk_indications(const struct tone_zone *cur)
struct ind_tone_zone *ast_walk_indications(const struct ind_tone_zone *cur)
{
struct tone_zone *tz;
struct ind_tone_zone *tz;
if (cur == NULL)
return tone_zones;
return ind_tone_zones;
ast_mutex_lock(&tzlock);
for (tz = tone_zones; tz; tz = tz->next)
for (tz = ind_tone_zones; tz; tz = tz->next)
if (tz == cur)
break;
if (tz)
@ -356,7 +356,7 @@ struct tone_zone *ast_walk_indications(const struct tone_zone *cur)
int ast_set_indication_country(const char *country)
{
if (country) {
struct tone_zone *z = ast_get_indication_zone(country);
struct ind_tone_zone *z = ast_get_indication_zone(country);
if (z) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Setting default indication country to '%s'\n",country);
@ -367,25 +367,25 @@ int ast_set_indication_country(const char *country)
return 1; /* not found */
}
/* locate tone_zone, given the country. if country == NULL, use the default country */
struct tone_zone *ast_get_indication_zone(const char *country)
/* locate ind_tone_zone, given the country. if country == NULL, use the default country */
struct ind_tone_zone *ast_get_indication_zone(const char *country)
{
struct tone_zone *tz;
struct ind_tone_zone *tz;
int alias_loop = 0;
/* we need some tonezone, pick the first */
if (country == NULL && current_tonezone)
return current_tonezone; /* default country? */
if (country == NULL && tone_zones)
return tone_zones; /* any country? */
if (country == NULL && ind_tone_zones)
return ind_tone_zones; /* any country? */
if (country == NULL)
return 0; /* not a single country insight */
ast_mutex_lock(&tzlock);
do {
for (tz=tone_zones; tz; tz=tz->next) {
for (tz=ind_tone_zones; tz; tz=tz->next) {
if (strcasecmp(country,tz->country)==0) {
/* tone_zone found */
/* ind_tone_zone found */
if (tz->alias && tz->alias[0]) {
country = tz->alias;
break;
@ -402,16 +402,16 @@ struct tone_zone *ast_get_indication_zone(const char *country)
return 0;
}
/* locate a tone_zone_sound, given the tone_zone. if tone_zone == NULL, use the default tone_zone */
struct tone_zone_sound *ast_get_indication_tone(const struct tone_zone *zone, const char *indication)
/* locate a ind_tone_zone_sound, given the ind_tone_zone. if ind_tone_zone == NULL, use the default ind_tone_zone */
struct ind_tone_zone_sound *ast_get_indication_tone(const struct ind_tone_zone *zone, const char *indication)
{
struct tone_zone_sound *ts;
struct ind_tone_zone_sound *ts;
/* we need some tonezone, pick the first */
if (zone == NULL && current_tonezone)
zone = current_tonezone; /* default country? */
if (zone == NULL && tone_zones)
zone = tone_zones; /* any country? */
if (zone == NULL && ind_tone_zones)
zone = ind_tone_zones; /* any country? */
if (zone == NULL)
return 0; /* not a single country insight */
@ -428,11 +428,11 @@ struct tone_zone_sound *ast_get_indication_tone(const struct tone_zone *zone, co
return 0;
}
/* helper function to delete a tone_zone in its entirety */
static inline void free_zone(struct tone_zone* zone)
/* helper function to delete a ind_tone_zone in its entirety */
static inline void free_zone(struct ind_tone_zone* zone)
{
while (zone->tones) {
struct tone_zone_sound *tmp = zone->tones->next;
struct ind_tone_zone_sound *tmp = zone->tones->next;
free((void*)zone->tones->name);
free((void*)zone->tones->data);
free(zone->tones);
@ -446,19 +446,19 @@ static inline void free_zone(struct tone_zone* zone)
/*--------------------------------------------*/
/* add a new country, if country exists, it will be replaced. */
int ast_register_indication_country(struct tone_zone *zone)
int ast_register_indication_country(struct ind_tone_zone *zone)
{
struct tone_zone *tz,*pz;
struct ind_tone_zone *tz,*pz;
ast_mutex_lock(&tzlock);
for (pz=NULL,tz=tone_zones; tz; pz=tz,tz=tz->next) {
for (pz=NULL,tz=ind_tone_zones; tz; pz=tz,tz=tz->next) {
if (strcasecmp(zone->country,tz->country)==0) {
/* tone_zone already there, replace */
/* ind_tone_zone already there, replace */
zone->next = tz->next;
if (pz)
pz->next = zone;
else
tone_zones = zone;
ind_tone_zones = zone;
/* if we are replacing the default zone, re-point it */
if (tz == current_tonezone)
current_tonezone = zone;
@ -473,7 +473,7 @@ int ast_register_indication_country(struct tone_zone *zone)
if (pz)
pz->next = zone;
else
tone_zones = zone;
ind_tone_zones = zone;
ast_mutex_unlock(&tzlock);
if (option_verbose > 2)
@ -485,21 +485,21 @@ int ast_register_indication_country(struct tone_zone *zone)
* Also, all countries which are an alias for the specified country are removed. */
int ast_unregister_indication_country(const char *country)
{
struct tone_zone *tz, *pz = NULL, *tmp;
struct ind_tone_zone *tz, *pz = NULL, *tmp;
int res = -1;
ast_mutex_lock(&tzlock);
tz = tone_zones;
tz = ind_tone_zones;
while (tz) {
if (country==NULL ||
(strcasecmp(country, tz->country)==0 ||
strcasecmp(country, tz->alias)==0)) {
/* tone_zone found, remove */
/* ind_tone_zone found, remove */
tmp = tz->next;
if (pz)
pz->next = tmp;
else
tone_zones = tmp;
ind_tone_zones = tmp;
/* if we are unregistering the default country, w'll notice */
if (tz == current_tonezone) {
ast_log(LOG_NOTICE,"Removed default indication country '%s'\n",tz->country);
@ -508,8 +508,8 @@ int ast_unregister_indication_country(const char *country)
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Unregistered indication country '%s'\n",tz->country);
free_zone(tz);
if (tone_zones == tz)
tone_zones = tmp;
if (ind_tone_zones == tz)
ind_tone_zones = tmp;
tz = tmp;
res = 0;
}
@ -523,11 +523,11 @@ int ast_unregister_indication_country(const char *country)
return res;
}
/* add a new indication to a tone_zone. tone_zone must exist. if the indication already
/* add a new indication to a ind_tone_zone. ind_tone_zone must exist. if the indication already
* exists, it will be replaced. */
int ast_register_indication(struct tone_zone *zone, const char *indication, const char *tonelist)
int ast_register_indication(struct ind_tone_zone *zone, const char *indication, const char *tonelist)
{
struct tone_zone_sound *ts,*ps;
struct ind_tone_zone_sound *ts,*ps;
/* is it an alias? stop */
if (zone->alias[0])
@ -563,9 +563,9 @@ int ast_register_indication(struct tone_zone *zone, const char *indication, cons
}
/* remove an existing country's indication. Both country and indication must exist */
int ast_unregister_indication(struct tone_zone *zone, const char *indication)
int ast_unregister_indication(struct ind_tone_zone *zone, const char *indication)
{
struct tone_zone_sound *ts,*ps = NULL, *tmp;
struct ind_tone_zone_sound *ts,*ps = NULL, *tmp;
int res = -1;
/* is it an alias? stop */

@ -742,6 +742,23 @@ static struct load_order_entry *add_to_load_order(const char *resource, struct l
return order;
}
static int translate_module_name(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;
@ -751,6 +768,9 @@ int load_modules(unsigned int preload_only)
unsigned int load_count;
struct load_order load_order;
int res = 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;
@ -773,8 +793,12 @@ int load_modules(unsigned int preload_only)
/* 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 */
@ -830,7 +854,10 @@ int load_modules(unsigned int preload_only)
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(&load_order, entry);
free(order->resource);
free(order);

@ -165,6 +165,8 @@ VORBIS_LIB=@VORBIS_LIB@
VPBAPI_INCLUDE=@VPB_INCLUDE@
VPBAPI_LIB=@VPB_LIB@
DAHDI_INCLUDE=@DAHDI_INCLUDE@
ZAPTEL_INCLUDE=@ZAPTEL_INCLUDE@
ZLIB_INCLUDE=@ZLIB_INCLUDE@

@ -2361,7 +2361,7 @@ static void pbx_load_users(void)
{
struct ast_config *cfg;
char *cat, *chan;
const char *zapchan;
const char *dahdichan;
const char *hasexten;
char tmp[256];
char iface[256];
@ -2397,11 +2397,21 @@ static void pbx_load_users(void)
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));
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(zapcopy, dahdichan, sizeof(zapcopy));
c = zapcopy;
chan = strsep(&c, ",");
while (chan) {

@ -85,7 +85,7 @@ char *playtones_desc=
*/
static int handle_add_indication(int fd, int argc, char *argv[])
{
struct tone_zone *tz;
struct ind_tone_zone *tz;
int created_country = 0;
if (argc != 5) return RESULT_SHOWUSAGE;
@ -119,7 +119,7 @@ static int handle_add_indication(int fd, int argc, char *argv[])
*/
static int handle_remove_indication(int fd, int argc, char *argv[])
{
struct tone_zone *tz;
struct ind_tone_zone *tz;
if (argc != 3 && argc != 4) return RESULT_SHOWUSAGE;
if (argc == 3) {
@ -148,7 +148,7 @@ static int handle_remove_indication(int fd, int argc, char *argv[])
*/
static int handle_show_indications(int fd, int argc, char *argv[])
{
struct tone_zone *tz = NULL;
struct ind_tone_zone *tz = NULL;
char buf[256];
int found_country = 0;
@ -166,7 +166,7 @@ static int handle_show_indications(int fd, int argc, char *argv[])
for (i=2; i<argc; i++) {
if (strcasecmp(tz->country,argv[i])==0 &&
!tz->alias[0]) {
struct tone_zone_sound* ts;
struct ind_tone_zone_sound* ts;
if (!found_country) {
found_country = 1;
ast_cli(fd,"Country Indication PlayList\n"
@ -196,7 +196,7 @@ static int handle_show_indications(int fd, int argc, char *argv[])
*/
static int handle_playtones(struct ast_channel *chan, void *data)
{
struct tone_zone_sound *ts;
struct ind_tone_zone_sound *ts;
int res;
if (!data || !((char*)data)[0]) {
@ -231,7 +231,7 @@ static int ind_load_module(void)
struct ast_variable *v;
char *cxt;
char *c;
struct tone_zone *tones;
struct ind_tone_zone *tones;
const char *country = NULL;
/* that the following cast is needed, is yuk! */
@ -284,7 +284,7 @@ static int ind_load_module(void)
c = countries;
country = strsep(&c,",");
while (country) {
struct tone_zone* azone;
struct ind_tone_zone* azone;
if (!(azone = ast_calloc(1, sizeof(*azone)))) {
ast_config_destroy(cfg);
return -1;
@ -300,7 +300,7 @@ static int ind_load_module(void)
}
} else {
/* add tone to country */
struct tone_zone_sound *ps,*ts;
struct ind_tone_zone_sound *ps,*ts;
for (ps=NULL,ts=tones->tones; ts; ps=ts, ts=ts->next) {
if (strcasecmp(v->name,ts->name)==0) {
/* already there */

@ -52,10 +52,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <thread.h>
#endif
#ifdef HAVE_ZAPTEL
#include <zaptel/zaptel.h>
#endif
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/logger.h"
@ -72,6 +68,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/stringfields.h"
#include "asterisk/linkedlists.h"
#include "asterisk/dahdi_compat.h"
#define INITIAL_NUM_FILES 8
static char *app0 = "MusicOnHold";
@ -865,7 +863,7 @@ static int moh_scan_files(struct mohclass *class) {
static int moh_register(struct mohclass *moh, int reload)
{
#ifdef HAVE_ZAPTEL
#ifdef HAVE_DAHDI
int x;
#endif
struct mohclass *mohclass = NULL;
@ -909,15 +907,19 @@ static int moh_register(struct mohclass *moh, int reload)
ast_set_flag(moh, MOH_QUIET);
moh->srcfd = -1;
#ifdef HAVE_ZAPTEL
#ifdef HAVE_DAHDI
/* Open /dev/zap/pseudo for timing... Is
there a better, yet reliable way to do this? */
#ifdef HAVE_ZAPTEL
moh->pseudofd = open("/dev/zap/pseudo", O_RDONLY);
#else
moh->pseudofd = open("/dev/dahdi/pseudo", O_RDONLY);
#endif
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;

@ -621,7 +621,7 @@ static u_char *ast_var_indications(struct variable *vp, oid *name, size_t *lengt
int exact, size_t *var_len, WriteMethod **write_method)
{
static unsigned long long_ret;
struct tone_zone *tz = NULL;
struct ind_tone_zone *tz = NULL;
if (header_generic(vp, name, length, exact, var_len, write_method))
return NULL;
@ -651,7 +651,7 @@ static u_char *ast_var_indications_table(struct variable *vp, oid *name, size_t
int exact, size_t *var_len, WriteMethod **write_method)
{
static unsigned long long_ret;
struct tone_zone *tz = NULL;
struct ind_tone_zone *tz = NULL;
int i;
if (header_simple_table(vp, name, length, exact, var_len, write_method, -1))

Loading…
Cancel
Save