]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
allow tonezone to live in a different place than DAHDI/Zaptel, since dahdi-tools...
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 25 Jun 2008 22:21:30 +0000 (22:21 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 25 Jun 2008 22:21:30 +0000 (22:21 +0000)
don't include tonezone.h in dahdi_compat.h, because only a couple of modules need it

get app_rpt building again after the DAHDI changes

(closes issue #12911)
Reported by: tzafrir

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125132 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_rpt.c
channels/chan_dahdi.c
configure
configure.ac
include/asterisk/dahdi_compat.h
include/asterisk/tonezone_compat.h [new file with mode: 0644]

index cc6c680dac7487990f085cf8d0f770249bcad565..7b209378cbdd64e807f32b1f37a5940cdaa09e8a 100644 (file)
 */
 
 /*** MODULEINFO
-       <depend>zaptel</depend>
+       <depend>dahdi</depend>
        <depend>tonezone</depend>
        <defaultenabled>no</defaultenabled>
  ***/
@@ -276,15 +276,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include <sys/io.h>
 #include <sys/vfs.h>
 #include <math.h>
-#ifdef OLD_ASTERISK
-#include <linux/zaptel.h>
-#include <tonezone.h>
-#else
-#include <zaptel/zaptel.h>
-#include <zaptel/tonezone.h>
-#endif
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#include <termios.h>
 
 #include "asterisk/utils.h"
 #include "asterisk/lock.h"
@@ -303,7 +297,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/localtime.h"
 #include "asterisk/cdr.h"
 #include "asterisk/options.h"
-#include <termios.h>
+
+#include "asterisk/dahdi_compat.h"
+#include "asterisk/tonezone_compat.h"
 
 /* Start a tone-list going */
 int ast_playtones_start(struct ast_channel *chan, int vol, const char* tonelist, int interruptible);
@@ -2609,7 +2605,7 @@ static struct morse_bits mbits[] = {
        */
 
        for(i = 0; i < 20 ; i++){
-               flags =  DAHDI_IOMUX_WRITEEMPTY | ZT_IOMUX_NOWAIT; 
+               flags =  DAHDI_IOMUX_WRITEEMPTY | DAHDI_IOMUX_NOWAIT; 
                res = ioctl(chan->fds[0], DAHDI_IOMUX, &flags);
                if(flags & DAHDI_IOMUX_WRITEEMPTY)
                        break;
@@ -2660,7 +2656,7 @@ static int send_tone_telemetry(struct ast_channel *chan, char *tonestring)
        */
 
        for(i = 0; i < 20 ; i++){
-               flags =  DAHDI_IOMUX_WRITEEMPTY | ZT_IOMUX_NOWAIT; 
+               flags =  DAHDI_IOMUX_WRITEEMPTY | DAHDI_IOMUX_NOWAIT; 
                res = ioctl(chan->fds[0], DAHDI_IOMUX, &flags);
                if(flags & DAHDI_IOMUX_WRITEEMPTY)
                        break;
@@ -2920,7 +2916,7 @@ char lbuf[MAXLINKLIST],*strs[MAXLINKLIST];
 int    i,ns,rbimode;
 char mhz[MAXREMSTR];
 char decimals[MAXREMSTR];
-struct zt_params par;
+struct dahdi_params par;
 
 
        /* get a pointer to myrpt */
@@ -4181,8 +4177,8 @@ struct ast_channel *mychannel,*genchannel;
 #endif
        ci.chan = 0;
        ci.confno = myrpt->conf; /* use the pseudo conference */
-       ci.confmode = DAHDI_CONF_REALANDPSEUDO | ZT_CONF_TALKER | ZT_CONF_LISTENER
-               | DAHDI_CONF_PSEUDO_TALKER | ZT_CONF_PSEUDO_LISTENER; 
+       ci.confmode = DAHDI_CONF_REALANDPSEUDO | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER
+               | DAHDI_CONF_PSEUDO_TALKER | DAHDI_CONF_PSEUDO_LISTENER; 
        /* first put the channel on the conference */
        if (ioctl(mychannel->fds[0],DAHDI_SETCONF,&ci) == -1)
        {
@@ -4204,8 +4200,8 @@ struct ast_channel *mychannel,*genchannel;
 #endif
        ci.chan = 0;
        ci.confno = myrpt->conf;
-       ci.confmode = DAHDI_CONF_REALANDPSEUDO | ZT_CONF_TALKER | ZT_CONF_LISTENER
-               | DAHDI_CONF_PSEUDO_TALKER | ZT_CONF_PSEUDO_LISTENER; 
+       ci.confmode = DAHDI_CONF_REALANDPSEUDO | DAHDI_CONF_TALKER | DAHDI_CONF_LISTENER
+               | DAHDI_CONF_PSEUDO_TALKER | DAHDI_CONF_PSEUDO_LISTENER; 
        /* first put the channel on the conference */
        if (ioctl(genchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
        {
@@ -4347,7 +4343,7 @@ struct ast_channel *mychannel,*genchannel;
        ci.chan = 0;
        ci.confno = myrpt->conf;
        ci.confmode = (myrpt->p.duplex == 2) ? DAHDI_CONF_CONFANNMON :
-               (DAHDI_CONF_CONF | ZT_CONF_LISTENER | ZT_CONF_TALKER);
+               (DAHDI_CONF_CONF | DAHDI_CONF_LISTENER | DAHDI_CONF_TALKER);
        /* first put the channel on the conference in announce mode */
        if (ioctl(myrpt->pchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
        {
@@ -4402,7 +4398,7 @@ struct ast_channel *mychannel,*genchannel;
        ci.chan = 0;
        ci.confno = myrpt->conf;
        ci.confmode = ((myrpt->p.duplex == 2) || (myrpt->p.duplex == 4)) ? DAHDI_CONF_CONFANNMON :
-               (DAHDI_CONF_CONF | ZT_CONF_LISTENER | ZT_CONF_TALKER);
+               (DAHDI_CONF_CONF | DAHDI_CONF_LISTENER | DAHDI_CONF_TALKER);
        /* first put the channel on the conference in announce mode */
        if (ioctl(myrpt->pchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
        {
@@ -4610,7 +4606,7 @@ 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 = DAHDI_CONF_CONF | ZT_CONF_LISTENER | ZT_CONF_TALKER;
+       ci.confmode = DAHDI_CONF_CONF | DAHDI_CONF_LISTENER | DAHDI_CONF_TALKER;
        /* first put the channel on the conference in proper mode */
        if (ioctl(l->pchan->fds[0], DAHDI_SETCONF, &ci) == -1)
        {
@@ -5847,9 +5843,9 @@ static void rbi_out_parallel(struct rpt *myrpt,unsigned char *data)
 
 static void rbi_out(struct rpt *myrpt,unsigned char *data)
 {
-struct zt_radio_param r;
+struct dahdi_radio_param r;
 
-       memset(&r,0,sizeof(struct zt_radio_param));
+       memset(&r,0,sizeof(struct dahdi_radio_param));
        r.radpar = DAHDI_RADPAR_REMMODE;
        r.data = DAHDI_RADPAR_REM_RBI1;
        /* if setparam ioctl fails, its probably not a pciradio card */
@@ -5871,7 +5867,7 @@ static int serial_remote_io(struct rpt *myrpt, unsigned char *txbuf, int txbytes
        unsigned char *rxbuf, int rxmaxbytes, int asciiflag)
 {
        int i,j,index,oldmode,olddata;
-       struct zt_radio_param prm;
+       struct dahdi_radio_param prm;
        char c;
 
        if(debug){
@@ -8963,7 +8959,7 @@ char tmpstr[300],lstr[MAXLINKLIST];
        /* make a conference for the tx */
        ci.chan = 0;
        ci.confno = -1; /* make a new conf */
-       ci.confmode = DAHDI_CONF_CONF | ZT_CONF_LISTENER;
+       ci.confmode = DAHDI_CONF_CONF | DAHDI_CONF_LISTENER;
        /* first put the channel on the conference in proper mode */
        if (ioctl(myrpt->zaptxchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
        {
@@ -8983,7 +8979,7 @@ char tmpstr[300],lstr[MAXLINKLIST];
        ci.chan = 0;
        ci.confno = -1; /* make a new conf */
        ci.confmode = ((myrpt->p.duplex == 2) || (myrpt->p.duplex == 4)) ? DAHDI_CONF_CONFANNMON :
-               (DAHDI_CONF_CONF | ZT_CONF_LISTENER | ZT_CONF_TALKER);
+               (DAHDI_CONF_CONF | DAHDI_CONF_LISTENER | DAHDI_CONF_TALKER);
        /* first put the channel on the conference in announce mode */
        if (ioctl(myrpt->pchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
        {
@@ -9057,7 +9053,7 @@ char tmpstr[300],lstr[MAXLINKLIST];
        /* make a conference for the tx */
        ci.chan = 0;
        ci.confno = myrpt->txconf;
-       ci.confmode = DAHDI_CONF_CONF | ZT_CONF_TALKER ;
+       ci.confmode = DAHDI_CONF_CONF | DAHDI_CONF_TALKER ;
        /* first put the channel on the conference in proper mode */
        if (ioctl(myrpt->txpchannel->fds[0],DAHDI_SETCONF,&ci) == -1)
        {
@@ -10572,7 +10568,7 @@ static int rpt_exec(struct ast_channel *chan, void *data)
        DAHDI_PARAMS par;
        int ms,elap,nullfd;
        time_t t,last_timeout_warning;
-       struct  zt_radio_param z;
+       struct  dahdi_radio_param z;
        struct rpt_tele *telem;
 
        nullfd = open("/dev/null",O_RDWR);
@@ -10948,7 +10944,7 @@ 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 = DAHDI_CONF_CONF | ZT_CONF_LISTENER | ZT_CONF_TALKER;
+               ci.confmode = DAHDI_CONF_CONF | DAHDI_CONF_LISTENER | DAHDI_CONF_TALKER;
                /* first put the channel on the conference in proper mode */
                if (ioctl(l->pchan->fds[0],DAHDI_SETCONF,&ci) == -1)
                {
index d14a3bd03e937e331be40dbef56cca07a5e8c96a..f6de26c4e4d6feebb2906553b883df85219fba32 100644 (file)
@@ -104,6 +104,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #define SMDI_MD_WAIT_TIMEOUT 1500 /* 1.5 seconds */
 
 #include "asterisk/dahdi_compat.h"
+#include "asterisk/tonezone_compat.h"
 
 /*! Global jitterbuffer configuration - by default, jb is disabled */
 static struct ast_jb_conf default_jbconf =
index c992e24a54d3c207ca4d9d387e1fcde195a83bde..555027df81acd42739077167045442f3fd1e228c 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 122314 .
+# From configure.ac Revision: 122613 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.4.
 #
 
 if test "${PBX_DAHDI}" = "1" || test "${USE_ZAPTEL}" = "no"; then
   tonezone_dir="dahdi"
+   if test "x${DAHDI_DIR}" != "x"; then
+      tonezone_extra="${tonezone_extra} -I${DAHDI_DIR}/include"
+   fi
 else
   tonezone_dir="zaptel"
+   if test "x${ZAPTEL_DIR}" != "x"; then
+      tonezone_extra="${tonezone_extra} -I${ZAPTEL_DIR}/include"
+   fi
 fi
 
 
index 79ebbe8edcbc1edc03ca6e68c78d0608242b96ea..09368851f2a16f5d1bf05f55709d7be688cf1b59 100644 (file)
@@ -1360,8 +1360,14 @@ fi
 
 if test "${PBX_DAHDI}" = "1" || test "${USE_ZAPTEL}" = "no"; then
   tonezone_dir="dahdi"
+   if test "x${DAHDI_DIR}" != "x"; then
+      tonezone_extra="${tonezone_extra} -I${DAHDI_DIR}/include"
+   fi
 else
   tonezone_dir="zaptel"
+   if test "x${ZAPTEL_DIR}" != "x"; then
+      tonezone_extra="${tonezone_extra} -I${ZAPTEL_DIR}/include"
+   fi
 fi
 
 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [${tonezone_dir}/tonezone.h], [${tonezone_extra}])
index 69f2699cfb5fff8a0846ff8b2910b321ba5797b2..9c8f6e829e8819c3421d7776095028d9d19e878c 100644 (file)
 #ifndef DAHDI_COMPAT_H
 #define DAHDI_COMPAT_H
 
-#ifdef HAVE_DAHDI
+#if defined(HAVE_DAHDI)
 
 #include <dahdi/user.h>
-#include <dahdi/tonezone.h>
 
 #elif defined(HAVE_ZAPTEL)
 
 #include <zaptel/zaptel.h>
-#include <zaptel/tonezone.h>
 
 /* Compiling against Zaptel instead of DAHDI */
 
diff --git a/include/asterisk/tonezone_compat.h b/include/asterisk/tonezone_compat.h
new file mode 100644 (file)
index 0000000..6be160c
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * 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 Find tonezone header in the right place (DAHDI or Zaptel)
+ */
+
+#ifndef TONEZONE_COMPAT_H
+#define TONEZONE_COMPAT_H
+
+#if defined(HAVE_DAHDI)
+
+#include <dahdi/tonezone.h>
+
+#elif defined(HAVE_ZAPTEL)
+
+#include <zaptel/tonezone.h>
+
+#endif
+
+#endif /* TONEZONE_COMPAT_H */