148 int i = 0, j, k = 0, did_ignore = 0, special_noanswer = 0;
154 char ourcidname[256],ourcidnum[256];
156 struct timeval lastdigittime;
172 ast_debug(1,
"Digittimeout: %d\n", digittimeout);
173 ast_debug(1,
"Responsetimeout: %d\n", firstdigittimeout);
180 args.context =
"disa";
198 }
else special_noanswer = 1;
202 if (!strcasecmp(
args.passcode,
"no-password")) {
204 ast_debug(1,
"DISA no-password login success\n");
216 ast_debug(1,
"DISA %s entry timeout on chan %s\n",
222 ast_debug(1,
"Waitfor returned %d\n", res);
260 if (sscanf(
args.passcode,
"%30d",&j) < 1) {
261 fp = fopen(
args.passcode,
"r");
268 while(fgets(pwline,
sizeof(pwline) - 1,fp)) {
271 if (pwline[strlen(pwline) - 1] ==
'\n')
272 pwline[strlen(pwline) - 1] = 0;
276 if (pwline[0] ==
'#')
278 if (pwline[0] ==
';')
286 if (sscanf(
args.passcode,
"%30d", &j) < 1)
289 if (!strcmp(exten,
args.passcode)) {
291 args.context =
"disa";
300 if (strcmp(exten,
args.passcode)) {
311 exten[
sizeof(acctcode)] = 0;
385 ast_channel_accountcode_set(chan, acctcode);
391 pbx_exec(chan, app_reset_cdr, special_noanswer ?
"" :
"e");
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
void ast_set_callerid(struct ast_channel *chan, const char *cid_num, const char *cid_name, const char *cid_ani)
Set caller ID number, name and ANI and generate AMI event.
#define ast_channel_lock(chan)
int ast_matchmore_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Looks to see if adding anything to this extension might match something. (exists ^ canmatch) ...
static char exten[AST_MAX_EXTENSION]
static int firstdigittimeout
int ast_callerid_split(const char *src, char *name, int namelen, char *num, int numlen)
int pbx_exec(struct ast_channel *c, struct ast_app *app, const char *data)
Execute an application.
static void play_dialtone(struct ast_channel *chan, char *mailbox)
#define ast_test_flag(p, flag)
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
void ast_channel_hangupcause_set(struct ast_channel *chan, int value)
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
static const struct ast_app_option app_opts[128]
void ast_channel_clear_flag(struct ast_channel *chan, unsigned int flag)
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
int ast_ignore_pattern(const char *context, const char *pattern)
Checks to see if a number should be ignored.
ast_channel_state
ast_channel states
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
int ast_explicit_goto(struct ast_channel *chan, const char *context, const char *exten, int priority)
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
void ast_playtones_stop(struct ast_channel *chan)
Stop playing tones on a channel.
struct ast_frame_subclass subclass
#define ast_strlen_zero(foo)
static char mailbox[AST_MAX_MAILBOX_UNIQUEID]
#define ast_debug(level,...)
Log a DEBUG message.
struct ast_pbx * ast_channel_pbx(const struct ast_channel *chan)
#define AST_MAX_EXTENSION
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
#define ast_strdupa(s)
duplicate a string in memory from the stack
int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Determine whether an extension exists.
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
void ast_channel_set_flag(struct ast_channel *chan, unsigned int flag)
Set a flag on a channel.
#define ast_channel_unlock(chan)
Structure used to handle boolean flags.
#define ast_clear_flag(p, flag)
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name...
int ast_waitfor(struct ast_channel *chan, int ms)
Wait for input on a channel.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
ast_app: A registered application
const char * ast_channel_name(const struct ast_channel *chan)
int ast_answer(struct ast_channel *chan)
Answer a channel.
Data structure associated with a single frame of data.
union ast_frame::@263 data
enum ast_frame_type frametype
static char context[AST_MAX_CONTEXT]
struct ast_app * pbx_findapp(const char *app)
Look up an application.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_APP_ARG(name)
Define an application argument.