35 #include <sys/ioctl.h> 40 #include <dahdi/user.h> 70 static const char app[] =
"DAHDIRAS";
72 #define PPP_MAX_ARGS 32 73 #define PPP_EXEC "/usr/sbin/pppd" 101 memset(argv, 0,
sizeof(argv));
106 argv[argc++] =
"nodetach";
110 c =
strsep(&stringp,
",");
113 c =
strsep(&stringp,
",");
116 if (geteuid() == 0) {
117 argv[argc++] =
"plugin";
118 argv[argc++] =
"dahdi.so";
120 argv[argc++] =
"stdin";
124 fprintf(stderr,
"Failed to exec PPPD!\n");
134 struct dahdi_bufferinfo savebi;
148 res = waitpid(pid, &status, WNOHANG);
165 }
else if (WIFSIGNALED(status)) {
166 ast_verb(3,
"RAS on %s terminated with signal %d\n",
190 struct dahdi_params dahdip;
206 memset(&dahdip, 0,
sizeof(dahdip));
209 }
else if (dahdip.sigtype != DAHDI_SIG_CLEAR) {
static int dahdiras_exec(struct ast_channel *chan, const char *data)
Main Channel structure associated with a channel.
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "DAHDI ISDN Remote Access Server")
void ast_close_fds_above_n(int n)
Common routine for child processes, to close all fds prior to exec(2)
static pid_t spawn_ras(struct ast_channel *chan, char *args)
ast_channel_state
ast_channel states
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.
#define ast_verb(level,...)
#define ast_debug(level,...)
Log a DEBUG message.
General Asterisk PBX channel definitions.
static int load_module(void)
void ast_safe_fork_cleanup(void)
Common routine to cleanup after fork'ed process is complete (if reaping was stopped) ...
#define ast_strdupa(s)
duplicate a string in memory from the stack
Core PBX routines and definitions.
int ast_check_hangup(struct ast_channel *chan)
Check to see if a channel is needing hang up.
int ast_set_priority(int)
We set ourselves to a high priority, that we might pre-empt everything else. If your PBX has heavy ac...
int ast_safe_fork(int stop_reaper)
Common routine to safely fork without a chance of a signal handler firing badly in the child...
static int unload_module(void)
Module has failed to load, may be in an inconsistent state.
int ast_channel_fd(const struct ast_channel *chan, int which)
char * strsep(char **str, const char *delims)
const char * ast_channel_name(const struct ast_channel *chan)
int ast_answer(struct ast_channel *chan)
Answer a channel.
static void run_ras(struct ast_channel *chan, char *args)
#define WEXITSTATUS(status)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define WIFEXITED(status)
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define ast_opt_high_priority