Kill off red blobs in most of main/*
Everything still compiled after making these changes, so I assume these whitespace-only changes didn't break anything (and shouldn't have). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
1d1c28ac4b
commit
c5b3db1956
|
@ -535,7 +535,7 @@ static char *handle_show_threads(struct ast_cli_entry *e, int cmd, struct ast_cl
|
|||
ast_cli(a->fd, "%p %d %s\n", (void *)cur->id, cur->lwp, cur->name);
|
||||
count++;
|
||||
}
|
||||
AST_RWLIST_UNLOCK(&thread_list);
|
||||
AST_RWLIST_UNLOCK(&thread_list);
|
||||
ast_cli(a->fd, "%d threads listed.\n", count);
|
||||
return CLI_SUCCESS;
|
||||
}
|
||||
|
@ -3032,7 +3032,7 @@ static void ast_readconfig(void)
|
|||
ast_copy_string(cfg_paths.config_dir, DEFAULT_CONFIG_DIR, sizeof(cfg_paths.config_dir));
|
||||
ast_copy_string(cfg_paths.spool_dir, DEFAULT_SPOOL_DIR, sizeof(cfg_paths.spool_dir));
|
||||
ast_copy_string(cfg_paths.module_dir, DEFAULT_MODULE_DIR, sizeof(cfg_paths.module_dir));
|
||||
snprintf(cfg_paths.monitor_dir, sizeof(cfg_paths.monitor_dir), "%s/monitor", cfg_paths.spool_dir);
|
||||
snprintf(cfg_paths.monitor_dir, sizeof(cfg_paths.monitor_dir), "%s/monitor", cfg_paths.spool_dir);
|
||||
ast_copy_string(cfg_paths.var_dir, DEFAULT_VAR_DIR, sizeof(cfg_paths.var_dir));
|
||||
ast_copy_string(cfg_paths.data_dir, DEFAULT_DATA_DIR, sizeof(cfg_paths.data_dir));
|
||||
ast_copy_string(cfg_paths.log_dir, DEFAULT_LOG_DIR, sizeof(cfg_paths.log_dir));
|
||||
|
@ -3197,15 +3197,15 @@ static void ast_readconfig(void)
|
|||
ast_language_is_prefix = ast_true(v->value);
|
||||
} else if (!strcasecmp(v->name, "defaultlanguage")) {
|
||||
ast_copy_string(defaultlanguage, v->value, MAX_LANGUAGE);
|
||||
} else if (!strcasecmp(v->name, "lockmode")) {
|
||||
if (!strcasecmp(v->value, "lockfile")) {
|
||||
ast_set_lock_type(AST_LOCK_TYPE_LOCKFILE);
|
||||
} else if (!strcasecmp(v->value, "flock")) {
|
||||
ast_set_lock_type(AST_LOCK_TYPE_FLOCK);
|
||||
} else {
|
||||
} else if (!strcasecmp(v->name, "lockmode")) {
|
||||
if (!strcasecmp(v->value, "lockfile")) {
|
||||
ast_set_lock_type(AST_LOCK_TYPE_LOCKFILE);
|
||||
} else if (!strcasecmp(v->value, "flock")) {
|
||||
ast_set_lock_type(AST_LOCK_TYPE_FLOCK);
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "'%s' is not a valid setting for the lockmode option, "
|
||||
"defaulting to 'lockfile'\n", v->value);
|
||||
ast_set_lock_type(AST_LOCK_TYPE_LOCKFILE);
|
||||
ast_set_lock_type(AST_LOCK_TYPE_LOCKFILE);
|
||||
}
|
||||
#if defined(HAVE_SYSINFO)
|
||||
} else if (!strcasecmp(v->name, "minmemfree")) {
|
||||
|
|
|
@ -297,7 +297,7 @@ static unsigned short calc_crc(unsigned short crc, unsigned char data)
|
|||
else
|
||||
crc <<= 1 ;
|
||||
}
|
||||
return crc;
|
||||
return crc;
|
||||
}
|
||||
|
||||
int callerid_feed_jp(struct callerid_state *cid, unsigned char *ubuf, int len, struct ast_format *codec)
|
||||
|
@ -682,7 +682,7 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, stru
|
|||
ast_log(LOG_NOTICE, "IE %d has bad field length of %d at offset %d\n", cid->rawdata[x-1], cid->rawdata[x], x);
|
||||
/* Try again */
|
||||
cid->sawflag = 0;
|
||||
break; /* Exit the loop */
|
||||
break; /* Exit the loop */
|
||||
}
|
||||
x += cid->rawdata[x];
|
||||
x++;
|
||||
|
|
|
@ -7006,8 +7006,8 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct
|
|||
|
||||
if (config->feature_timer > 0 && ast_tvzero(config->nexteventts)) {
|
||||
/* nexteventts is not set when the bridge is not scheduled to
|
||||
* break, so calculate when the bridge should possibly break
|
||||
* if a partial feature match timed out */
|
||||
* break, so calculate when the bridge should possibly break
|
||||
* if a partial feature match timed out */
|
||||
config->nexteventts = ast_tvadd(ast_tvnow(), ast_samp2tv(config->feature_timer, 1000));
|
||||
}
|
||||
|
||||
|
@ -7039,9 +7039,9 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct
|
|||
}
|
||||
} else {
|
||||
/* If a feature has been started and the bridge is configured to
|
||||
* to not break, leave the channel bridge when the feature timer
|
||||
* to not break, leave the channel bridge when the feature timer
|
||||
* time has elapsed so the DTMF will be sent to the other side.
|
||||
*/
|
||||
*/
|
||||
if (!ast_tvzero(config->nexteventts)) {
|
||||
int diff = ast_tvdiff_ms(config->nexteventts, ast_tvnow());
|
||||
if (diff <= 0) {
|
||||
|
@ -7658,23 +7658,23 @@ static int tonepair_generator(struct ast_channel *chan, void *data, int len, int
|
|||
return -1;
|
||||
}
|
||||
memset(&ts->f, 0, sizeof(ts->f));
|
||||
for (x=0;x<len/2;x++) {
|
||||
ts->v1_1 = ts->v2_1;
|
||||
ts->v2_1 = ts->v3_1;
|
||||
ts->v3_1 = (ts->fac1 * ts->v2_1 >> 15) - ts->v1_1;
|
||||
for (x=0;x<len/2;x++) {
|
||||
ts->v1_1 = ts->v2_1;
|
||||
ts->v2_1 = ts->v3_1;
|
||||
ts->v3_1 = (ts->fac1 * ts->v2_1 >> 15) - ts->v1_1;
|
||||
|
||||
ts->v1_2 = ts->v2_2;
|
||||
ts->v2_2 = ts->v3_2;
|
||||
ts->v3_2 = (ts->fac2 * ts->v2_2 >> 15) - ts->v1_2;
|
||||
if (ts->modulate) {
|
||||
int p;
|
||||
p = ts->v3_2 - 32768;
|
||||
if (p < 0) p = -p;
|
||||
p = ((p * 9) / 10) + 1;
|
||||
ts->data[x] = (ts->v3_1 * p) >> 15;
|
||||
} else
|
||||
ts->data[x] = ts->v3_1 + ts->v3_2;
|
||||
}
|
||||
ts->v1_2 = ts->v2_2;
|
||||
ts->v2_2 = ts->v3_2;
|
||||
ts->v3_2 = (ts->fac2 * ts->v2_2 >> 15) - ts->v1_2;
|
||||
if (ts->modulate) {
|
||||
int p;
|
||||
p = ts->v3_2 - 32768;
|
||||
if (p < 0) p = -p;
|
||||
p = ((p * 9) / 10) + 1;
|
||||
ts->data[x] = (ts->v3_1 * p) >> 15;
|
||||
} else
|
||||
ts->data[x] = ts->v3_1 + ts->v3_2;
|
||||
}
|
||||
ts->f.frametype = AST_FRAME_VOICE;
|
||||
ast_format_set(&ts->f.subclass.format, AST_FORMAT_SLINEAR, 0);
|
||||
ts->f.datalen = len;
|
||||
|
@ -7982,11 +7982,11 @@ char *ast_print_group(char *buf, int buflen, ast_group_t group)
|
|||
|
||||
for (i = 0; i <= 63; i++) { /* Max group is 63 */
|
||||
if (group & ((ast_group_t) 1 << i)) {
|
||||
if (!first) {
|
||||
if (!first) {
|
||||
strncat(buf, ", ", buflen - strlen(buf) - 1);
|
||||
} else {
|
||||
first = 0;
|
||||
}
|
||||
}
|
||||
snprintf(num, sizeof(num), "%u", i);
|
||||
strncat(buf, num, buflen - strlen(buf) - 1);
|
||||
}
|
||||
|
|
|
@ -1141,8 +1141,8 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
|
|||
}
|
||||
*c++ = '\0';
|
||||
cur++;
|
||||
if (*c++ != '(')
|
||||
c = NULL;
|
||||
if (*c++ != '(')
|
||||
c = NULL;
|
||||
catname = cur;
|
||||
if (!(*cat = newcat = ast_category_new(catname,
|
||||
S_OR(suggested_include_file, cfg->include_level == 1 ? "" : configfile),
|
||||
|
@ -1161,14 +1161,14 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
|
|||
if (ast_test_flag(&flags, CONFIG_FLAG_WITHCOMMENTS))
|
||||
CB_RESET(comment_buffer, lline_buffer);
|
||||
|
||||
/* If there are options or categories to inherit from, process them now */
|
||||
if (c) {
|
||||
if (!(cur = strchr(c, ')'))) {
|
||||
ast_log(LOG_WARNING, "parse error: no closing ')', line %d of %s\n", lineno, configfile);
|
||||
return -1;
|
||||
}
|
||||
*cur = '\0';
|
||||
while ((cur = strsep(&c, ","))) {
|
||||
/* If there are options or categories to inherit from, process them now */
|
||||
if (c) {
|
||||
if (!(cur = strchr(c, ')'))) {
|
||||
ast_log(LOG_WARNING, "parse error: no closing ')', line %d of %s\n", lineno, configfile);
|
||||
return -1;
|
||||
}
|
||||
*cur = '\0';
|
||||
while ((cur = strsep(&c, ","))) {
|
||||
if (!strcasecmp(cur, "!")) {
|
||||
(*cat)->ignored = 1;
|
||||
} else if (!strcasecmp(cur, "+")) {
|
||||
|
@ -1194,8 +1194,8 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
|
|||
}
|
||||
inherit_category(*cat, base);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newcat)
|
||||
ast_category_append(cfg, *cat);
|
||||
} else if (cur[0] == '#') { /* A directive - #include or #exec */
|
||||
|
@ -1784,19 +1784,19 @@ static void insert_leading_blank_lines(FILE *fp, struct inclfile *fi, struct ast
|
|||
} else if (lineno == 0) {
|
||||
/* Line replacements also mess things up */
|
||||
return;
|
||||
} else if (lineno - precomment_lines - fi->lineno < 5) {
|
||||
/* Only insert less than 5 blank lines; if anything more occurs,
|
||||
* it's probably due to context deletion. */
|
||||
for (i = fi->lineno; i < lineno - precomment_lines; i++) {
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
} else {
|
||||
/* Deletion occurred - insert a single blank line, for separation of
|
||||
* contexts. */
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
} else if (lineno - precomment_lines - fi->lineno < 5) {
|
||||
/* Only insert less than 5 blank lines; if anything more occurs,
|
||||
* it's probably due to context deletion. */
|
||||
for (i = fi->lineno; i < lineno - precomment_lines; i++) {
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
} else {
|
||||
/* Deletion occurred - insert a single blank line, for separation of
|
||||
* contexts. */
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
|
||||
fi->lineno = lineno + 1; /* Advance the file lineno */
|
||||
fi->lineno = lineno + 1; /* Advance the file lineno */
|
||||
}
|
||||
|
||||
int config_text_file_save(const char *configfile, const struct ast_config *cfg, const char *generator)
|
||||
|
@ -2761,7 +2761,7 @@ int ast_parse_arg(const char *arg, enum ast_parse_flags flags,
|
|||
"extract inaddr from [%s] gives [%s:%d](%d)\n",
|
||||
arg, ast_inet_ntoa(sa->sin_addr),
|
||||
ntohs(sa->sin_port), error);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
va_end(ap);
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
* - \ref ast_state_cb struct. Callbacks for watchers
|
||||
* - Callback ast_state_cb_type
|
||||
* - \ref ast_hint struct.
|
||||
* - Functions
|
||||
* - Functions
|
||||
* - ast_extension_state_add()
|
||||
* - ast_extension_state_del()
|
||||
* - ast_get_hint()
|
||||
|
|
|
@ -75,8 +75,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
|
|
|
@ -787,7 +787,7 @@ static int dtmf_detect(struct ast_dsp *dsp, digit_detect_state_t *s, int16_t amp
|
|||
}
|
||||
|
||||
static int mf_detect(struct ast_dsp *dsp, digit_detect_state_t *s, int16_t amp[],
|
||||
int samples, int squelch, int relax)
|
||||
int samples, int squelch, int relax)
|
||||
{
|
||||
float energy[6];
|
||||
int best;
|
||||
|
@ -1781,7 +1781,7 @@ static int _dsp_init(int reload)
|
|||
for (v = ast_variable_browse(cfg, "default"); v; v = v->next) {
|
||||
if (!strcasecmp(v->name, "silencethreshold")) {
|
||||
if (sscanf(v->value, "%30d", &cfg_threshold) < 1) {
|
||||
ast_log(LOG_WARNING, "Unable to convert '%s' to a numeric value.\n", v->value);
|
||||
ast_log(LOG_WARNING, "Unable to convert '%s' to a numeric value.\n", v->value);
|
||||
} else if (cfg_threshold < 0) {
|
||||
ast_log(LOG_WARNING, "Invalid silence threshold '%d' specified, using default\n", cfg_threshold);
|
||||
} else {
|
||||
|
|
20
main/enum.c
20
main/enum.c
|
@ -95,7 +95,7 @@ AST_MUTEX_DEFINE_STATIC(enumlock);
|
|||
* Input: E.164 number w/o leading +
|
||||
*
|
||||
* Output: number of digits in the country code
|
||||
* 0 on invalid number
|
||||
* 0 on invalid number
|
||||
*
|
||||
* Algorithm:
|
||||
* 3 digits is the default length of a country code.
|
||||
|
@ -119,7 +119,7 @@ static int cclen(const char *number)
|
|||
}
|
||||
|
||||
if (cc / 10 == 1 || cc / 10 == 7)
|
||||
return 1;
|
||||
return 1;
|
||||
|
||||
if (cc == 20 || cc == 27 || (cc >= 30 && cc <= 34) || cc == 36 ||
|
||||
cc == 39 || cc == 40 || cc == 41 || (cc >= 40 && cc <= 41) ||
|
||||
|
@ -184,8 +184,8 @@ static int txt_callback(void *context, unsigned char *answer, int len, unsigned
|
|||
* Output: number of digits in the number before the i-enum branch
|
||||
*
|
||||
* Algorithm: Build <ienum_branchlabel>.c.c.<suffix> and look for a TXT lookup.
|
||||
* Return atoi(TXT-record).
|
||||
* Return -1 on not found.
|
||||
* Return atoi(TXT-record).
|
||||
* Return -1 on not found.
|
||||
*
|
||||
*/
|
||||
static int blr_txt(const char *cc, const char *suffix)
|
||||
|
@ -313,8 +313,8 @@ static int ebl_callback(void *context, unsigned char *answer, int len, unsigned
|
|||
* Output: number of digits in the number before the i-enum branch
|
||||
*
|
||||
* Algorithm: Build <ienum_branchlabel>.c.c.<suffix> and look for an EBL record
|
||||
* Return pos and fill in separator and apex.
|
||||
* Return -1 on not found.
|
||||
* Return pos and fill in separator and apex.
|
||||
* Return -1 on not found.
|
||||
*
|
||||
*/
|
||||
static int blr_ebl(const char *cc, const char *suffix, char *separator, int sep_len, char* apex, int apex_len)
|
||||
|
@ -690,10 +690,10 @@ int ast_get_enum(struct ast_channel *chan, const char *number, char *dst, int ds
|
|||
/*
|
||||
* Process options:
|
||||
*
|
||||
* c Return count, not URI
|
||||
* i Use infrastructure ENUM
|
||||
* s Do ISN transformation
|
||||
* d Direct DNS query: no reversing.
|
||||
* c Return count, not URI
|
||||
* i Use infrastructure ENUM
|
||||
* s Do ISN transformation
|
||||
* d Direct DNS query: no reversing.
|
||||
*
|
||||
*/
|
||||
if (options != NULL) {
|
||||
|
|
|
@ -735,27 +735,27 @@ static void *dial_features_duplicate(void *data)
|
|||
{
|
||||
struct ast_dial_features *df = data, *df_copy;
|
||||
|
||||
if (!(df_copy = ast_calloc(1, sizeof(*df)))) {
|
||||
return NULL;
|
||||
}
|
||||
if (!(df_copy = ast_calloc(1, sizeof(*df)))) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memcpy(df_copy, df, sizeof(*df));
|
||||
memcpy(df_copy, df, sizeof(*df));
|
||||
|
||||
return df_copy;
|
||||
return df_copy;
|
||||
}
|
||||
|
||||
static void dial_features_destroy(void *data)
|
||||
{
|
||||
struct ast_dial_features *df = data;
|
||||
if (df) {
|
||||
ast_free(df);
|
||||
}
|
||||
struct ast_dial_features *df = data;
|
||||
if (df) {
|
||||
ast_free(df);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct ast_datastore_info dial_features_info = {
|
||||
.type = "dial-features",
|
||||
.destroy = dial_features_destroy,
|
||||
.duplicate = dial_features_duplicate,
|
||||
.type = "dial-features",
|
||||
.destroy = dial_features_destroy,
|
||||
.duplicate = dial_features_duplicate,
|
||||
};
|
||||
|
||||
/* Forward declarations */
|
||||
|
@ -4108,7 +4108,7 @@ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, struct a
|
|||
* However, we don't think the feature has quite yet timed out, so just
|
||||
* go back into the bridge. */
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (config->feature_timer <=0) {
|
||||
/* We ran out of time */
|
||||
|
@ -4179,7 +4179,7 @@ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, struct a
|
|||
* they are useful. I haven't deleted them entirely because I
|
||||
* just am not sure of the ramifications of removing them. */
|
||||
if (aoh && aoh->flag == AST_OPTION_FLAG_REQUEST) {
|
||||
switch (ntohs(aoh->option)) {
|
||||
switch (ntohs(aoh->option)) {
|
||||
case AST_OPTION_TONE_VERIFY:
|
||||
case AST_OPTION_TDD:
|
||||
case AST_OPTION_RELAXDTMF:
|
||||
|
@ -7224,7 +7224,7 @@ static int manager_park(struct mansession *s, const struct message *m)
|
|||
* attempting to pickup the same channel.
|
||||
*/
|
||||
static const struct ast_datastore_info pickup_active = {
|
||||
.type = "pickup-active",
|
||||
.type = "pickup-active",
|
||||
};
|
||||
|
||||
int ast_can_pickup(struct ast_channel *chan)
|
||||
|
|
|
@ -426,7 +426,7 @@ enum file_action {
|
|||
* unused for DELETE
|
||||
* optional ast_format_cap holding all the formats found for a file, for EXISTS.
|
||||
* destination file name (const char *) for COPY and RENAME
|
||||
* struct ast_channel * for OPEN
|
||||
* struct ast_channel * for OPEN
|
||||
* if fmt is NULL, OPEN will return the first matching entry,
|
||||
* whereas other functions will run on all matching entries.
|
||||
*/
|
||||
|
|
|
@ -49,7 +49,7 @@ enum {
|
|||
struct fixed_jb_conf
|
||||
{
|
||||
long jbsize;
|
||||
long resync_threshold;
|
||||
long resync_threshold;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ static double coef_in[NF][NBW][8] = {
|
|||
{ 9.8532175289e-02,-5.6297236492e-02,3.3146713415e-01,-9.2239200436e-01,1.4844365184e+00,-2.0183258642e+00,2.0074154497e+00,0.0000000000e+00, },
|
||||
},
|
||||
{
|
||||
{ 1.8229206610e-04,-7.8997325866e-01,7.7191410839e-01,-2.8075643964e+00,1.6948618347e+00,-3.0367273700e+00,9.0333559408e-01,0.0000000000e+00, } ,
|
||||
{ 1.8229206610e-04,-7.8997325866e-01,7.7191410839e-01,-2.8075643964e+00,1.6948618347e+00,-3.0367273700e+00,9.0333559408e-01,0.0000000000e+00, },
|
||||
{ 9.8531161839e-02,-5.6297236492e-02,1.1421579050e-01,-4.8122536483e-01,4.0121072432e-01,-7.4834487567e-01,6.9170822332e-01,0.0000000000e+00, },
|
||||
},
|
||||
{
|
||||
|
@ -287,7 +287,7 @@ search_startbit3:
|
|||
samples++;
|
||||
}
|
||||
|
||||
/* x1 must be negative (start bit confirmation) */
|
||||
/* x1 must be negative (start bit confirmation) */
|
||||
|
||||
} while (fskd->x1 > 0);
|
||||
fskd->state = STATE_GET_BYTE;
|
||||
|
|
|
@ -44,8 +44,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||
*/
|
||||
struct io_rec {
|
||||
ast_io_cb callback; /*!< What is to be called */
|
||||
void *data; /*!< Data to be passed */
|
||||
int *id; /*!< ID number */
|
||||
void *data; /*!< Data to be passed */
|
||||
int *id; /*!< ID number */
|
||||
};
|
||||
|
||||
/* These two arrays are keyed with
|
||||
|
|
|
@ -672,7 +672,7 @@ static enum jb_return_code _jb_get(jitterbuf *jb, jb_frame *frameout, long now,
|
|||
* otherwise, we presently get into a pattern where we return
|
||||
* INTERP for the lost frame, then it shows up next, and we
|
||||
* throw it away because it's late */
|
||||
/* I've recently only been able to replicate this using
|
||||
/* I've recently only been able to replicate this using
|
||||
* iaxclient talking to app_echo on asterisk. In this case,
|
||||
* my outgoing packets go through asterisk's (old)
|
||||
* jitterbuffer, and then might get an unusual increasing delay
|
||||
|
@ -715,12 +715,12 @@ static enum jb_return_code _jb_get(jitterbuf *jb, jb_frame *frameout, long now,
|
|||
/* to disable silent special case altogether, just uncomment this: */
|
||||
/* jb->info.silence_begin_ts = 0; */
|
||||
|
||||
/* shrink interpl len every 10ms during silence */
|
||||
if (diff < -jb->info.conf.target_extra &&
|
||||
jb->info.last_adjustment + 10 <= now) {
|
||||
jb->info.current -= interpl;
|
||||
jb->info.last_adjustment = now;
|
||||
}
|
||||
/* shrink interpl len every 10ms during silence */
|
||||
if (diff < -jb->info.conf.target_extra &&
|
||||
jb->info.last_adjustment + 10 <= now) {
|
||||
jb->info.current -= interpl;
|
||||
jb->info.last_adjustment = now;
|
||||
}
|
||||
|
||||
frame = queue_get(jb, now - jb->info.current);
|
||||
if (!frame) {
|
||||
|
@ -819,7 +819,7 @@ enum jb_return_code jb_setconf(jitterbuf *jb, jb_conf *conf)
|
|||
/* take selected settings from the struct */
|
||||
|
||||
jb->info.conf.max_jitterbuf = conf->max_jitterbuf;
|
||||
jb->info.conf.resync_threshold = conf->resync_threshold;
|
||||
jb->info.conf.resync_threshold = conf->resync_threshold;
|
||||
jb->info.conf.max_contig_interp = conf->max_contig_interp;
|
||||
|
||||
/* -1 indicates use of the default JB_TARGET_EXTRA value */
|
||||
|
|
|
@ -154,7 +154,7 @@ int __ast_pthread_mutex_destroy(const char *filename, int lineno, const char *fu
|
|||
}
|
||||
|
||||
int __ast_pthread_mutex_lock(const char *filename, int lineno, const char *func,
|
||||
const char* mutex_name, ast_mutex_t *t)
|
||||
const char* mutex_name, ast_mutex_t *t)
|
||||
{
|
||||
int res;
|
||||
|
||||
|
@ -286,7 +286,7 @@ int __ast_pthread_mutex_lock(const char *filename, int lineno, const char *func,
|
|||
}
|
||||
|
||||
int __ast_pthread_mutex_trylock(const char *filename, int lineno, const char *func,
|
||||
const char* mutex_name, ast_mutex_t *t)
|
||||
const char* mutex_name, ast_mutex_t *t)
|
||||
{
|
||||
int res;
|
||||
|
||||
|
|
|
@ -1319,7 +1319,7 @@ static int strings_to_mask(const char *string)
|
|||
static struct mansession_session *unref_mansession(struct mansession_session *s)
|
||||
{
|
||||
int refcount = ao2_ref(s, -1);
|
||||
if (manager_debug) {
|
||||
if (manager_debug) {
|
||||
ast_debug(1, "Mansession: %p refcount now %d\n", s, refcount - 1);
|
||||
}
|
||||
return s;
|
||||
|
@ -4310,10 +4310,10 @@ static int blackfilter_cmp_fn(void *obj, void *arg, void *data, int flags)
|
|||
static int action_filter(struct mansession *s, const struct message *m)
|
||||
{
|
||||
const char *filter = astman_get_header(m, "Filter");
|
||||
const char *operation = astman_get_header(m, "Operation");
|
||||
int res;
|
||||
const char *operation = astman_get_header(m, "Operation");
|
||||
int res;
|
||||
|
||||
if (!strcasecmp(operation, "Add")) {
|
||||
if (!strcasecmp(operation, "Add")) {
|
||||
res = manager_add_filter(filter, s->session->whitefilters, s->session->blackfilters);
|
||||
|
||||
if (res != FILTER_SUCCESS) {
|
||||
|
@ -4330,8 +4330,8 @@ static int action_filter(struct mansession *s, const struct message *m)
|
|||
}
|
||||
|
||||
astman_send_ack(s, m, "Success");
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
astman_send_error(s, m, "Unknown operation");
|
||||
return 0;
|
||||
|
@ -4382,7 +4382,7 @@ static enum add_filter_result manager_add_filter(const char *filter_pattern, str
|
|||
ao2_t_link(whitefilters, new_filter, "link new filter into white user container");
|
||||
}
|
||||
|
||||
return FILTER_SUCCESS;
|
||||
return FILTER_SUCCESS;
|
||||
}
|
||||
|
||||
static int match_filter(struct mansession *s, char *eventdata)
|
||||
|
@ -6983,7 +6983,7 @@ static int __init_manager(int reload)
|
|||
}
|
||||
} else if (!strcasecmp(var->name, "eventfilter")) {
|
||||
const char *value = var->value;
|
||||
manager_add_filter(value, user->whitefilters, user->blackfilters);
|
||||
manager_add_filter(value, user->whitefilters, user->blackfilters);
|
||||
} else {
|
||||
ast_debug(1, "%s is an unknown option.\n", var->name);
|
||||
}
|
||||
|
|
|
@ -292,7 +292,7 @@ int ast_str_to_eid(struct ast_eid *eid, const char *s)
|
|||
|
||||
if (sscanf(s, "%2x:%2x:%2x:%2x:%2x:%2x", &eid_int[0], &eid_int[1], &eid_int[2],
|
||||
&eid_int[3], &eid_int[4], &eid_int[5]) != 6)
|
||||
return -1;
|
||||
return -1;
|
||||
|
||||
for (x = 0; x < 6; x++)
|
||||
eid->eid[x] = eid_int[x];
|
||||
|
|
10
main/plc.c
10
main/plc.c
|
@ -182,13 +182,13 @@ int plc_fillin(plc_state_t *s, int16_t amp[], int len)
|
|||
orig_len = len;
|
||||
if (s->missing_samples == 0) {
|
||||
/* As the gap in real speech starts we need to assess the last known pitch,
|
||||
and prepare the synthetic data we will use for fill-in */
|
||||
and prepare the synthetic data we will use for fill-in */
|
||||
normalise_history(s);
|
||||
s->pitch = amdf_pitch(PLC_PITCH_MIN, PLC_PITCH_MAX, s->history + PLC_HISTORY_LEN - CORRELATION_SPAN - PLC_PITCH_MIN, CORRELATION_SPAN);
|
||||
/* We overlap a 1/4 wavelength */
|
||||
pitch_overlap = s->pitch >> 2;
|
||||
/* Cook up a single cycle of pitch, using a single of the real signal with 1/4
|
||||
cycle OLA'ed to make the ends join up nicely */
|
||||
cycle OLA'ed to make the ends join up nicely */
|
||||
/* The first 3/4 of the cycle is a simple copy */
|
||||
for (i = 0; i < s->pitch - pitch_overlap; i++)
|
||||
s->pitchbuf[i] = s->history[PLC_HISTORY_LEN - s->pitch + i];
|
||||
|
@ -200,11 +200,11 @@ int plc_fillin(plc_state_t *s, int16_t amp[], int len)
|
|||
new_weight += new_step;
|
||||
}
|
||||
/* We should now be ready to fill in the gap with repeated, decaying cycles
|
||||
of what is in pitchbuf */
|
||||
of what is in pitchbuf */
|
||||
|
||||
/* We need to OLA the first 1/4 wavelength of the synthetic data, to smooth
|
||||
it into the previous real data. To avoid the need to introduce a delay
|
||||
in the stream, reverse the last 1/4 wavelength, and OLA with that. */
|
||||
it into the previous real data. To avoid the need to introduce a delay
|
||||
in the stream, reverse the last 1/4 wavelength, and OLA with that. */
|
||||
gain = 1.0;
|
||||
new_step = 1.0 / pitch_overlap;
|
||||
old_step = new_step;
|
||||
|
|
|
@ -1508,9 +1508,9 @@ void ast_rtp_instance_early_bridge_make_compatible(struct ast_channel *c0, struc
|
|||
ast_rtp_codecs_payloads_copy(&tinstance0->codecs, &tinstance1->codecs, tinstance1);
|
||||
}
|
||||
|
||||
if (glue0->update_peer(c0, instance1, vinstance1, tinstance1, cap1, 0)) {
|
||||
ast_log(LOG_WARNING, "Channel '%s' failed to setup early bridge to '%s'\n", ast_channel_name(c0), c1 ? ast_channel_name(c1) : "<unspecified>");
|
||||
}
|
||||
if (glue0->update_peer(c0, instance1, vinstance1, tinstance1, cap1, 0)) {
|
||||
ast_log(LOG_WARNING, "Channel '%s' failed to setup early bridge to '%s'\n", ast_channel_name(c0), c1 ? ast_channel_name(c1) : "<unspecified>");
|
||||
}
|
||||
|
||||
res = 0;
|
||||
|
||||
|
|
72
main/say.c
72
main/say.c
|
@ -26,9 +26,9 @@
|
|||
* \note 12-16-2004 : Support for Greek added by InAccess Networks (work funded by HOL, www.hol.gr) George Konstantoulakis <gkon@inaccessnetworks.com>
|
||||
*
|
||||
* \note 2007-02-08 : Support for Georgian added by Alexander Shaduri <ashaduri@gmail.com>,
|
||||
* Next Generation Networks (NGN).
|
||||
* Next Generation Networks (NGN).
|
||||
* \note 2007-03-20 : Support for Thai added by Dome C. <dome@tel.co.th>,
|
||||
* IP Crossing Co., Ltd.
|
||||
* IP Crossing Co., Ltd.
|
||||
*/
|
||||
|
||||
#include "asterisk.h"
|
||||
|
@ -594,13 +594,13 @@ static int exp10_int(int power)
|
|||
* - hundereds - 100 - sto, 200 - 2ste, 300,400 3,4sta, 500,600,...,900 5,6,...9set
|
||||
*
|
||||
* for each number 10^(3n + 3) exist 3 files represented as:
|
||||
* 1 tousand = jeden tisic = 1_E3
|
||||
* 2,3,4 tousands = dva,tri,ctyri tisice = 2-3_E3
|
||||
* 5,6,... tousands = pet,sest,... tisic = 5_E3
|
||||
* 1 tousand = jeden tisic = 1_E3
|
||||
* 2,3,4 tousands = dva,tri,ctyri tisice = 2-3_E3
|
||||
* 5,6,... tousands = pet,sest,... tisic = 5_E3
|
||||
*
|
||||
* million = _E6
|
||||
* miliard = _E9
|
||||
* etc...
|
||||
* million = _E6
|
||||
* miliard = _E9
|
||||
* etc...
|
||||
*
|
||||
* tousand, milion are gender male, so 1 and 2 is 1m 2m
|
||||
* miliard is gender female, so 1 and 2 is 1w 2w
|
||||
|
@ -880,7 +880,7 @@ static int ast_say_number_full_de(struct ast_channel *chan, int num, const char
|
|||
} else if (num == 1000 && t == 0) {
|
||||
ast_copy_string(fn, "digits/thousand", sizeof(fn));
|
||||
num = 0;
|
||||
} else if (num < 1000000) {
|
||||
} else if (num < 1000000) {
|
||||
int thousands = num / 1000;
|
||||
num = num % 1000;
|
||||
t = 1;
|
||||
|
@ -1131,9 +1131,9 @@ static int ast_say_number_full_es(struct ast_channel *chan, int num, const char
|
|||
}
|
||||
|
||||
/*! \brief ast_say_number_full_fr: French syntax
|
||||
Extra sounds needed:
|
||||
1F: feminin 'une'
|
||||
et: 'and' */
|
||||
Extra sounds needed:
|
||||
1F: feminin 'une'
|
||||
et: 'and' */
|
||||
static int ast_say_number_full_fr(struct ast_channel *chan, int num, const char *ints, const char *language, const char *options, int audiofd, int ctrlfd)
|
||||
{
|
||||
int res = 0;
|
||||
|
@ -1489,7 +1489,7 @@ static int ast_say_number_full_it(struct ast_channel *chan, int num, const char
|
|||
Italian support
|
||||
|
||||
Like english, numbers up to 20 are a single 'word', and others
|
||||
compound, but with exceptions.
|
||||
compound, but with exceptions.
|
||||
For example 21 is not twenty-one, but there is a single word in 'it'.
|
||||
Idem for 28 (ie when a the 2nd part of a compund number
|
||||
starts with a vowel)
|
||||
|
@ -2105,8 +2105,8 @@ static int ast_say_number_full_pl(struct ast_channel *chan, int num, const char
|
|||
|
||||
/* ast_say_number_full_pt: Portuguese syntax
|
||||
|
||||
* Extra sounds needed:
|
||||
* For feminin all sound files ends with F
|
||||
* Extra sounds needed:
|
||||
* For feminin all sound files ends with F
|
||||
* 100E for 100+ something
|
||||
* 1000000S for plural
|
||||
* pt-e for 'and'
|
||||
|
@ -2240,7 +2240,7 @@ static int ast_say_number_full_se(struct ast_channel *chan, int num, const char
|
|||
snprintf(fn, sizeof(fn), "digits/hundred");
|
||||
num -= 100;
|
||||
} else if (num == 1 && cn == -1) { /* En eller ett? */
|
||||
ast_copy_string(fn, "digits/1N", sizeof(fn));
|
||||
ast_copy_string(fn, "digits/1N", sizeof(fn));
|
||||
num = 0;
|
||||
} else if (num < 20) {
|
||||
snprintf(fn, sizeof(fn), "digits/%d", num);
|
||||
|
@ -2930,7 +2930,7 @@ static int ast_say_enumeration_full_da(struct ast_channel *chan, int num, const
|
|||
snprintf(fna, sizeof(fna), "digits/h-hundred%s", gender);
|
||||
}
|
||||
t = 1;
|
||||
} else if (num < 1000000) {
|
||||
} else if (num < 1000000) {
|
||||
int thousands = num / 1000;
|
||||
num = num % 1000;
|
||||
if (thousands == 1) {
|
||||
|
@ -3093,7 +3093,7 @@ static int ast_say_enumeration_full_de(struct ast_channel *chan, int num, const
|
|||
snprintf(fna, sizeof(fna), "digits/h-hundred%s", gender);
|
||||
}
|
||||
t = 1;
|
||||
} else if (num < 1000000) {
|
||||
} else if (num < 1000000) {
|
||||
int thousands = num / 1000;
|
||||
num = num % 1000;
|
||||
if (thousands == 1) {
|
||||
|
@ -4569,12 +4569,12 @@ int ast_say_date_with_format_he(struct ast_channel *chan, time_t t, const char *
|
|||
case 'd':
|
||||
case 'e': /* Day of the month */
|
||||
/* I'm not sure exactly what the parameters
|
||||
* audiofd and ctrlfd to
|
||||
* ast_say_number_full_he mean, but it seems
|
||||
* safe to pass -1 there.
|
||||
*
|
||||
* At least in one of the pathes :-(
|
||||
*/
|
||||
* audiofd and ctrlfd to
|
||||
* ast_say_number_full_he mean, but it seems
|
||||
* safe to pass -1 there.
|
||||
*
|
||||
* At least in one of the pathes :-(
|
||||
*/
|
||||
res = ast_say_number_full_he(chan, tm.tm_mday, ints, lang, "m", -1, -1);
|
||||
break;
|
||||
case 'Y': /* Year */
|
||||
|
@ -6943,7 +6943,7 @@ int ast_say_datetime_zh(struct ast_channel *chan, time_t t, const char *ints, co
|
|||
if (!res) {
|
||||
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
|
||||
res = ast_streamfile(chan, fn, lang);
|
||||
if (!res)
|
||||
if (!res)
|
||||
res = ast_waitstream(chan, ints);
|
||||
}
|
||||
|
||||
|
@ -7272,17 +7272,17 @@ static int gr_say_number_female(int num, struct ast_channel *chan, const char *i
|
|||
|
||||
|
||||
/*! \brief Greek support
|
||||
* A list of the files that you need to create
|
||||
-> digits/xilia = "xilia"
|
||||
-> digits/myrio = "ekatomyrio"
|
||||
-> digits/thousands = "xiliades"
|
||||
-> digits/millions = "ektatomyria"
|
||||
-> digits/[1..12] :: A pronunciation of th digits form 1 to 12 e.g. "tria"
|
||||
-> digits/[10..100] :: A pronunciation of the tens from 10 to 90
|
||||
* A list of the files that you need to create
|
||||
-> digits/xilia = "xilia"
|
||||
-> digits/myrio = "ekatomyrio"
|
||||
-> digits/thousands = "xiliades"
|
||||
-> digits/millions = "ektatomyria"
|
||||
-> digits/[1..12] :: A pronunciation of th digits form 1 to 12 e.g. "tria"
|
||||
-> digits/[10..100] :: A pronunciation of the tens from 10 to 90
|
||||
e.g. 80 = "ogdonta"
|
||||
Here we must note that we use digits/tens/100 to utter "ekato"
|
||||
and digits/hundred-100 to utter "ekaton"
|
||||
-> digits/hundred-[100...1000] :: A pronunciation of hundreds from 100 to 1000 e.g 400 =
|
||||
-> digits/hundred-[100...1000] :: A pronunciation of hundreds from 100 to 1000 e.g 400 =
|
||||
"terakosia". Here again we use hundreds/1000 for "xilia"
|
||||
and digits/thousnds for "xiliades"
|
||||
*/
|
||||
|
@ -8061,7 +8061,7 @@ static int ast_say_number_full_ka(struct ast_channel *chan, int num, const char
|
|||
|
||||
sprintf(new_string, "digits/");
|
||||
strncat(new_string, remaining, len); /* we can't sprintf() it, it's not null-terminated. */
|
||||
/* new_string[len + strlen("digits/")] = '\0'; */
|
||||
/* new_string[len + strlen("digits/")] = '\0'; */
|
||||
|
||||
if (!ast_streamfile(chan, new_string, language)) {
|
||||
if ((audiofd > -1) && (ctrlfd > -1))
|
||||
|
@ -8134,8 +8134,8 @@ static int ast_say_date_ka(struct ast_channel *chan, time_t t, const char *ints,
|
|||
|
||||
if (!res) {
|
||||
res = ast_say_number(chan, tm.tm_mday, ints, lang, (char * ) NULL);
|
||||
/* if (!res)
|
||||
res = ast_waitstream(chan, ints);
|
||||
/* if (!res)
|
||||
res = ast_waitstream(chan, ints);
|
||||
*/
|
||||
}
|
||||
|
||||
|
|
|
@ -1290,7 +1290,7 @@ static int tzparse(const char *name, struct state *sp, const int lastditch)
|
|||
for (year = EPOCH_YEAR;
|
||||
sp->timecnt + 2 <= TZ_MAX_TIMES;
|
||||
++year) {
|
||||
time_t newfirst;
|
||||
time_t newfirst;
|
||||
|
||||
starttime = transtime(janfirst, year, &start,
|
||||
stdoffset);
|
||||
|
@ -1668,7 +1668,7 @@ void ast_get_dst_info(const time_t * const timep, int *dst_enabled, time_t *dst_
|
|||
if (i >= sp->timecnt || 0 > transition1 || 0 > transition2 ||
|
||||
(sp->ttis[transition1].tt_isdst == sp->ttis[transition2].tt_isdst)) {
|
||||
*dst_enabled = 0;
|
||||
*gmt_off = sp->ttis[sp->types[sp->timecnt -1]].tt_gmtoff;
|
||||
*gmt_off = sp->ttis[sp->types[sp->timecnt -1]].tt_gmtoff;
|
||||
} else {
|
||||
/* I have valid daylight savings information. */
|
||||
if(sp->ttis[transition2].tt_isdst)
|
||||
|
|
|
@ -286,42 +286,42 @@ static void *tps_processing_function(void *data)
|
|||
}
|
||||
|
||||
while (i->poll_thread_run) {
|
||||
ast_mutex_lock(&i->taskprocessor_lock);
|
||||
if (!i->poll_thread_run) {
|
||||
ast_mutex_unlock(&i->taskprocessor_lock);
|
||||
break;
|
||||
}
|
||||
if (!(size = tps_taskprocessor_depth(i))) {
|
||||
ast_cond_wait(&i->poll_cond, &i->taskprocessor_lock);
|
||||
if (!i->poll_thread_run) {
|
||||
ast_mutex_unlock(&i->taskprocessor_lock);
|
||||
break;
|
||||
ast_mutex_lock(&i->taskprocessor_lock);
|
||||
if (!i->poll_thread_run) {
|
||||
ast_mutex_unlock(&i->taskprocessor_lock);
|
||||
break;
|
||||
}
|
||||
if (!(size = tps_taskprocessor_depth(i))) {
|
||||
ast_cond_wait(&i->poll_cond, &i->taskprocessor_lock);
|
||||
if (!i->poll_thread_run) {
|
||||
ast_mutex_unlock(&i->taskprocessor_lock);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ast_mutex_unlock(&i->taskprocessor_lock);
|
||||
/* stuff is in the queue */
|
||||
if (!(t = tps_taskprocessor_pop(i))) {
|
||||
ast_log(LOG_ERROR, "Wtf?? %d tasks in the queue, but we're popping blanks!\n", size);
|
||||
continue;
|
||||
}
|
||||
if (!t->execute) {
|
||||
ast_log(LOG_WARNING, "Task is missing a function to execute!\n");
|
||||
tps_task_free(t);
|
||||
continue;
|
||||
}
|
||||
t->execute(t->datap);
|
||||
}
|
||||
ast_mutex_unlock(&i->taskprocessor_lock);
|
||||
/* stuff is in the queue */
|
||||
if (!(t = tps_taskprocessor_pop(i))) {
|
||||
ast_log(LOG_ERROR, "Wtf?? %d tasks in the queue, but we're popping blanks!\n", size);
|
||||
continue;
|
||||
}
|
||||
if (!t->execute) {
|
||||
ast_log(LOG_WARNING, "Task is missing a function to execute!\n");
|
||||
tps_task_free(t);
|
||||
continue;
|
||||
}
|
||||
t->execute(t->datap);
|
||||
|
||||
ast_mutex_lock(&i->taskprocessor_lock);
|
||||
if (i->stats) {
|
||||
i->stats->_tasks_processed_count++;
|
||||
if (size > i->stats->max_qsize) {
|
||||
i->stats->max_qsize = size;
|
||||
}
|
||||
}
|
||||
ast_mutex_unlock(&i->taskprocessor_lock);
|
||||
ast_mutex_lock(&i->taskprocessor_lock);
|
||||
if (i->stats) {
|
||||
i->stats->_tasks_processed_count++;
|
||||
if (size > i->stats->max_qsize) {
|
||||
i->stats->max_qsize = size;
|
||||
}
|
||||
}
|
||||
ast_mutex_unlock(&i->taskprocessor_lock);
|
||||
|
||||
tps_task_free(t);
|
||||
}
|
||||
tps_task_free(t);
|
||||
}
|
||||
while ((t = tps_taskprocessor_pop(i))) {
|
||||
tps_task_free(t);
|
||||
}
|
||||
|
|
|
@ -266,7 +266,7 @@ static inline float tdd_getcarrier(float *cr, float *ci, int bit)
|
|||
#define PUT_TDD(byte) do { \
|
||||
int z; \
|
||||
unsigned char b = (byte); \
|
||||
PUT_TDD_BAUD(0); /* Start bit */ \
|
||||
PUT_TDD_BAUD(0); /* Start bit */ \
|
||||
for (z = 0; z < 5; z++) { \
|
||||
PUT_TDD_BAUD(b & 1); \
|
||||
b >>= 1; \
|
||||
|
|
|
@ -342,7 +342,7 @@ void term_filter_escapes(char *line)
|
|||
if ((i < (len - 2)) &&
|
||||
(line[i + 1] == 0x5B)) {
|
||||
switch (line[i + 2]) {
|
||||
case 0x30:
|
||||
case 0x30:
|
||||
case 0x31:
|
||||
case 0x33:
|
||||
continue;
|
||||
|
|
|
@ -1466,7 +1466,7 @@ long int ast_random(void)
|
|||
|
||||
char *ast_process_quotes_and_slashes(char *start, char find, char replace_with)
|
||||
{
|
||||
char *dataPut = start;
|
||||
char *dataPut = start;
|
||||
int inEscape = 0;
|
||||
int inQuotes = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue