35 #include <dahdi/user.h>
62 static char *app =
"Flash";
68 i = DAHDI_IOMUX_SIGEVENT;
69 if (ioctl(fd, DAHDI_IOMUX, &i) == -1)
return -1;
70 if (ioctl(fd, DAHDI_GETEVENT, &j) == -1)
return -1;
74 static int flash_exec(
struct ast_channel *chan,
const char *data)
78 struct dahdi_params dahdip;
81 ast_log(LOG_WARNING,
"%s is not a DAHDI channel\n", ast_channel_name(chan));
85 memset(&dahdip, 0,
sizeof(dahdip));
86 res = ioctl(ast_channel_fd(chan, 0), DAHDI_GET_PARAMS, &dahdip);
88 if (dahdip.sigtype & __DAHDI_SIG_FXS) {
90 res = ioctl(ast_channel_fd(chan, 0), DAHDI_HOOK, &x);
91 if (!res || (errno == EINPROGRESS)) {
97 ast_verb(3,
"Flashed channel %s\n", ast_channel_name(chan));
99 ast_log(LOG_WARNING,
"Unable to flash channel %s: %s\n", ast_channel_name(chan), strerror(errno));
101 ast_log(LOG_WARNING,
"%s is not an FXO Channel\n", ast_channel_name(chan));
103 ast_log(LOG_WARNING,
"Unable to get parameters of %s: %s\n", ast_channel_name(chan), strerror(errno));
108 static int unload_module(
void)
113 static int load_module(
void)
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
Main Channel structure associated with a channel.
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
Support for translation of data formats. translate.c.
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
int ast_unregister_application(const char *app)
Unregister an application.
static int dahdi_wait_event(int fd)
Avoid the silly dahdi_waitevent which ignores a bunch of events.
General Asterisk channel definitions for image handling.
General Asterisk PBX channel definitions.
Structure to describe a channel "technology", ie a channel driver See for examples: ...
Core PBX routines and definitions.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.