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; 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); pbx_builtin_setvar_helper(channel, var->name, var->value);
}
/* Prepare variables for substition in email body and subject */ /* Prepare variables for substition in email body and subject */
pbx_builtin_setvar_helper(channel, "MVM_NAME", vmu->fullname); pbx_builtin_setvar_helper(channel, "MVM_NAME", vmu->fullname);

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

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

@ -137,8 +137,9 @@ static struct ast_speech_result *find_result(struct ast_speech_result *results,
char *tmp = NULL; char *tmp = NULL;
int nbest_num = 0, wanted_num = 0, i = 0; int nbest_num = 0, wanted_num = 0, i = 0;
if (!result) if (!result) {
return NULL; return NULL;
}
if ((tmp = strchr(result_num, '/'))) { if ((tmp = strchr(result_num, '/'))) {
*tmp++ = '\0'; *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); struct ast_speech *speech = find_speech(chan);
char tmp[128] = ""; 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; return -1;
}
snprintf(tmp, sizeof(tmp), "%d", result->score); 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_result *result = NULL;
struct ast_speech *speech = find_speech(chan); 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; return -1;
}
if (result->text != NULL) if (result->text != NULL) {
ast_copy_string(buf, result->text, len); ast_copy_string(buf, result->text, len);
}
return 0; 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_result *result = NULL;
struct ast_speech *speech = find_speech(chan); 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; return -1;
}
if (result->grammar != NULL) if (result->grammar != NULL) {
ast_copy_string(buf, result->grammar, len); ast_copy_string(buf, result->grammar, len);
}
return 0; 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); struct ast_speech *speech = find_speech(chan);
if (data == NULL || speech == NULL) if (data == NULL || speech == NULL) {
return -1; return -1;
}
ast_speech_change(speech, data, value); ast_speech_change(speech, data, value);
@ -645,14 +652,14 @@ static int speech_background(struct ast_channel *chan, void *data)
if (!strlen(dtmf)) { if (!strlen(dtmf)) {
if (chan->stream == NULL) { if (chan->stream == NULL) {
if (speech->processing_sound != 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); speech_streamfile(chan, speech->processing_sound, chan->language);
} }
} }
} else if (chan->streamid == -1 && chan->timingfunc == NULL) { } else if (chan->streamid == -1 && chan->timingfunc == NULL) {
ast_stopstream(chan); ast_stopstream(chan);
if (speech->processing_sound != 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); speech_streamfile(chan, speech->processing_sound, chan->language);
} }
} }

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

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

Loading…
Cancel
Save