mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
whitespace fixes only.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -126,19 +126,19 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
|
||||
int betweenWordsSilence = dfltBetweenWordsSilence;
|
||||
int maximumNumberOfWords = dfltMaximumNumberOfWords;
|
||||
int silenceThreshold = dfltSilenceThreshold;
|
||||
int maximumWordLength = dfltMaximumWordLength;
|
||||
int maximumWordLength = dfltMaximumWordLength;
|
||||
int maxWaitTimeForFrame = dfltMaxWaitTimeForFrame;
|
||||
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(argInitialSilence);
|
||||
AST_APP_ARG(argGreeting);
|
||||
AST_APP_ARG(argAfterGreetingSilence);
|
||||
AST_APP_ARG(argTotalAnalysisTime);
|
||||
AST_APP_ARG(argMinimumWordLength);
|
||||
AST_APP_ARG(argBetweenWordsSilence);
|
||||
AST_APP_ARG(argMaximumNumberOfWords);
|
||||
AST_APP_ARG(argSilenceThreshold);
|
||||
AST_APP_ARG(argMaximumWordLength);
|
||||
AST_APP_ARG(argInitialSilence);
|
||||
AST_APP_ARG(argGreeting);
|
||||
AST_APP_ARG(argAfterGreetingSilence);
|
||||
AST_APP_ARG(argTotalAnalysisTime);
|
||||
AST_APP_ARG(argMinimumWordLength);
|
||||
AST_APP_ARG(argBetweenWordsSilence);
|
||||
AST_APP_ARG(argMaximumNumberOfWords);
|
||||
AST_APP_ARG(argSilenceThreshold);
|
||||
AST_APP_ARG(argMaximumWordLength);
|
||||
);
|
||||
|
||||
ast_verb(3, "AMD: %s %s %s (Fmt: %d)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, chan->readformat);
|
||||
@@ -163,8 +163,8 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
|
||||
maximumNumberOfWords = atoi(args.argMaximumNumberOfWords);
|
||||
if (!ast_strlen_zero(args.argSilenceThreshold))
|
||||
silenceThreshold = atoi(args.argSilenceThreshold);
|
||||
if (!ast_strlen_zero(args.argMaximumWordLength))
|
||||
maximumWordLength = atoi(args.argMaximumWordLength);
|
||||
if (!ast_strlen_zero(args.argMaximumWordLength))
|
||||
maximumWordLength = atoi(args.argMaximumWordLength);
|
||||
} else {
|
||||
ast_debug(1, "AMD using the default parameters.\n");
|
||||
}
|
||||
@@ -253,16 +253,16 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
|
||||
ast_verb(3, "AMD: Channel [%s]. Changed state to STATE_IN_SILENCE\n", chan->name);
|
||||
}
|
||||
/* Find words less than word duration */
|
||||
if (consecutiveVoiceDuration < minimumWordLength && consecutiveVoiceDuration > 0){
|
||||
ast_verb(3, "AMD: Channel [%s]. Short Word Duration: %d\n", chan->name, consecutiveVoiceDuration);
|
||||
}
|
||||
if (consecutiveVoiceDuration < minimumWordLength && consecutiveVoiceDuration > 0){
|
||||
ast_verb(3, "AMD: Channel [%s]. Short Word Duration: %d\n", chan->name, consecutiveVoiceDuration);
|
||||
}
|
||||
currentState = STATE_IN_SILENCE;
|
||||
consecutiveVoiceDuration = 0;
|
||||
}
|
||||
|
||||
if (inInitialSilence == 1 && silenceDuration >= initialSilence) {
|
||||
ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: silenceDuration:%d initialSilence:%d\n",
|
||||
chan->name, silenceDuration, initialSilence);
|
||||
chan->name, silenceDuration, initialSilence);
|
||||
ast_frfree(f);
|
||||
strcpy(amdStatus , "MACHINE");
|
||||
sprintf(amdCause , "INITIALSILENCE-%d-%d", silenceDuration, initialSilence);
|
||||
@@ -272,7 +272,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
|
||||
|
||||
if (silenceDuration >= afterGreetingSilence && inGreeting == 1) {
|
||||
ast_verb(3, "AMD: Channel [%s]. HUMAN: silenceDuration:%d afterGreetingSilence:%d\n",
|
||||
chan->name, silenceDuration, afterGreetingSilence);
|
||||
chan->name, silenceDuration, afterGreetingSilence);
|
||||
ast_frfree(f);
|
||||
strcpy(amdStatus , "HUMAN");
|
||||
sprintf(amdCause , "HUMAN-%d-%d", silenceDuration, afterGreetingSilence);
|
||||
@@ -292,13 +292,13 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
|
||||
previousState = currentState;
|
||||
currentState = STATE_IN_WORD;
|
||||
}
|
||||
if (consecutiveVoiceDuration >= maximumWordLength){
|
||||
ast_verb(3, "AMD: Channel [%s]. Maximum Word Length detected. [%d]\n", chan->name, consecutiveVoiceDuration);
|
||||
ast_frfree(f);
|
||||
strcpy(amdStatus , "MACHINE");
|
||||
sprintf(amdCause , "MAXWORDLENGTH-%d", consecutiveVoiceDuration);
|
||||
break;
|
||||
}
|
||||
if (consecutiveVoiceDuration >= maximumWordLength){
|
||||
ast_verb(3, "AMD: Channel [%s]. Maximum Word Length detected. [%d]\n", chan->name, consecutiveVoiceDuration);
|
||||
ast_frfree(f);
|
||||
strcpy(amdStatus , "MACHINE");
|
||||
sprintf(amdCause , "MAXWORDLENGTH-%d", consecutiveVoiceDuration);
|
||||
break;
|
||||
}
|
||||
if (iWordsCount >= maximumNumberOfWords) {
|
||||
ast_verb(3, "AMD: Channel [%s]. ANSWERING MACHINE: iWordsCount:%d\n", chan->name, iWordsCount);
|
||||
ast_frfree(f);
|
||||
@@ -322,7 +322,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
|
||||
ast_verb(3, "AMD: Channel [%s]. Detected Talk, previous silence duration: %d\n", chan->name, silenceDuration);
|
||||
silenceDuration = 0;
|
||||
}
|
||||
if (consecutiveVoiceDuration >= minimumWordLength && inGreeting == 0){
|
||||
if (consecutiveVoiceDuration >= minimumWordLength && inGreeting == 0) {
|
||||
/* Only go in here once to change the greeting flag when we detect the 1st word */
|
||||
if (silenceDuration > 0)
|
||||
ast_verb(3, "AMD: Channel [%s]. Before Greeting Time: silenceDuration: %d voiceDuration: %d\n", chan->name, silenceDuration, voiceDuration);
|
||||
@@ -416,8 +416,8 @@ static int load_config(int reload)
|
||||
|
||||
ast_verb(3, "AMD defaults: initialSilence [%d] greeting [%d] afterGreetingSilence [%d] "
|
||||
"totalAnalysisTime [%d] minimumWordLength [%d] betweenWordsSilence [%d] maximumNumberOfWords [%d] silenceThreshold [%d] maximumWordLength [%d]\n",
|
||||
dfltInitialSilence, dfltGreeting, dfltAfterGreetingSilence, dfltTotalAnalysisTime,
|
||||
dfltMinimumWordLength, dfltBetweenWordsSilence, dfltMaximumNumberOfWords, dfltSilenceThreshold, dfltMaximumWordLength);
|
||||
dfltInitialSilence, dfltGreeting, dfltAfterGreetingSilence, dfltTotalAnalysisTime,
|
||||
dfltMinimumWordLength, dfltBetweenWordsSilence, dfltMaximumNumberOfWords, dfltSilenceThreshold, dfltMaximumWordLength);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -447,4 +447,4 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Answering Machine Detect
|
||||
.load = load_module,
|
||||
.unload = unload_module,
|
||||
.reload = reload,
|
||||
);
|
||||
);
|
||||
|
@@ -113,7 +113,7 @@ static int chanavail_exec(struct ast_channel *chan, void *data)
|
||||
} else if (option_state) {
|
||||
/* If the pbx says in use then don't bother trying further.
|
||||
This is to permit testing if someone's on a call, even if the
|
||||
channel can permit more calls (ie callwaiting, sip calls, etc). */
|
||||
channel can permit more calls (ie callwaiting, sip calls, etc). */
|
||||
|
||||
snprintf(trychan, sizeof(trychan), "%s/%s",cur,number);
|
||||
status = inuse = ast_device_state(trychan);
|
||||
|
@@ -33,7 +33,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "asterisk/paths.h" /* use ast_config_AST_MONITOR_DIR */
|
||||
#include "asterisk/paths.h" /* use ast_config_AST_MONITOR_DIR */
|
||||
#include "asterisk/file.h"
|
||||
#include "asterisk/channel.h"
|
||||
#include "asterisk/audiohook.h"
|
||||
@@ -131,15 +131,15 @@ static const char *desc_ext =
|
||||
;
|
||||
|
||||
enum {
|
||||
OPTION_QUIET = (1 << 0), /* Quiet, no announcement */
|
||||
OPTION_BRIDGED = (1 << 1), /* Only look at bridged calls */
|
||||
OPTION_VOLUME = (1 << 2), /* Specify initial volume */
|
||||
OPTION_GROUP = (1 << 3), /* Only look at channels in group */
|
||||
OPTION_QUIET = (1 << 0), /* Quiet, no announcement */
|
||||
OPTION_BRIDGED = (1 << 1), /* Only look at bridged calls */
|
||||
OPTION_VOLUME = (1 << 2), /* Specify initial volume */
|
||||
OPTION_GROUP = (1 << 3), /* Only look at channels in group */
|
||||
OPTION_RECORD = (1 << 4),
|
||||
OPTION_WHISPER = (1 << 5),
|
||||
OPTION_PRIVATE = (1 << 6), /* Private Whisper mode */
|
||||
OPTION_READONLY = (1 << 7), /* Don't mix the two channels */
|
||||
OPTION_EXIT = (1 << 8), /* Exit to a valid single digit extension */
|
||||
OPTION_WHISPER = (1 << 5),
|
||||
OPTION_PRIVATE = (1 << 6), /* Private Whisper mode */
|
||||
OPTION_READONLY = (1 << 7), /* Don't mix the two channels */
|
||||
OPTION_EXIT = (1 << 8), /* Exit to a valid single digit extension */
|
||||
OPTION_ENFORCED = (1 << 9), /* Enforced mode */
|
||||
} chanspy_opt_flags;
|
||||
|
||||
@@ -238,7 +238,7 @@ static int start_spying(struct ast_channel *chan, struct ast_channel *spychan, s
|
||||
}
|
||||
|
||||
static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int *volfactor, int fd,
|
||||
const struct ast_flags *flags, char *exitcontext)
|
||||
const struct ast_flags *flags, char *exitcontext)
|
||||
{
|
||||
struct chanspy_translation_helper csth;
|
||||
int running = 0, res, x = 0;
|
||||
@@ -381,7 +381,7 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
|
||||
}
|
||||
|
||||
static struct ast_channel *next_channel(const struct ast_channel *last, const char *spec,
|
||||
const char *exten, const char *context)
|
||||
const char *exten, const char *context)
|
||||
{
|
||||
struct ast_channel *this;
|
||||
|
||||
@@ -404,8 +404,8 @@ static struct ast_channel *next_channel(const struct ast_channel *last, const ch
|
||||
}
|
||||
|
||||
static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
|
||||
int volfactor, const int fd, const char *mygroup, const char *myenforced,
|
||||
const char *spec, const char *exten, const char *context)
|
||||
int volfactor, const int fd, const char *mygroup, const char *myenforced,
|
||||
const char *spec, const char *exten, const char *context)
|
||||
{
|
||||
struct ast_channel *peer, *prev, *next;
|
||||
char nameprefix[AST_NAME_STRLEN];
|
||||
@@ -476,8 +476,8 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
|
||||
num_spyed_upon = 0;
|
||||
|
||||
for (peer = next_channel(peer, spec, exten, context);
|
||||
peer;
|
||||
prev = peer, peer = next ? next : next_channel(peer, spec, exten, context), next = NULL) {
|
||||
peer;
|
||||
prev = peer, peer = next ? next : next_channel(peer, spec, exten, context), next = NULL) {
|
||||
const char *group;
|
||||
int igrp = !mygroup;
|
||||
char *groups[25];
|
||||
@@ -507,7 +507,7 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
|
||||
if ((group = pbx_builtin_getvar_helper(peer, "SPYGROUP"))) {
|
||||
dup_group = ast_strdupa(group);
|
||||
num_groups = ast_app_separate_args(dup_group, ':', groups,
|
||||
sizeof(groups) / sizeof(groups[0]));
|
||||
sizeof(groups) / sizeof(groups[0]));
|
||||
}
|
||||
|
||||
for (x = 0; x < num_groups; x++) {
|
||||
@@ -529,7 +529,7 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
|
||||
|
||||
ext = alloca(strlen(peer->name));
|
||||
|
||||
form_enforced = alloca(strlen(myenforced) + 3);
|
||||
form_enforced = alloca(strlen(myenforced) + 3);
|
||||
|
||||
strcpy(form_enforced, ":");
|
||||
strcat(form_enforced, myenforced);
|
||||
@@ -538,8 +538,8 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
|
||||
buffer = ast_strdupa(peer->name);
|
||||
|
||||
if ((end = strchr(buffer, '-'))) {
|
||||
*end++ = ':';
|
||||
*end = '\0';
|
||||
*end++ = ':';
|
||||
*end = '\0';
|
||||
}
|
||||
|
||||
strcpy(ext, ":");
|
||||
@@ -631,7 +631,7 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
|
||||
mygroup = opts[OPT_ARG_GROUP];
|
||||
|
||||
if (ast_test_flag(&flags, OPTION_RECORD) &&
|
||||
!(recbase = opts[OPT_ARG_RECORD]))
|
||||
!(recbase = opts[OPT_ARG_RECORD]))
|
||||
recbase = "chanspy";
|
||||
|
||||
if (ast_test_flag(&flags, OPTION_VOLUME) && opts[OPT_ARG_VOLUME]) {
|
||||
@@ -714,7 +714,7 @@ static int extenspy_exec(struct ast_channel *chan, void *data)
|
||||
mygroup = opts[OPT_ARG_GROUP];
|
||||
|
||||
if (ast_test_flag(&flags, OPTION_RECORD) &&
|
||||
!(recbase = opts[OPT_ARG_RECORD]))
|
||||
!(recbase = opts[OPT_ARG_RECORD]))
|
||||
recbase = "chanspy";
|
||||
|
||||
if (ast_test_flag(&flags, OPTION_VOLUME) && opts[OPT_ARG_VOLUME]) {
|
||||
|
@@ -71,7 +71,8 @@ enum {
|
||||
|
||||
AST_APP_OPTIONS(cpb_opts, BEGIN_OPTIONS
|
||||
AST_APP_OPTION_ARG('o', OPT_OFFSET, OPT_ARG_OFFSET),
|
||||
END_OPTIONS );
|
||||
END_OPTIONS
|
||||
);
|
||||
|
||||
static int is_on_phonepad(char key)
|
||||
{
|
||||
|
205
apps/app_dial.c
205
apps/app_dial.c
@@ -39,7 +39,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include <sys/stat.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include "asterisk/paths.h" /* use ast_config_AST_DATA_DIR */
|
||||
#include "asterisk/paths.h" /* use ast_config_AST_DATA_DIR */
|
||||
#include "asterisk/lock.h"
|
||||
#include "asterisk/file.h"
|
||||
#include "asterisk/channel.h"
|
||||
@@ -264,10 +264,10 @@ enum {
|
||||
OPT_CALLER_MIXMONITOR = (1 << 30),
|
||||
};
|
||||
|
||||
#define DIAL_STILLGOING (1 << 31)
|
||||
#define DIAL_NOFORWARDHTML ((uint64_t)1 << 32) /* flags are now 64 bits, so keep it up! */
|
||||
#define OPT_CANCEL_ELSEWHERE ((uint64_t)1 << 33)
|
||||
#define OPT_PEER_H ((uint64_t)1 << 34)
|
||||
#define DIAL_STILLGOING (1 << 31)
|
||||
#define DIAL_NOFORWARDHTML ((uint64_t)1 << 32) /* flags are now 64 bits, so keep it up! */
|
||||
#define OPT_CANCEL_ELSEWHERE ((uint64_t)1 << 33)
|
||||
#define OPT_PEER_H ((uint64_t)1 << 34)
|
||||
|
||||
enum {
|
||||
OPT_ARG_ANNOUNCE = 0,
|
||||
@@ -434,27 +434,27 @@ static const char *get_cid_name(char *name, int namelen, struct ast_channel *cha
|
||||
static void senddialevent(struct ast_channel *src, struct ast_channel *dst, const char *dialstring)
|
||||
{
|
||||
manager_event(EVENT_FLAG_CALL, "Dial",
|
||||
"SubEvent: Begin\r\n"
|
||||
"Channel: %s\r\n"
|
||||
"Destination: %s\r\n"
|
||||
"CallerIDNum: %s\r\n"
|
||||
"CallerIDName: %s\r\n"
|
||||
"UniqueID: %s\r\n"
|
||||
"DestUniqueID: %s\r\n"
|
||||
"Dialstring: %s\r\n",
|
||||
src->name, dst->name, S_OR(src->cid.cid_num, "<unknown>"),
|
||||
S_OR(src->cid.cid_name, "<unknown>"), src->uniqueid,
|
||||
dst->uniqueid, dialstring ? dialstring : "");
|
||||
"SubEvent: Begin\r\n"
|
||||
"Channel: %s\r\n"
|
||||
"Destination: %s\r\n"
|
||||
"CallerIDNum: %s\r\n"
|
||||
"CallerIDName: %s\r\n"
|
||||
"UniqueID: %s\r\n"
|
||||
"DestUniqueID: %s\r\n"
|
||||
"Dialstring: %s\r\n",
|
||||
src->name, dst->name, S_OR(src->cid.cid_num, "<unknown>"),
|
||||
S_OR(src->cid.cid_name, "<unknown>"), src->uniqueid,
|
||||
dst->uniqueid, dialstring ? dialstring : "");
|
||||
}
|
||||
|
||||
static void senddialendevent(const struct ast_channel *src, const char *dialstatus)
|
||||
{
|
||||
manager_event(EVENT_FLAG_CALL, "Dial",
|
||||
"SubEvent: End\r\n"
|
||||
"Channel: %s\r\n"
|
||||
"UniqueID: %s\r\n"
|
||||
"DialStatus: %s\r\n",
|
||||
src->name, src->uniqueid, dialstatus);
|
||||
"SubEvent: End\r\n"
|
||||
"Channel: %s\r\n"
|
||||
"UniqueID: %s\r\n"
|
||||
"DialStatus: %s\r\n",
|
||||
src->name, src->uniqueid, dialstatus);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -513,7 +513,7 @@ static void do_forward(struct chanlist *o,
|
||||
if (ast_test_flag64(o, OPT_FORCECLID)) {
|
||||
new_cid_num = ast_strdup(S_OR(in->macroexten, in->exten));
|
||||
new_cid_name = NULL; /* XXX no name ? */
|
||||
src = c; /* XXX possible bug in previous code, which used 'winner' ? it may have changed */
|
||||
src = c; /* XXX possible bug in previous code, which used 'winner' ? it may have changed */
|
||||
} else {
|
||||
new_cid_num = ast_strdup(in->cid.cid_num);
|
||||
new_cid_name = ast_strdup(in->cid.cid_name);
|
||||
@@ -549,11 +549,11 @@ static void do_forward(struct chanlist *o,
|
||||
|
||||
/* argument used for some functions. */
|
||||
struct privacy_args {
|
||||
int sentringing;
|
||||
int privdb_val;
|
||||
char privcid[256];
|
||||
char privintro[1024];
|
||||
char status[256];
|
||||
int sentringing;
|
||||
int privdb_val;
|
||||
char privcid[256];
|
||||
char privintro[1024];
|
||||
char status[256];
|
||||
};
|
||||
|
||||
static struct ast_channel *wait_for_answer(struct ast_channel *in,
|
||||
@@ -585,7 +585,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
|
||||
|
||||
while (*to && !peer) {
|
||||
struct chanlist *o;
|
||||
int pos = 0; /* how many channels do we handle */
|
||||
int pos = 0; /* how many channels do we handle */
|
||||
int numlines = prestart;
|
||||
struct ast_channel *winner;
|
||||
struct ast_channel *watchers[AST_MAX_WATCHERS];
|
||||
@@ -597,7 +597,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
|
||||
watchers[pos++] = o->chan;
|
||||
numlines++;
|
||||
}
|
||||
if (pos == 1) { /* only the input channel is available */
|
||||
if (pos == 1) { /* only the input channel is available */
|
||||
if (numlines == (num.busy + num.congestion + num.nochan)) {
|
||||
ast_verb(2, "Everyone is busy/congested at this time (%d:%d/%d/%d)\n", numlines, num.busy, num.congestion, num.nochan);
|
||||
if (num.busy)
|
||||
@@ -624,12 +624,12 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
|
||||
ast_verb(3, "%s answered %s\n", c->name, in->name);
|
||||
peer = c;
|
||||
ast_copy_flags64(peerflags, o,
|
||||
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
|
||||
OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
|
||||
OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
|
||||
OPT_CALLEE_PARK | OPT_CALLER_PARK |
|
||||
OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
|
||||
DIAL_NOFORWARDHTML);
|
||||
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
|
||||
OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
|
||||
OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
|
||||
OPT_CALLEE_PARK | OPT_CALLER_PARK |
|
||||
OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
|
||||
DIAL_NOFORWARDHTML);
|
||||
ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
|
||||
ast_copy_string(c->exten, "", sizeof(c->exten));
|
||||
}
|
||||
@@ -662,12 +662,12 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
|
||||
ast_verb(3, "%s answered %s\n", c->name, in->name);
|
||||
peer = c;
|
||||
ast_copy_flags64(peerflags, o,
|
||||
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
|
||||
OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
|
||||
OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
|
||||
OPT_CALLEE_PARK | OPT_CALLER_PARK |
|
||||
OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
|
||||
DIAL_NOFORWARDHTML);
|
||||
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
|
||||
OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
|
||||
OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
|
||||
OPT_CALLEE_PARK | OPT_CALLER_PARK |
|
||||
OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
|
||||
DIAL_NOFORWARDHTML);
|
||||
ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
|
||||
ast_copy_string(c->exten, "", sizeof(c->exten));
|
||||
if (CAN_EARLY_BRIDGE(peerflags))
|
||||
@@ -797,7 +797,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
|
||||
}
|
||||
|
||||
if (ast_test_flag64(peerflags, OPT_CALLER_HANGUP) &&
|
||||
(f->subclass == '*')) { /* hmm it it not guaranteed to be '*' anymore. */
|
||||
(f->subclass == '*')) { /* hmm it it not guaranteed to be '*' anymore. */
|
||||
ast_verb(3, "User hit %c to disconnect call.\n", f->subclass);
|
||||
*to = 0;
|
||||
strcpy(pa->status, "CANCEL");
|
||||
@@ -812,15 +812,14 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
|
||||
if (ast_channel_sendhtml(outgoing->chan, f->subclass, f->data, f->datalen) == -1)
|
||||
ast_log(LOG_WARNING, "Unable to send URL\n");
|
||||
|
||||
|
||||
if (single && ((f->frametype == AST_FRAME_VOICE) || (f->frametype == AST_FRAME_DTMF_BEGIN) || (f->frametype == AST_FRAME_DTMF_END))) {
|
||||
if (ast_write(outgoing->chan, f))
|
||||
ast_log(LOG_WARNING, "Unable to forward voice or dtmf\n");
|
||||
}
|
||||
if (single && (f->frametype == AST_FRAME_CONTROL) &&
|
||||
((f->subclass == AST_CONTROL_HOLD) ||
|
||||
(f->subclass == AST_CONTROL_UNHOLD) ||
|
||||
(f->subclass == AST_CONTROL_VIDUPDATE))) {
|
||||
(f->subclass == AST_CONTROL_UNHOLD) ||
|
||||
(f->subclass == AST_CONTROL_VIDUPDATE))) {
|
||||
ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
|
||||
ast_indicate_data(outgoing->chan, f->subclass, f->data, f->datalen);
|
||||
}
|
||||
@@ -828,28 +827,24 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
|
||||
}
|
||||
if (!*to)
|
||||
ast_verb(3, "Nobody picked up in %d ms\n", orig);
|
||||
if (!*to || ast_check_hangup(in)) {
|
||||
if (!*to || ast_check_hangup(in))
|
||||
ast_cdr_noanswer(in->cdr);
|
||||
}
|
||||
|
||||
}
|
||||
if (peer && !ast_cdr_log_unanswered()) {
|
||||
/* suppress the CDR's that didn't win */
|
||||
struct chanlist *o;
|
||||
for (o = outgoing; o; o = o->next) {
|
||||
struct ast_channel *c = o->chan;
|
||||
if (c && c != peer && c->cdr) {
|
||||
if (c && c != peer && c->cdr)
|
||||
ast_set_flag(c->cdr, AST_CDR_FLAG_POST_DISABLED);
|
||||
}
|
||||
}
|
||||
} else if (!peer && !ast_cdr_log_unanswered()) {
|
||||
/* suppress the CDR's that didn't win */
|
||||
struct chanlist *o;
|
||||
for (o = outgoing; o; o = o->next) {
|
||||
struct ast_channel *c = o->chan;
|
||||
if (c && c->cdr) {
|
||||
if (c && c->cdr)
|
||||
ast_set_flag(c->cdr, AST_CDR_FLAG_POST_DISABLED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -870,7 +865,6 @@ static void replace_macro_delimiter(char *s)
|
||||
*s = ',';
|
||||
}
|
||||
|
||||
|
||||
/* returns true if there is a valid privacy reply */
|
||||
static int valid_priv_reply(struct ast_flags64 *opts, int res)
|
||||
{
|
||||
@@ -906,7 +900,7 @@ static int do_timelimit(struct ast_channel *chan, struct ast_bridge_config *conf
|
||||
ast_log(LOG_WARNING, "Dial does not accept L(%s), hanging up.\n", limit_str);
|
||||
config->timelimit = config->play_warning = config->warning_freq = 0;
|
||||
config->warning_sound = NULL;
|
||||
return -1; /* error */
|
||||
return -1; /* error */
|
||||
} else if ( (delta = config->play_warning - config->timelimit) > 0) {
|
||||
int w = config->warning_freq;
|
||||
|
||||
@@ -959,7 +953,7 @@ static int do_timelimit(struct ast_channel *chan, struct ast_bridge_config *conf
|
||||
if (!config->play_warning && !config->start_sound && !config->end_sound && config->timelimit) {
|
||||
*calldurationlimit = config->timelimit / 1000;
|
||||
ast_verb(3, "Setting call duration limit to %d seconds.\n",
|
||||
*calldurationlimit);
|
||||
*calldurationlimit);
|
||||
config->timelimit = play_to_caller = play_to_callee =
|
||||
config->play_warning = config->warning_freq = 0;
|
||||
} else {
|
||||
@@ -973,15 +967,15 @@ static int do_timelimit(struct ast_channel *chan, struct ast_bridge_config *conf
|
||||
ast_verb(4, "warning_sound = %s\n", config->warning_sound);
|
||||
ast_verb(4, "end_sound = %s\n", S_OR(config->end_sound, ""));
|
||||
}
|
||||
if (play_to_caller)
|
||||
ast_set_flag(&(config->features_caller), AST_FEATURE_PLAY_WARNING);
|
||||
if (play_to_callee)
|
||||
ast_set_flag(&(config->features_callee), AST_FEATURE_PLAY_WARNING);
|
||||
if (play_to_caller)
|
||||
ast_set_flag(&(config->features_caller), AST_FEATURE_PLAY_WARNING);
|
||||
if (play_to_callee)
|
||||
ast_set_flag(&(config->features_callee), AST_FEATURE_PLAY_WARNING);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int do_privacy(struct ast_channel *chan, struct ast_channel *peer,
|
||||
struct ast_flags64 *opts, char **opt_args, struct privacy_args *pa)
|
||||
struct ast_flags64 *opts, char **opt_args, struct privacy_args *pa)
|
||||
{
|
||||
|
||||
int res2;
|
||||
@@ -1010,9 +1004,9 @@ static int do_privacy(struct ast_channel *chan, struct ast_channel *peer,
|
||||
res2 = ast_autoservice_start(chan);
|
||||
/* Now Stream the File */
|
||||
for (loopcount = 0; loopcount < 3; loopcount++) {
|
||||
if (res2 && loopcount == 0) /* error in ast_autoservice_start() */
|
||||
if (res2 && loopcount == 0) /* error in ast_autoservice_start() */
|
||||
break;
|
||||
if (!res2) /* on timeout, play the message again */
|
||||
if (!res2) /* on timeout, play the message again */
|
||||
res2 = ast_play_and_wait(peer, "priv-callpending");
|
||||
if (!valid_priv_reply(opts, res2))
|
||||
res2 = 0;
|
||||
@@ -1066,7 +1060,7 @@ static int do_privacy(struct ast_channel *chan, struct ast_channel *peer,
|
||||
static const int _flag[] = { AST_PRIVACY_ALLOW, AST_PRIVACY_DENY, AST_PRIVACY_TORTURE, AST_PRIVACY_KILL, AST_PRIVACY_ALLOW};
|
||||
int i = res2 - '1';
|
||||
ast_verb(3, "--Set privacy database entry %s/%s to %s\n",
|
||||
opt_args[OPT_ARG_PRIVACY], pa->privcid, _val[i]);
|
||||
opt_args[OPT_ARG_PRIVACY], pa->privcid, _val[i]);
|
||||
ast_privacy_set(opt_args[OPT_ARG_PRIVACY], pa->privcid, _flag[i]);
|
||||
}
|
||||
switch (res2) {
|
||||
@@ -1086,7 +1080,7 @@ static int do_privacy(struct ast_channel *chan, struct ast_channel *peer,
|
||||
if (ast_test_flag64(opts, OPT_PRIVACY))
|
||||
break;
|
||||
/* if not privacy, then 5 is the same as "default" case */
|
||||
default: /* bad input or -1 if failure to start autoservice */
|
||||
default: /* bad input or -1 if failure to start autoservice */
|
||||
/* well, if the user messes up, ... he had his chance... What Is The Best Thing To Do? */
|
||||
/* well, there seems basically two choices. Just patch the caller thru immediately,
|
||||
or,... put 'em thru to voicemail. */
|
||||
@@ -1097,7 +1091,7 @@ static int do_privacy(struct ast_channel *chan, struct ast_channel *peer,
|
||||
break;
|
||||
}
|
||||
|
||||
if (res2 == '1') { /* the only case where we actually connect */
|
||||
if (res2 == '1') { /* the only case where we actually connect */
|
||||
/* if the intro is NOCALLERID, then there's no reason to leave it on disk, it'll
|
||||
just clog things up, and it's not useful information, not being tied to a CID */
|
||||
if (strncmp(pa->privcid, "NOCALLERID", 10) == 0 || ast_test_flag64(opts, OPT_SCREEN_NOINTRO)) {
|
||||
@@ -1107,7 +1101,7 @@ static int do_privacy(struct ast_channel *chan, struct ast_channel *peer,
|
||||
else
|
||||
ast_verb(3, "Successfully deleted %s intro file\n", pa->privintro);
|
||||
}
|
||||
return 0; /* the good exit path */
|
||||
return 0; /* the good exit path */
|
||||
} else {
|
||||
ast_hangup(peer); /* hang up on the callee -- he didn't want to talk anyway! */
|
||||
return -1;
|
||||
@@ -1211,16 +1205,16 @@ static int setup_privacy_args(struct privacy_args *pa,
|
||||
ast_waitstream(chan, "");
|
||||
}
|
||||
}
|
||||
return 1; /* success */
|
||||
return 1; /* success */
|
||||
}
|
||||
|
||||
static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags64 *peerflags, int *continue_exec)
|
||||
{
|
||||
int res = -1; /* default: error */
|
||||
char *rest, *cur; /* scan the list of destinations */
|
||||
struct chanlist *outgoing = NULL; /* list of destinations */
|
||||
int res = -1; /* default: error */
|
||||
char *rest, *cur; /* scan the list of destinations */
|
||||
struct chanlist *outgoing = NULL; /* list of destinations */
|
||||
struct ast_channel *peer;
|
||||
int to; /* timeout */
|
||||
int to; /* timeout */
|
||||
struct cause_args num = { chan, 0, 0, 0 };
|
||||
int cause;
|
||||
char numsubst[256];
|
||||
@@ -1241,10 +1235,10 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
char *parse;
|
||||
int opermode = 0;
|
||||
AST_DECLARE_APP_ARGS(args,
|
||||
AST_APP_ARG(peers);
|
||||
AST_APP_ARG(timeout);
|
||||
AST_APP_ARG(options);
|
||||
AST_APP_ARG(url);
|
||||
AST_APP_ARG(peers);
|
||||
AST_APP_ARG(timeout);
|
||||
AST_APP_ARG(options);
|
||||
AST_APP_ARG(url);
|
||||
);
|
||||
struct ast_flags64 opts = { 0, };
|
||||
char *opt_args[OPT_ARG_ARRAY_SIZE];
|
||||
@@ -1262,7 +1256,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
AST_STANDARD_APP_ARGS(args, parse);
|
||||
|
||||
if (!ast_strlen_zero(args.options) &&
|
||||
ast_app_parse_options64(dial_exec_options, &opts, opt_args, args.options)) {
|
||||
ast_app_parse_options64(dial_exec_options, &opts, opt_args, args.options)) {
|
||||
pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
|
||||
goto done;
|
||||
}
|
||||
@@ -1307,7 +1301,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
res = setup_privacy_args(&pa, &opts, opt_args, chan);
|
||||
if (res <= 0)
|
||||
goto out;
|
||||
res = -1; /* reset default */
|
||||
res = -1; /* reset default */
|
||||
}
|
||||
|
||||
if (continue_exec)
|
||||
@@ -1326,7 +1320,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
rest = args.peers;
|
||||
while ((cur = strsep(&rest, "&")) ) {
|
||||
struct chanlist *tmp;
|
||||
struct ast_channel *tc; /* channel for this destination */
|
||||
struct ast_channel *tc; /* channel for this destination */
|
||||
/* Get a technology/[device:]number pair */
|
||||
char *number = cur;
|
||||
char *interface = ast_strdupa(number);
|
||||
@@ -1343,13 +1337,13 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
goto out;
|
||||
if (opts.flags) {
|
||||
ast_copy_flags64(tmp, &opts,
|
||||
OPT_CANCEL_ELSEWHERE |
|
||||
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
|
||||
OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
|
||||
OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
|
||||
OPT_CALLEE_PARK | OPT_CALLER_PARK |
|
||||
OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
|
||||
OPT_RINGBACK | OPT_MUSICBACK | OPT_FORCECLID);
|
||||
OPT_CANCEL_ELSEWHERE |
|
||||
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
|
||||
OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
|
||||
OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
|
||||
OPT_CALLEE_PARK | OPT_CALLER_PARK |
|
||||
OPT_CALLEE_MIXMONITOR | OPT_CALLER_MIXMONITOR |
|
||||
OPT_RINGBACK | OPT_MUSICBACK | OPT_FORCECLID);
|
||||
ast_set2_flag64(tmp, args.url, DIAL_NOFORWARDHTML);
|
||||
}
|
||||
ast_copy_string(numsubst, number, sizeof(numsubst));
|
||||
@@ -1420,9 +1414,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
if (!tc) {
|
||||
/* If we can't, just go on to the next call */
|
||||
ast_log(LOG_WARNING, "Unable to create channel of type '%s' (cause %d - %s)\n",
|
||||
tech, cause, ast_cause2str(cause));
|
||||
tech, cause, ast_cause2str(cause));
|
||||
handle_cause(cause, &num);
|
||||
if (!rest) /* we are on the last destination */
|
||||
if (!rest) /* we are on the last destination */
|
||||
chan->hangupcause = cause;
|
||||
ast_free(tmp);
|
||||
continue;
|
||||
@@ -1472,7 +1466,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
else
|
||||
ast_copy_string(tc->exten, chan->exten, sizeof(tc->exten));
|
||||
|
||||
res = ast_call(tc, numsubst, 0); /* Place the call, but don't wait on the answer */
|
||||
res = ast_call(tc, numsubst, 0); /* Place the call, but don't wait on the answer */
|
||||
|
||||
/* Save the info in cdr's that we called them */
|
||||
if (chan->cdr)
|
||||
@@ -1558,7 +1552,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
} else {
|
||||
const char *number;
|
||||
time_t end_time, answer_time = time(NULL);
|
||||
char toast[80]; /* buffer to set variables */
|
||||
char toast[80]; /* buffer to set variables */
|
||||
|
||||
strcpy(pa.status, "ANSWER");
|
||||
/* Ah ha! Someone answered within the desired timeframe. Of course after this
|
||||
@@ -1576,10 +1570,10 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
if (!number)
|
||||
number = numsubst;
|
||||
pbx_builtin_setvar_helper(chan, "DIALEDPEERNUMBER", number);
|
||||
if (!ast_strlen_zero(args.url) && ast_channel_supports_html(peer) ) {
|
||||
ast_debug(1, "app_dial: sendurl=%s.\n", args.url);
|
||||
ast_channel_sendurl( peer, args.url );
|
||||
}
|
||||
if (!ast_strlen_zero(args.url) && ast_channel_supports_html(peer) ) {
|
||||
ast_debug(1, "app_dial: sendurl=%s.\n", args.url);
|
||||
ast_channel_sendurl( peer, args.url );
|
||||
}
|
||||
if ( (ast_test_flag64(&opts, OPT_PRIVACY) || ast_test_flag64(&opts, OPT_SCREENING)) && pa.privdb_val == AST_PRIVACY_UNKNOWN) {
|
||||
if (do_privacy(chan, peer, &opts, opt_args, &pa)) {
|
||||
res = 0;
|
||||
@@ -1634,7 +1628,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
|
||||
theapp = pbx_findapp("Macro");
|
||||
|
||||
if (theapp && !res) { /* XXX why check res here ? */
|
||||
if (theapp && !res) { /* XXX why check res here ? */
|
||||
replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_MACRO]);
|
||||
res = pbx_exec(peer, theapp, opt_args[OPT_ARG_CALLEE_MACRO]);
|
||||
ast_debug(1, "Macro exited with status %d\n", res);
|
||||
@@ -1695,7 +1689,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
|
||||
theapp = pbx_findapp("Gosub");
|
||||
|
||||
if (theapp && !res) { /* XXX why check res here ? */
|
||||
if (theapp && !res) { /* XXX why check res here ? */
|
||||
replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_GOSUB]);
|
||||
|
||||
/* Set where we came from */
|
||||
@@ -1779,7 +1773,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
}
|
||||
}
|
||||
|
||||
if (res) { /* some error */
|
||||
if (res) { /* some error */
|
||||
res = -1;
|
||||
end_time = time(NULL);
|
||||
} else {
|
||||
@@ -1842,10 +1836,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
snprintf(toast, sizeof(toast), "%ld", (long)(end_time - start_time));
|
||||
pbx_builtin_setvar_helper(chan, "DIALEDTIME", toast);
|
||||
|
||||
|
||||
if (ast_test_flag64(&opts, OPT_PEER_H)) {
|
||||
ast_log(LOG_NOTICE, "PEER context: %s; PEER exten: %s; PEER priority: %d\n",
|
||||
peer->context, peer->exten, peer->priority);
|
||||
peer->context, peer->exten, peer->priority);
|
||||
}
|
||||
|
||||
strcpy(peer->context, chan->context);
|
||||
@@ -1855,12 +1848,12 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
int found;
|
||||
strcpy(peer->exten, "h");
|
||||
peer->priority = 1;
|
||||
autoloopflag = ast_test_flag(peer, AST_FLAG_IN_AUTOLOOP); /* save value to restore at the end */
|
||||
autoloopflag = ast_test_flag(peer, AST_FLAG_IN_AUTOLOOP); /* save value to restore at the end */
|
||||
ast_set_flag(peer, AST_FLAG_IN_AUTOLOOP);
|
||||
|
||||
while ((res = ast_spawn_extension(peer, peer->context, peer->exten, peer->priority, peer->cid.cid_num, &found, 1))) {
|
||||
while ((res = ast_spawn_extension(peer, peer->context, peer->exten, peer->priority, peer->cid.cid_num, &found, 1)))
|
||||
peer->priority++;
|
||||
}
|
||||
|
||||
if (found && res) {
|
||||
/* Something bad happened, or a hangup has been requested. */
|
||||
ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", peer->context, peer->exten, peer->priority, peer->name);
|
||||
@@ -1883,7 +1876,7 @@ out:
|
||||
ast_indicate(chan, -1);
|
||||
}
|
||||
ast_channel_early_bridge(chan, NULL);
|
||||
hanguptree(outgoing, NULL, 0); /* In this case, there's no answer anywhere */
|
||||
hanguptree(outgoing, NULL, 0); /* In this case, there's no answer anywhere */
|
||||
pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
|
||||
senddialendevent(chan, pa.status);
|
||||
ast_debug(1, "Exiting with DIALSTATUS=%s.\n", pa.status);
|
||||
@@ -1928,9 +1921,8 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
|
||||
parse = ast_strdupa(data);
|
||||
AST_STANDARD_APP_ARGS(args, parse);
|
||||
|
||||
if ((sleep = atoi(args.sleep))) {
|
||||
if ((sleep = atoi(args.sleep)))
|
||||
sleep *= 1000;
|
||||
}
|
||||
|
||||
loops = atoi(args.retries);
|
||||
|
||||
@@ -1943,7 +1935,7 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
|
||||
sleep = 10000;
|
||||
|
||||
if (!loops)
|
||||
loops = -1; /* run forever */
|
||||
loops = -1; /* run forever */
|
||||
|
||||
context = pbx_builtin_getvar_helper(chan, "EXITCONTEXT");
|
||||
|
||||
@@ -2019,8 +2011,7 @@ static int unload_module(void)
|
||||
res = ast_unregister_application(app);
|
||||
res |= ast_unregister_application(rapp);
|
||||
|
||||
if ((con = ast_context_find("app_dial_gosub_virtual_context")))
|
||||
{
|
||||
if ((con = ast_context_find("app_dial_gosub_virtual_context"))) {
|
||||
ast_context_remove_extension2(con, "s", 1, NULL);
|
||||
ast_context_destroy(con, "app_dial"); /* leave nothing behind */
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "asterisk/paths.h" /* use ast_config_AST_SPOOL_DIR */
|
||||
#include "asterisk/paths.h" /* use ast_config_AST_SPOOL_DIR */
|
||||
#include "asterisk/file.h"
|
||||
#include "asterisk/pbx.h"
|
||||
#include "asterisk/module.h"
|
||||
|
@@ -93,8 +93,8 @@ static int pickup_by_exten(struct ast_channel *chan, const char *exten, const ch
|
||||
|
||||
while ((target = ast_channel_walk_locked(target))) {
|
||||
if ((!strcasecmp(target->macroexten, exten) || !strcasecmp(target->exten, exten)) &&
|
||||
!strcasecmp(target->dialcontext, context) &&
|
||||
can_pickup(target)) {
|
||||
!strcasecmp(target->dialcontext, context) &&
|
||||
can_pickup(target)) {
|
||||
res = pickup_do(chan, target);
|
||||
ast_channel_unlock(target);
|
||||
break;
|
||||
@@ -114,8 +114,8 @@ static int pickup_by_mark(struct ast_channel *chan, const char *mark)
|
||||
|
||||
while ((target = ast_channel_walk_locked(target))) {
|
||||
if ((tmp = pbx_builtin_getvar_helper(target, PICKUPMARK)) &&
|
||||
!strcasecmp(tmp, mark) &&
|
||||
can_pickup(target)) {
|
||||
!strcasecmp(tmp, mark) &&
|
||||
can_pickup(target)) {
|
||||
res = pickup_do(chan, target);
|
||||
ast_channel_unlock(target);
|
||||
break;
|
||||
|
@@ -31,7 +31,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "asterisk/paths.h" /* use ast_config_AST_SPOOL_DIR */
|
||||
#include "asterisk/paths.h" /* use ast_config_AST_SPOOL_DIR */
|
||||
#include "asterisk/file.h"
|
||||
#include "asterisk/pbx.h"
|
||||
#include "asterisk/module.h"
|
||||
@@ -91,7 +91,7 @@ enum {
|
||||
struct directory_item {
|
||||
char exten[AST_MAX_EXTENSION + 1];
|
||||
char name[AST_MAX_EXTENSION + 1];
|
||||
char key[50]; /* Text to order items. Either lastname+firstname or firstname+lastname */
|
||||
char key[50]; /* Text to order items. Either lastname+firstname or firstname+lastname */
|
||||
|
||||
AST_LIST_ENTRY(directory_item) entry;
|
||||
};
|
||||
@@ -300,7 +300,7 @@ static int compare(const char *text, const char *template)
|
||||
* '*' for skipped entry from directory
|
||||
*/
|
||||
static int play_mailbox_owner(struct ast_channel *chan, const char *context,
|
||||
const char *ext, const char *name, struct ast_flags *flags)
|
||||
const char *ext, const char *name, struct ast_flags *flags)
|
||||
{
|
||||
int res = 0;
|
||||
char fn[256];
|
||||
@@ -378,7 +378,7 @@ static int select_item_seq(struct ast_channel *chan, struct directory_item **ite
|
||||
res = ast_waitfordigit(chan, 3000);
|
||||
ast_stopstream(chan);
|
||||
|
||||
if (res == '1') { /* Name selected */
|
||||
if (res == '1') { /* Name selected */
|
||||
return select_entry(chan, context, dialcontext, item, flags) ? -1 : 1;
|
||||
} else if (res == '*') {
|
||||
/* Skip to next match in list */
|
||||
@@ -502,8 +502,8 @@ static struct ast_config *realtime_directory(char *context)
|
||||
fullname = ast_variable_retrieve(rtdata, mailbox, "fullname");
|
||||
hidefromdir = ast_variable_retrieve(rtdata, mailbox, "hidefromdir");
|
||||
snprintf(tmp, sizeof(tmp), "no-password,%s,hidefromdir=%s",
|
||||
fullname ? fullname : "",
|
||||
hidefromdir ? hidefromdir : "no");
|
||||
fullname ? fullname : "",
|
||||
hidefromdir ? hidefromdir : "no");
|
||||
var = ast_variable_new(mailbox, tmp, "");
|
||||
if (var)
|
||||
ast_variable_append(cat, var);
|
||||
@@ -639,8 +639,8 @@ static void sort_items(struct directory_item **sorted, int count)
|
||||
static int goto_exten(struct ast_channel *chan, const char *dialcontext, char *ext)
|
||||
{
|
||||
if (!ast_goto_if_exists(chan, dialcontext, ext, 1) ||
|
||||
(!ast_strlen_zero(chan->macrocontext) &&
|
||||
!ast_goto_if_exists(chan, chan->macrocontext, ext, 1))) {
|
||||
(!ast_strlen_zero(chan->macrocontext) &&
|
||||
!ast_goto_if_exists(chan, chan->macrocontext, ext, 1))) {
|
||||
return 0;
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "Can't find extension '%s' in current context. "
|
||||
|
@@ -180,7 +180,7 @@ static int disa_exec(struct ast_channel *chan, void *data)
|
||||
/* if outa time, give em reorder */
|
||||
if (ast_tvdiff_ms(ast_tvnow(), lastdigittime) > ((k&2) ? digittimeout : firstdigittimeout)) {
|
||||
ast_debug(1,"DISA %s entry timeout on chan %s\n",
|
||||
((k&1) ? "extension" : "password"),chan->name);
|
||||
((k&1) ? "extension" : "password"),chan->name);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -68,63 +68,63 @@ static int serialize_showchan(struct ast_channel *c, char *buf, size_t size)
|
||||
}
|
||||
|
||||
snprintf(buf,size,
|
||||
"Name= %s\n"
|
||||
"Type= %s\n"
|
||||
"UniqueID= %s\n"
|
||||
"CallerIDNum= %s\n"
|
||||
"CallerIDName= %s\n"
|
||||
"DNIDDigits= %s\n"
|
||||
"RDNIS= %s\n"
|
||||
"Language= %s\n"
|
||||
"State= %s (%d)\n"
|
||||
"Rings= %d\n"
|
||||
"NativeFormat= %s\n"
|
||||
"WriteFormat= %s\n"
|
||||
"ReadFormat= %s\n"
|
||||
"RawWriteFormat= %s\n"
|
||||
"RawReadFormat= %s\n"
|
||||
"1stFileDescriptor= %d\n"
|
||||
"Framesin= %d %s\n"
|
||||
"Framesout= %d %s\n"
|
||||
"TimetoHangup= %ld\n"
|
||||
"ElapsedTime= %dh%dm%ds\n"
|
||||
"Context= %s\n"
|
||||
"Extension= %s\n"
|
||||
"Priority= %d\n"
|
||||
"CallGroup= %s\n"
|
||||
"PickupGroup= %s\n"
|
||||
"Application= %s\n"
|
||||
"Data= %s\n"
|
||||
"Blocking_in= %s\n",
|
||||
c->name,
|
||||
c->tech->type,
|
||||
c->uniqueid,
|
||||
S_OR(c->cid.cid_num, "(N/A)"),
|
||||
S_OR(c->cid.cid_name, "(N/A)"),
|
||||
S_OR(c->cid.cid_dnid, "(N/A)"),
|
||||
S_OR(c->cid.cid_rdnis, "(N/A)"),
|
||||
c->language,
|
||||
ast_state2str(c->_state),
|
||||
c->_state,
|
||||
c->rings,
|
||||
ast_getformatname_multiple(formatbuf, sizeof(formatbuf), c->nativeformats),
|
||||
ast_getformatname_multiple(formatbuf, sizeof(formatbuf), c->writeformat),
|
||||
ast_getformatname_multiple(formatbuf, sizeof(formatbuf), c->readformat),
|
||||
ast_getformatname_multiple(formatbuf, sizeof(formatbuf), c->rawwriteformat),
|
||||
ast_getformatname_multiple(formatbuf, sizeof(formatbuf), c->rawreadformat),
|
||||
c->fds[0], c->fin & ~DEBUGCHAN_FLAG, (c->fin & DEBUGCHAN_FLAG) ? " (DEBUGGED)" : "",
|
||||
c->fout & ~DEBUGCHAN_FLAG, (c->fout & DEBUGCHAN_FLAG) ? " (DEBUGGED)" : "", (long)c->whentohangup,
|
||||
hour,
|
||||
min,
|
||||
sec,
|
||||
c->context,
|
||||
c->exten,
|
||||
c->priority,
|
||||
ast_print_group(cgrp, sizeof(cgrp), c->callgroup),
|
||||
ast_print_group(pgrp, sizeof(pgrp), c->pickupgroup),
|
||||
( c->appl ? c->appl : "(N/A)" ),
|
||||
( c-> data ? S_OR(c->data, "(Empty)") : "(None)"),
|
||||
(ast_test_flag(c, AST_FLAG_BLOCKING) ? c->blockproc : "(Not Blocking)"));
|
||||
"Name= %s\n"
|
||||
"Type= %s\n"
|
||||
"UniqueID= %s\n"
|
||||
"CallerIDNum= %s\n"
|
||||
"CallerIDName= %s\n"
|
||||
"DNIDDigits= %s\n"
|
||||
"RDNIS= %s\n"
|
||||
"Language= %s\n"
|
||||
"State= %s (%d)\n"
|
||||
"Rings= %d\n"
|
||||
"NativeFormat= %s\n"
|
||||
"WriteFormat= %s\n"
|
||||
"ReadFormat= %s\n"
|
||||
"RawWriteFormat= %s\n"
|
||||
"RawReadFormat= %s\n"
|
||||
"1stFileDescriptor= %d\n"
|
||||
"Framesin= %d %s\n"
|
||||
"Framesout= %d %s\n"
|
||||
"TimetoHangup= %ld\n"
|
||||
"ElapsedTime= %dh%dm%ds\n"
|
||||
"Context= %s\n"
|
||||
"Extension= %s\n"
|
||||
"Priority= %d\n"
|
||||
"CallGroup= %s\n"
|
||||
"PickupGroup= %s\n"
|
||||
"Application= %s\n"
|
||||
"Data= %s\n"
|
||||
"Blocking_in= %s\n",
|
||||
c->name,
|
||||
c->tech->type,
|
||||
c->uniqueid,
|
||||
S_OR(c->cid.cid_num, "(N/A)"),
|
||||
S_OR(c->cid.cid_name, "(N/A)"),
|
||||
S_OR(c->cid.cid_dnid, "(N/A)"),
|
||||
S_OR(c->cid.cid_rdnis, "(N/A)"),
|
||||
c->language,
|
||||
ast_state2str(c->_state),
|
||||
c->_state,
|
||||
c->rings,
|
||||
ast_getformatname_multiple(formatbuf, sizeof(formatbuf), c->nativeformats),
|
||||
ast_getformatname_multiple(formatbuf, sizeof(formatbuf), c->writeformat),
|
||||
ast_getformatname_multiple(formatbuf, sizeof(formatbuf), c->readformat),
|
||||
ast_getformatname_multiple(formatbuf, sizeof(formatbuf), c->rawwriteformat),
|
||||
ast_getformatname_multiple(formatbuf, sizeof(formatbuf), c->rawreadformat),
|
||||
c->fds[0], c->fin & ~DEBUGCHAN_FLAG, (c->fin & DEBUGCHAN_FLAG) ? " (DEBUGGED)" : "",
|
||||
c->fout & ~DEBUGCHAN_FLAG, (c->fout & DEBUGCHAN_FLAG) ? " (DEBUGGED)" : "", (long)c->whentohangup,
|
||||
hour,
|
||||
min,
|
||||
sec,
|
||||
c->context,
|
||||
c->exten,
|
||||
c->priority,
|
||||
ast_print_group(cgrp, sizeof(cgrp), c->callgroup),
|
||||
ast_print_group(pgrp, sizeof(pgrp), c->pickupgroup),
|
||||
( c->appl ? c->appl : "(N/A)" ),
|
||||
( c-> data ? S_OR(c->data, "(Empty)") : "(None)"),
|
||||
(ast_test_flag(c, AST_FLAG_BLOCKING) ? c->blockproc : "(Not Blocking)"));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/app.h"
|
||||
|
||||
/* Maximum length of any variable */
|
||||
#define MAXRESULT 1024
|
||||
#define MAXRESULT 1024
|
||||
|
||||
/*! Note
|
||||
*
|
||||
|
@@ -86,7 +86,7 @@ struct gen_state {
|
||||
};
|
||||
|
||||
static void send_child_event(FILE *handle, const char event, const char *data,
|
||||
const struct ast_channel *chan)
|
||||
const struct ast_channel *chan)
|
||||
{
|
||||
char tmp[256];
|
||||
|
||||
@@ -170,7 +170,7 @@ static struct ast_frame *gen_readframe(struct gen_state *state)
|
||||
struct ivr_localuser *u = state->u;
|
||||
|
||||
if (u->abort_current_sound ||
|
||||
(u->playing_silence && AST_LIST_FIRST(&u->playlist))) {
|
||||
(u->playing_silence && AST_LIST_FIRST(&u->playlist))) {
|
||||
gen_closestream(state);
|
||||
AST_LIST_LOCK(&u->playlist);
|
||||
gen_nextfile(state);
|
||||
|
Reference in New Issue
Block a user