149 int i = 0, j, k = 0, did_ignore = 0, special_noanswer = 0;
155 char ourcidname[256],ourcidnum[256];
157 struct timeval lastdigittime;
173 ast_debug(1,
"Digittimeout: %d\n", digittimeout);
174 ast_debug(1,
"Responsetimeout: %d\n", firstdigittimeout);
181 args.context =
"disa";
199 }
else special_noanswer = 1;
203 if (!strcasecmp(
args.passcode,
"no-password")) {
205 ast_debug(1,
"DISA no-password login success\n");
217 ast_debug(1,
"DISA %s entry timeout on chan %s\n",
218 ((k&1) ?
"extension" :
"password"),chan->
name);
223 ast_debug(1,
"Waitfor returned %d\n", res);
261 if (sscanf(
args.passcode,
"%30d",&j) < 1) {
262 fp = fopen(
args.passcode,
"r");
269 while(fgets(pwline,
sizeof(pwline) - 1,fp)) {
272 if (pwline[strlen(pwline) - 1] ==
'\n')
273 pwline[strlen(pwline) - 1] = 0;
277 if (pwline[0] ==
'#')
279 if (pwline[0] ==
';')
287 if (sscanf(
args.passcode,
"%30d", &j) < 1)
290 if (!strcmp(exten,
args.passcode)) {
292 args.context =
"disa";
301 if (strcmp(exten,
args.passcode)) {
307 ast_debug(1,
"DISA on chan %s password is good\n",chan->
name);
312 exten[
sizeof(acctcode)] = 0;
315 ast_debug(1,
"Successful DISA log-in on chan %s\n", chan->
name);
387 if (special_noanswer) cdr_flags.
flags = 0;
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
union ast_frame_subclass subclass
static char accountcode[AST_MAX_ACCOUNT_CODE]
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.
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]
char * str
Subscriber phone number (Malloced)
struct ast_party_caller caller
Channel Caller ID information.
int ast_callerid_split(const char *src, char *name, int namelen, char *num, int numlen)
static void play_dialtone(struct ast_channel *chan, char *mailbox)
void ast_cdr_reset(struct ast_cdr *cdr, struct ast_flags *flags)
Reset the detail record, optionally posting it first.
#define ast_test_flag(p, flag)
int ast_indicate(struct ast_channel *chan, int condition)
Indicates condition of channel.
#define ast_set_flag(p, flag)
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.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
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.
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_party_id id
Caller party ID.
#define ast_debug(level,...)
Log a DEBUG message.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#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...
int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Determine whether an extension exists.
static int firstdigittimeout
Wait up to 16 seconds for first digit (FXO logic)
#define ast_strdupa(s)
duplicate a string in memory from the stack
enum ast_channel_state _state
const ast_string_field name
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
static struct ast_app_option app_opts[128]
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.
int ast_answer(struct ast_channel *chan)
Answer a channel.
Data structure associated with a single frame of data.
#define AST_APP_ARG(name)
Define an application argument.
enum ast_frame_type frametype
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
static char context[AST_MAX_CONTEXT]
union ast_frame::@172 data
unsigned char valid
TRUE if the number information is valid/present.
static char mailbox[AST_MAX_EXTENSION]
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
struct ast_party_number number
Subscriber phone number.