aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_flash.c
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-12 19:08:20 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-12 19:08:20 +0000
commitf84b02a71d0968338c22758b24cc14e15e3864a4 (patch)
tree464a2032e05934a867493f45e5a2605929fceb8a /apps/app_flash.c
parentac54a25ad7440165f775131b2859ab56aa3c5a92 (diff)
Adds DAHDI support alongside Zaptel. DAHDI usage favored, but all Zap stuff should continue working. Release announcement to follow.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@122314 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_flash.c')
-rw-r--r--apps/app_flash.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/apps/app_flash.c b/apps/app_flash.c
index 1aa099d71..05a372f9e 100644
--- a/apps/app_flash.c
+++ b/apps/app_flash.c
@@ -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 */