Whitespace changes only

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114667 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.1
Tilghman Lesher 17 years ago
parent ab608c09e2
commit 463a5dbd0a

@ -736,8 +736,9 @@ static void prep_email_sub_vars(struct ast_channel *channel, const struct minivm
return;
}
for (var = vmu->chanvars ; var ; var = var->next)
for (var = vmu->chanvars ; var ; var = var->next) {
pbx_builtin_setvar_helper(channel, var->name, var->value);
}
/* Prepare variables for substition in email body and subject */
pbx_builtin_setvar_helper(channel, "MVM_NAME", vmu->fullname);

@ -135,7 +135,7 @@ static const struct strategy {
#define DEFAULT_TIMEOUT 15
#define RECHECK 1 /*!< Recheck every second to see we we're at the top yet */
#define MAX_PERIODIC_ANNOUNCEMENTS 10 /*!< The maximum periodic announcements we can have */
#define DEFAULT_MIN_ANNOUNCE_FREQUENCY 15 /*!< The minimum number of seconds between position announcements
#define DEFAULT_MIN_ANNOUNCE_FREQUENCY 15 /*!< The minimum number of seconds between position announcements \
The default value of 15 provides backwards compatibility */
#define MAX_QUEUE_BUCKETS 53
@ -1904,11 +1904,12 @@ playout:
/* Don't restart music on hold if we're about to exit the caller from the queue */
if (!res) {
if (ringing)
if (ringing) {
ast_indicate(qe->chan, AST_CONTROL_RINGING);
else
} else {
ast_moh_start(qe->chan, qe->moh, NULL);
}
}
return res;
}
@ -4643,7 +4644,7 @@ static int queue_function_var(struct ast_channel *chan, const char *cmd, char *d
.name = data,
};
char interfacevar[256]="";
char interfacevar[256] = "";
float sl = 0;
if (ast_strlen_zero(data)) {
@ -4657,8 +4658,9 @@ static int queue_function_var(struct ast_channel *chan, const char *cmd, char *d
sl = 0;
res = 0;
if (q->callscompleted > 0)
if (q->callscompleted > 0) {
sl = 100 * ((float) q->callscompletedinsl / (float) q->callscompleted);
}
snprintf(interfacevar, sizeof(interfacevar),
"QUEUEMAX=%d,QUEUESTRATEGY=%s,QUEUECALLS=%d,QUEUEHOLDTIME=%d,QUEUECOMPLETED=%d,QUEUEABANDONED=%d,QUEUESRVLEVEL=%d,QUEUESRVLEVELPERF=%2.1f",
@ -4669,8 +4671,9 @@ static int queue_function_var(struct ast_channel *chan, const char *cmd, char *d
ao2_unlock(q);
queue_unref(q);
} else
} else {
ast_log(LOG_WARNING, "queue %s was not found\n", data);
}
snprintf(buf, len, "%d", res);

@ -260,8 +260,9 @@ static void numcpy(char *d, char *s)
if (*s == '+')
*d++ = *s++;
while (*s) {
if (isdigit(*s))
if (isdigit(*s)) {
*d++ = *s;
}
s++;
}
*d = 0;
@ -600,8 +601,9 @@ static void unpacksms7(unsigned char *i, unsigned char l, unsigned char *udh, in
}
/*! \brief unpacks bytes (8 bit encoding) at i, len l septets,
and places in udh and ud setting udhl and udl. udh not used
if udhi not set */
* and places in udh and ud setting udhl and udl. udh not used
* if udhi not set.
*/
static void unpacksms8(unsigned char *i, unsigned char l, unsigned char *udh, int *udhl, unsigned short *ud, int *udl, char udhi)
{
unsigned short *o = ud;

@ -137,8 +137,9 @@ static struct ast_speech_result *find_result(struct ast_speech_result *results,
char *tmp = NULL;
int nbest_num = 0, wanted_num = 0, i = 0;
if (!result)
if (!result) {
return NULL;
}
if ((tmp = strchr(result_num, '/'))) {
*tmp++ = '\0';
@ -167,8 +168,9 @@ static int speech_score(struct ast_channel *chan, const char *cmd, char *data,
struct ast_speech *speech = find_speech(chan);
char tmp[128] = "";
if (data == NULL || speech == NULL || !(result = find_result(speech->results, data)))
if (data == NULL || speech == NULL || !(result = find_result(speech->results, data))) {
return -1;
}
snprintf(tmp, sizeof(tmp), "%d", result->score);
@ -194,11 +196,13 @@ static int speech_text(struct ast_channel *chan, const char *cmd, char *data,
struct ast_speech_result *result = NULL;
struct ast_speech *speech = find_speech(chan);
if (data == NULL || speech == NULL || !(result = find_result(speech->results, data)))
if (data == NULL || speech == NULL || !(result = find_result(speech->results, data))) {
return -1;
}
if (result->text != NULL)
if (result->text != NULL) {
ast_copy_string(buf, result->text, len);
}
return 0;
}
@ -220,11 +224,13 @@ static int speech_grammar(struct ast_channel *chan, const char *cmd, char *data,
struct ast_speech_result *result = NULL;
struct ast_speech *speech = find_speech(chan);
if (data == NULL || speech == NULL || !(result = find_result(speech->results, data)))
if (data == NULL || speech == NULL || !(result = find_result(speech->results, data))) {
return -1;
}
if (result->grammar != NULL)
if (result->grammar != NULL) {
ast_copy_string(buf, result->grammar, len);
}
return 0;
}
@ -244,8 +250,9 @@ static int speech_engine_write(struct ast_channel *chan, const char *cmd, char *
{
struct ast_speech *speech = find_speech(chan);
if (data == NULL || speech == NULL)
if (data == NULL || speech == NULL) {
return -1;
}
ast_speech_change(speech, data, value);
@ -645,14 +652,14 @@ static int speech_background(struct ast_channel *chan, void *data)
if (!strlen(dtmf)) {
if (chan->stream == NULL) {
if (speech->processing_sound != NULL) {
if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound,"none")) {
if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound, "none")) {
speech_streamfile(chan, speech->processing_sound, chan->language);
}
}
} else if (chan->streamid == -1 && chan->timingfunc == NULL) {
ast_stopstream(chan);
if (speech->processing_sound != NULL) {
if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound,"none")) {
if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound, "none")) {
speech_streamfile(chan, speech->processing_sound, chan->language);
}
}

@ -57,8 +57,8 @@ static int waitforring_exec(struct ast_channel *chan, void *data)
return 0;
}
ms = s*1000.0;
while(ms > 0) {
ms = s * 1000.0;
while (ms > 0) {
ms = ast_waitfor(chan, ms);
if (ms < 0) {
res = ms;

@ -66,22 +66,23 @@ static char *descrip =
static struct ast_channel *get_zap_channel_locked(int num) {
char name[80];
snprintf(name,sizeof(name),"Zap/%d-1",num);
snprintf(name, sizeof(name), "Zap/%d-1", num);
return ast_get_channel_by_name_locked(name);
}
static int careful_write(int fd, unsigned char *data, int len)
{
int res;
while(len) {
while (len) {
res = write(fd, data, len);
if (res < 1) {
if (errno != EAGAIN) {
ast_log(LOG_WARNING, "Failed to write audio data to conference: %s\n", strerror(errno));
return -1;
} else
} else {
return 0;
}
}
len -= res;
data += res;
}
@ -104,7 +105,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
int origfd;
int ret = -1;
char input[4];
int ic=0;
int ic = 0;
ZT_BUFFERINFO bi;
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
@ -189,7 +190,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
}
ast_debug(1, "Placed channel %s in ZAP channel %d monitor\n", chan->name, confno);
for(;;) {
for (;;) {
outfd = -1;
ms = -1;
c = ast_waitfor_nandfds(&chan, 1, &fd, nfds, NULL, &outfd, &ms);
@ -204,26 +205,24 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
goto zapretry;
}
f = ast_read(c);
if (!f)
if (!f) {
break;
if(f->frametype == AST_FRAME_DTMF) {
if(f->subclass == '#') {
}
if (f->frametype == AST_FRAME_DTMF) {
if (f->subclass == '#') {
ret = 0;
break;
}
else if (f->subclass == '*') {
} else if (f->subclass == '*') {
ret = -1;
break;
}
else {
} else {
input[ic++] = f->subclass;
}
if(ic == 3) {
if (ic == 3) {
input[ic++] = '\0';
ic=0;
ic = 0;
ret = atoi(input);
ast_verb(3, "Zapscan: change channel to %d\n",ret);
ast_verb(3, "Zapscan: change channel to %d\n", ret);
break;
}
}
@ -233,10 +232,11 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
if (f->subclass == AST_FORMAT_ULAW) {
/* Carefully write */
careful_write(fd, f->data, f->datalen);
} else
} else {
ast_log(LOG_WARNING, "Huh? Got a non-ulaw (%d) frame in the conference\n", f->subclass);
}
}
}
ast_frfree(f);
} else if (outfd > -1) {
res = read(outfd, buf, CONF_SIZE);
@ -252,15 +252,17 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
ast_log(LOG_WARNING, "Unable to write frame to channel: %s\n", strerror(errno));
/* break; */
}
} else
} else {
ast_log(LOG_WARNING, "Failed to read frame: %s\n", strerror(errno));
}
}
if (f)
}
if (f) {
ast_frfree(f);
if (fd != chan->fds[0])
}
if (fd != chan->fds[0]) {
close(fd);
else {
} else {
/* Take out of conference */
/* Add us to the conference */
ztc.chan = 0;
@ -282,16 +284,16 @@ static int conf_exec(struct ast_channel *chan, void *data)
int confflags = 0;
int confno = 0;
char confstr[80] = "", *tmp = NULL;
struct ast_channel *tempchan = NULL, *lastchan = NULL,*ichan = NULL;
struct ast_channel *tempchan = NULL, *lastchan = NULL, *ichan = NULL;
struct ast_frame *f;
char *desired_group;
int input=0,search_group=0;
int input = 0, search_group = 0;
if (chan->_state != AST_STATE_UP)
ast_answer(chan);
desired_group = ast_strdupa(data);
if(!ast_strlen_zero(desired_group)) {
if (!ast_strlen_zero(desired_group)) {
ast_verb(3, "Scanning for group %s\n", desired_group);
search_group = 1;
}
@ -316,12 +318,13 @@ static int conf_exec(struct ast_channel *chan, void *data)
tempchan = ichan ? ichan : ast_channel_walk_locked(tempchan);
if ( !tempchan && !lastchan )
if (!tempchan && !lastchan) {
break;
}
if (tempchan && search_group) {
const char *mygroup;
if((mygroup = pbx_builtin_getvar_helper(tempchan, "GROUP")) && (!strcmp(mygroup, desired_group))) {
if ((mygroup = pbx_builtin_getvar_helper(tempchan, "GROUP")) && (!strcmp(mygroup, desired_group))) {
ast_verb(3, "Found Matching Channel %s in group %s\n", tempchan->name, desired_group);
} else {
ast_channel_unlock(tempchan);
@ -329,21 +332,24 @@ static int conf_exec(struct ast_channel *chan, void *data)
continue;
}
}
if (tempchan && (!strcmp(tempchan->tech->type, "Zap")) && (tempchan != chan) ) {
if (tempchan && (!strcmp(tempchan->tech->type, "Zap")) && (tempchan != chan)) {
ast_verb(3, "Zap channel %s is in-use, monitoring...\n", tempchan->name);
ast_copy_string(confstr, tempchan->name, sizeof(confstr));
ast_channel_unlock(tempchan);
if ((tmp = strchr(confstr,'-'))) {
if ((tmp = strchr(confstr, '-'))) {
*tmp = '\0';
}
confno = atoi(strchr(confstr,'/') + 1);
confno = atoi(strchr(confstr, '/') + 1);
ast_stopstream(chan);
ast_say_number(chan, confno, AST_DIGIT_ANY, chan->language, (char *) NULL);
res = conf_run(chan, confno, confflags);
if (res<0) break;
if (res < 0) {
break;
}
input = res;
} else if (tempchan)
} else if (tempchan) {
ast_channel_unlock(tempchan);
}
lastchan = tempchan;
}
return res;

Loading…
Cancel
Save