summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2008-08-10 20:23:50 +0000
committerSean Bright <sean@malleable.com>2008-08-10 20:23:50 +0000
commit790fde68d94de4d7e8260f8ffc0923715783555e (patch)
treeb55253e4a6cb86147db48091cca0af756faf2ed4 /main
parentb69c8e6ab5b5d20a964d67e93cda8dc07da61fa4 (diff)
Another batch of files from RSW. The remaining apps and a few more
files from main/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/asterisk.c2
-rw-r--r--main/channel.c4
-rw-r--r--main/cli.c20
-rw-r--r--main/frame.c56
-rw-r--r--main/indications.c28
-rw-r--r--main/logger.c30
-rw-r--r--main/pbx.c46
-rw-r--r--main/rtp.c4
8 files changed, 95 insertions, 95 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 02d2d81ac..dc6cf9cdc 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -645,7 +645,7 @@ static char *handle_show_profile(struct ast_cli_entry *e, int cmd, struct ast_cl
"Value", "Average", "Name");
for (i = min; i < max; i++) {
struct profile_entry *entry = &prof_data->e[i];
- if (!search || strstr(prof_data->e[i].name, search))
+ if (!search || strstr(entry->name, search))
ast_cli(a->fd, "%6d: [%8ld] %10ld %12lld %12lld %s\n",
i,
(long)entry->scale,
diff --git a/main/channel.c b/main/channel.c
index 8798a41bc..83b6eea52 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -551,8 +551,8 @@ int ast_channel_cmpwhentohangup_tv(struct ast_channel *chan, struct timeval offs
int ast_channel_cmpwhentohangup(struct ast_channel *chan, time_t offset)
{
- struct timeval tv = { offset, };
- return ast_channel_cmpwhentohangup_tv(chan, tv);
+ struct timeval when = { offset, };
+ return ast_channel_cmpwhentohangup_tv(chan, when);
}
/*! \brief Register a new telephony channel in Asterisk */
diff --git a/main/cli.c b/main/cli.c
index 377e1f01a..8459ea35d 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -1625,7 +1625,7 @@ static char *handle_help(struct ast_cli_entry *e, int cmd, struct ast_cli_args *
static char *parse_args(const char *s, int *argc, char *argv[], int max, int *trailingwhitespace)
{
- char *dup, *cur;
+ char *duplicate, *cur;
int x = 0;
int quoted = 0;
int escaped = 0;
@@ -1638,10 +1638,10 @@ static char *parse_args(const char *s, int *argc, char *argv[], int max, int *tr
if (s == NULL) /* invalid, though! */
return NULL;
/* make a copy to store the parsed string */
- if (!(dup = ast_strdup(s)))
+ if (!(duplicate = ast_strdup(s)))
return NULL;
- cur = dup;
+ cur = duplicate;
/* scan the original string copying into cur when needed */
for (; *s ; s++) {
if (x >= max - 1) {
@@ -1685,7 +1685,7 @@ static char *parse_args(const char *s, int *argc, char *argv[], int max, int *tr
argv[x] = NULL;
*argc = x;
*trailingwhitespace = whitespace;
- return dup;
+ return duplicate;
}
/*! \brief Return the number of unique matches for the generator */
@@ -1777,9 +1777,9 @@ static char *__ast_cli_generator(const char *text, const char *word, int state,
char matchstr[80] = "";
int tws = 0;
/* Split the argument into an array of words */
- char *dup = parse_args(text, &x, argv, ARRAY_LEN(argv), &tws);
+ char *duplicate = parse_args(text, &x, argv, ARRAY_LEN(argv), &tws);
- if (!dup) /* malloc error */
+ if (!duplicate) /* malloc error */
return NULL;
/* Compute the index of the last argument (could be an empty string) */
@@ -1844,7 +1844,7 @@ static char *__ast_cli_generator(const char *text, const char *word, int state,
}
if (lock)
AST_RWLIST_UNLOCK(&helpers);
- ast_free(dup);
+ ast_free(duplicate);
return ret;
}
@@ -1858,12 +1858,12 @@ int ast_cli_command(int fd, const char *s)
char *args[AST_MAX_ARGS + 1];
struct ast_cli_entry *e;
int x;
- char *dup = parse_args(s, &x, args + 1, AST_MAX_ARGS, NULL);
+ char *duplicate = parse_args(s, &x, args + 1, AST_MAX_ARGS, NULL);
char *retval = NULL;
struct ast_cli_args a = {
.fd = fd, .argc = x, .argv = args+1 };
- if (dup == NULL)
+ if (duplicate == NULL)
return -1;
if (x < 1) /* We need at least one entry, otherwise ignore */
@@ -1904,7 +1904,7 @@ int ast_cli_command(int fd, const char *s)
}
ast_atomic_fetchadd_int(&e->inuse, -1);
done:
- ast_free(dup);
+ ast_free(duplicate);
return 0;
}
diff --git a/main/frame.c b/main/frame.c
index 29bf66a9d..c468a3703 100644
--- a/main/frame.c
+++ b/main/frame.c
@@ -496,9 +496,9 @@ void ast_swapcopy_samples(void *dst, const void *src, int samples)
}
-struct ast_format_list *ast_get_format_list_index(int index)
+struct ast_format_list *ast_get_format_list_index(int idx)
{
- return &AST_FORMAT_LIST[index];
+ return &AST_FORMAT_LIST[idx];
}
struct ast_format_list *ast_get_format_list(size_t *size)
@@ -997,16 +997,15 @@ int ast_codec_pref_string(struct ast_codec_pref *pref, char *buf, size_t size)
return size - total_len;
}
-int ast_codec_pref_index(struct ast_codec_pref *pref, int index)
+int ast_codec_pref_index(struct ast_codec_pref *pref, int idx)
{
int slot = 0;
-
- if ((index >= 0) && (index < sizeof(pref->order))) {
- slot = pref->order[index];
+ if ((idx >= 0) && (idx < sizeof(pref->order))) {
+ slot = pref->order[idx];
}
- return slot ? AST_FORMAT_LIST[slot-1].bits : 0;
+ return slot ? AST_FORMAT_LIST[slot - 1].bits : 0;
}
/*! \brief Remove codec from pref list */
@@ -1102,34 +1101,33 @@ void ast_codec_pref_prepend(struct ast_codec_pref *pref, int format, int only_if
/*! \brief Set packet size for codec */
int ast_codec_pref_setsize(struct ast_codec_pref *pref, int format, int framems)
{
- int x, index = -1;
+ int x, idx = -1;
for (x = 0; x < ARRAY_LEN(AST_FORMAT_LIST); x++) {
if (AST_FORMAT_LIST[x].bits == format) {
- index = x;
+ idx = x;
break;
}
}
- if (index < 0)
+ if (idx < 0)
return -1;
/* size validation */
if (!framems)
- framems = AST_FORMAT_LIST[index].def_ms;
-
- if (AST_FORMAT_LIST[index].inc_ms && framems % AST_FORMAT_LIST[index].inc_ms) /* avoid division by zero */
- framems -= framems % AST_FORMAT_LIST[index].inc_ms;
+ framems = AST_FORMAT_LIST[idx].def_ms;
- if (framems < AST_FORMAT_LIST[index].min_ms)
- framems = AST_FORMAT_LIST[index].min_ms;
+ if (AST_FORMAT_LIST[idx].inc_ms && framems % AST_FORMAT_LIST[idx].inc_ms) /* avoid division by zero */
+ framems -= framems % AST_FORMAT_LIST[idx].inc_ms;
- if (framems > AST_FORMAT_LIST[index].max_ms)
- framems = AST_FORMAT_LIST[index].max_ms;
+ if (framems < AST_FORMAT_LIST[idx].min_ms)
+ framems = AST_FORMAT_LIST[idx].min_ms;
+ if (framems > AST_FORMAT_LIST[idx].max_ms)
+ framems = AST_FORMAT_LIST[idx].max_ms;
for (x = 0; x < ARRAY_LEN(AST_FORMAT_LIST); x++) {
- if (pref->order[x] == (index + 1)) {
+ if (pref->order[x] == (idx + 1)) {
pref->framing[x] = framems;
break;
}
@@ -1141,19 +1139,19 @@ int ast_codec_pref_setsize(struct ast_codec_pref *pref, int format, int framems)
/*! \brief Get packet size for codec */
struct ast_format_list ast_codec_pref_getsize(struct ast_codec_pref *pref, int format)
{
- int x, index = -1, framems = 0;
+ int x, idx = -1, framems = 0;
struct ast_format_list fmt = { 0, };
for (x = 0; x < ARRAY_LEN(AST_FORMAT_LIST); x++) {
if (AST_FORMAT_LIST[x].bits == format) {
fmt = AST_FORMAT_LIST[x];
- index = x;
+ idx = x;
break;
}
}
for (x = 0; x < ARRAY_LEN(AST_FORMAT_LIST); x++) {
- if (pref->order[x] == (index + 1)) {
+ if (pref->order[x] == (idx + 1)) {
framems = pref->framing[x];
break;
}
@@ -1161,16 +1159,16 @@ struct ast_format_list ast_codec_pref_getsize(struct ast_codec_pref *pref, int f
/* size validation */
if (!framems)
- framems = AST_FORMAT_LIST[index].def_ms;
+ framems = AST_FORMAT_LIST[idx].def_ms;
- if (AST_FORMAT_LIST[index].inc_ms && framems % AST_FORMAT_LIST[index].inc_ms) /* avoid division by zero */
- framems -= framems % AST_FORMAT_LIST[index].inc_ms;
+ if (AST_FORMAT_LIST[idx].inc_ms && framems % AST_FORMAT_LIST[idx].inc_ms) /* avoid division by zero */
+ framems -= framems % AST_FORMAT_LIST[idx].inc_ms;
- if (framems < AST_FORMAT_LIST[index].min_ms)
- framems = AST_FORMAT_LIST[index].min_ms;
+ if (framems < AST_FORMAT_LIST[idx].min_ms)
+ framems = AST_FORMAT_LIST[idx].min_ms;
- if (framems > AST_FORMAT_LIST[index].max_ms)
- framems = AST_FORMAT_LIST[index].max_ms;
+ if (framems > AST_FORMAT_LIST[idx].max_ms)
+ framems = AST_FORMAT_LIST[idx].max_ms;
fmt.cur_ms = framems;
diff --git a/main/indications.c b/main/indications.c
index f75f27bad..edde12a90 100644
--- a/main/indications.c
+++ b/main/indications.c
@@ -233,55 +233,55 @@ int ast_playtones_start(struct ast_channel *chan, int vol, const char *playlst,
separator = ",";
s = strsep(&stringp,separator);
while (s && *s) {
- int freq1, freq2, time, modulate = 0, midinote = 0;
+ int freq1, freq2, duration, modulate = 0, midinote = 0;
if (s[0]=='!')
s++;
else if (d.reppos == -1)
d.reppos = d.nitems;
- if (sscanf(s, "%d+%d/%d", &freq1, &freq2, &time) == 3) {
+ if (sscanf(s, "%d+%d/%d", &freq1, &freq2, &duration) == 3) {
/* f1+f2/time format */
} else if (sscanf(s, "%d+%d", &freq1, &freq2) == 2) {
/* f1+f2 format */
- time = 0;
- } else if (sscanf(s, "%d*%d/%d", &freq1, &freq2, &time) == 3) {
+ duration = 0;
+ } else if (sscanf(s, "%d*%d/%d", &freq1, &freq2, &duration) == 3) {
/* f1*f2/time format */
modulate = 1;
} else if (sscanf(s, "%d*%d", &freq1, &freq2) == 2) {
/* f1*f2 format */
- time = 0;
+ duration = 0;
modulate = 1;
- } else if (sscanf(s, "%d/%d", &freq1, &time) == 2) {
+ } else if (sscanf(s, "%d/%d", &freq1, &duration) == 2) {
/* f1/time format */
freq2 = 0;
} else if (sscanf(s, "%d", &freq1) == 1) {
/* f1 format */
freq2 = 0;
- time = 0;
- } else if (sscanf(s, "M%d+M%d/%d", &freq1, &freq2, &time) == 3) {
+ duration = 0;
+ } else if (sscanf(s, "M%d+M%d/%d", &freq1, &freq2, &duration) == 3) {
/* Mf1+Mf2/time format */
midinote = 1;
} else if (sscanf(s, "M%d+M%d", &freq1, &freq2) == 2) {
/* Mf1+Mf2 format */
- time = 0;
+ duration = 0;
midinote = 1;
- } else if (sscanf(s, "M%d*M%d/%d", &freq1, &freq2, &time) == 3) {
+ } else if (sscanf(s, "M%d*M%d/%d", &freq1, &freq2, &duration) == 3) {
/* Mf1*Mf2/time format */
modulate = 1;
midinote = 1;
} else if (sscanf(s, "M%d*M%d", &freq1, &freq2) == 2) {
/* Mf1*Mf2 format */
- time = 0;
+ duration = 0;
modulate = 1;
midinote = 1;
- } else if (sscanf(s, "M%d/%d", &freq1, &time) == 2) {
+ } else if (sscanf(s, "M%d/%d", &freq1, &duration) == 2) {
/* Mf1/time format */
freq2 = -1;
midinote = 1;
} else if (sscanf(s, "M%d", &freq1) == 1) {
/* Mf1 format */
freq2 = -1;
- time = 0;
+ duration = 0;
midinote = 1;
} else {
ast_log(LOG_WARNING,"%s: tone component '%s' of '%s' is no good\n",chan->name,s,playlst);
@@ -311,7 +311,7 @@ int ast_playtones_start(struct ast_channel *chan, int vol, const char *playlst,
d.items[d.nitems].fac2 = 2.0 * cos(2.0 * M_PI * (freq2 / 8000.0)) * 32768.0;
d.items[d.nitems].init_v2_2 = sin(-4.0 * M_PI * (freq2 / 8000.0)) * d.vol;
d.items[d.nitems].init_v3_2 = sin(-2.0 * M_PI * (freq2 / 8000.0)) * d.vol;
- d.items[d.nitems].duration = time;
+ d.items[d.nitems].duration = duration;
d.items[d.nitems].modulate = modulate;
d.nitems++;
diff --git a/main/logger.c b/main/logger.c
index 341a624bf..d09d8271f 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -1086,7 +1086,7 @@ void ast_log(int level, const char *file, int line, const char *function, const
struct logmsg *logmsg = NULL;
struct ast_str *buf = NULL;
struct ast_tm tm;
- struct timeval tv = ast_tvnow();
+ struct timeval now = ast_tvnow();
int res = 0;
va_list ap;
@@ -1099,11 +1099,11 @@ void ast_log(int level, const char *file, int line, const char *function, const
* so just log to stdout
*/
if (level != __LOG_VERBOSE) {
- int res;
+ int result;
va_start(ap, fmt);
- res = ast_str_set_va(&buf, BUFSIZ, fmt, ap); /* XXX BUFSIZ ? */
+ result = ast_str_set_va(&buf, BUFSIZ, fmt, ap); /* XXX BUFSIZ ? */
va_end(ap);
- if (res != AST_DYNSTR_BUILD_FAILED) {
+ if (result != AST_DYNSTR_BUILD_FAILED) {
term_filter_escapes(buf->str);
fputs(buf->str, stdout);
}
@@ -1144,7 +1144,7 @@ void ast_log(int level, const char *file, int line, const char *function, const
logmsg->type = LOGMSG_NORMAL;
/* Create our date/time */
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&now, &tm, NULL);
ast_strftime(logmsg->date, sizeof(logmsg->date), dateformat, &tm);
/* Copy over data */
@@ -1206,25 +1206,25 @@ void *ast_bt_destroy(struct ast_bt *bt)
void ast_backtrace(void)
{
#ifdef HAVE_BKTR
- struct ast_bt *backtrace;
+ struct ast_bt *bt;
int i = 0;
char **strings;
- if (!(backtrace = ast_bt_create())) {
+ if (!(bt = ast_bt_create())) {
ast_log(LOG_WARNING, "Unable to allocate space for backtrace structure\n");
return;
}
- if ((strings = backtrace_symbols(backtrace->addresses, backtrace->num_frames))) {
- ast_debug(1, "Got %d backtrace record%c\n", backtrace->num_frames, backtrace->num_frames != 1 ? 's' : ' ');
- for (i = 0; i < backtrace->num_frames; i++) {
- ast_log(LOG_DEBUG, "#%d: [%p] %s\n", i, backtrace->addresses[i], strings[i]);
+ if ((strings = backtrace_symbols(bt->addresses, bt->num_frames))) {
+ ast_debug(1, "Got %d backtrace record%c\n", bt->num_frames, bt->num_frames != 1 ? 's' : ' ');
+ for (i = 0; i < bt->num_frames; i++) {
+ ast_log(LOG_DEBUG, "#%d: [%p] %s\n", i, bt->addresses[i], strings[i]);
}
free(strings);
} else {
ast_debug(1, "Could not allocate memory for backtrace\n");
}
- ast_bt_destroy(backtrace);
+ ast_bt_destroy(bt);
#else
ast_log(LOG_WARNING, "Must run configure with '--with-execinfo' for stack backtraces.\n");
#endif
@@ -1241,13 +1241,13 @@ void __ast_verbose(const char *file, int line, const char *func, const char *fmt
return;
if (ast_opt_timestamp) {
- struct timeval tv;
+ struct timeval now;
struct ast_tm tm;
char date[40];
char *datefmt;
- tv = ast_tvnow();
- ast_localtime(&tv, &tm, NULL);
+ now = ast_tvnow();
+ ast_localtime(&now, &tm, NULL);
ast_strftime(date, sizeof(date), dateformat, &tm);
datefmt = alloca(strlen(date) + 3 + strlen(fmt) + 1);
sprintf(datefmt, "%c[%s] %s", 127, date, fmt);
diff --git a/main/pbx.c b/main/pbx.c
index 6968171f2..86cac5363 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -2977,14 +2977,14 @@ static void pbx_substitute_variables_helper_full(struct ast_channel *c, struct v
cp4 = ast_func_read(c, vars, workspace, VAR_BUF_SIZE) ? NULL : workspace;
else {
struct varshead old;
- struct ast_channel *c = ast_channel_alloc(0, 0, "", "", "", "", "", 0, "Bogus/%p", vars);
- if (c) {
- memcpy(&old, &c->varshead, sizeof(old));
- memcpy(&c->varshead, headp, sizeof(c->varshead));
- cp4 = ast_func_read(c, vars, workspace, VAR_BUF_SIZE) ? NULL : workspace;
+ struct ast_channel *bogus = ast_channel_alloc(0, 0, "", "", "", "", "", 0, "Bogus/%p", vars);
+ if (bogus) {
+ memcpy(&old, &bogus->varshead, sizeof(old));
+ memcpy(&bogus->varshead, headp, sizeof(bogus->varshead));
+ cp4 = ast_func_read(bogus, vars, workspace, VAR_BUF_SIZE) ? NULL : workspace;
/* Don't deallocate the varshead that was passed in */
- memcpy(&c->varshead, &old, sizeof(c->varshead));
- ast_channel_free(c);
+ memcpy(&bogus->varshead, &old, sizeof(bogus->varshead));
+ ast_channel_free(bogus);
} else
ast_log(LOG_ERROR, "Unable to allocate bogus channel for variable substitution. Function results may be blank.\n");
}
@@ -4198,13 +4198,13 @@ int ast_context_remove_extension(const char *context, const char *extension, int
return ast_context_remove_extension_callerid(context, extension, priority, NULL, 0, registrar);
}
-int ast_context_remove_extension_callerid(const char *context, const char *extension, int priority, const char *callerid, int matchcid, const char *registrar)
+int ast_context_remove_extension_callerid(const char *context, const char *extension, int priority, const char *callerid, int matchcallerid, const char *registrar)
{
int ret = -1; /* default error return */
struct ast_context *c = find_context_locked(context);
if (c) { /* ... remove extension ... */
- ret = ast_context_remove_extension_callerid2(c, extension, priority, callerid, matchcid, registrar, 1);
+ ret = ast_context_remove_extension_callerid2(c, extension, priority, callerid, matchcallerid, registrar, 1);
ast_unlock_contexts();
}
return ret;
@@ -4225,7 +4225,7 @@ int ast_context_remove_extension2(struct ast_context *con, const char *extension
return ast_context_remove_extension_callerid2(con, extension, priority, NULL, 0, registrar, already_locked);
}
-int ast_context_remove_extension_callerid2(struct ast_context *con, const char *extension, int priority, const char *callerid, int matchcid, const char *registrar, int already_locked)
+int ast_context_remove_extension_callerid2(struct ast_context *con, const char *extension, int priority, const char *callerid, int matchcallerid, const char *registrar, int already_locked)
{
struct ast_exten *exten, *prev_exten = NULL;
struct ast_exten *peer;
@@ -4243,14 +4243,14 @@ int ast_context_remove_extension_callerid2(struct ast_context *con, const char *
/* FIXME For backwards compatibility, if callerid==NULL, then remove ALL
* peers, not just those matching the callerid. */
#ifdef NEED_DEBUG
- ast_verb(3,"Removing %s/%s/%d%s%s from trees, registrar=%s\n", con->name, extension, priority, matchcid ? "/" : "", matchcid ? callerid : "", registrar);
+ ast_verb(3,"Removing %s/%s/%d%s%s from trees, registrar=%s\n", con->name, extension, priority, matchcallerid ? "/" : "", matchcallerid ? callerid : "", registrar);
#endif
#ifdef CONTEXT_DEBUG
check_contexts(__FILE__, __LINE__);
#endif
/* find this particular extension */
ex.exten = dummy_name;
- ex.matchcid = matchcid && !ast_strlen_zero(callerid); /* don't say match if there's no callerid */
+ ex.matchcid = matchcallerid && !ast_strlen_zero(callerid); /* don't say match if there's no callerid */
ex.cidmatch = callerid;
ast_copy_string(dummy_name, extension, sizeof(dummy_name));
exten = ast_hashtab_lookup(con->root_table, &ex);
@@ -4323,7 +4323,7 @@ int ast_context_remove_extension_callerid2(struct ast_context *con, const char *
for (exten = con->root; exten; prev_exten = exten, exten = exten->next) {
if (!strcmp(exten->exten, extension) &&
(!registrar || !strcmp(exten->registrar, registrar)) &&
- (!matchcid || (!ast_strlen_zero(callerid) && !ast_strlen_zero(exten->cidmatch) && !strcmp(exten->cidmatch, callerid)) || (ast_strlen_zero(callerid) && ast_strlen_zero(exten->cidmatch))))
+ (!matchcallerid || (!ast_strlen_zero(callerid) && !ast_strlen_zero(exten->cidmatch) && !strcmp(exten->cidmatch, callerid)) || (ast_strlen_zero(callerid) && ast_strlen_zero(exten->cidmatch))))
break;
}
if (!exten) {
@@ -4335,10 +4335,10 @@ int ast_context_remove_extension_callerid2(struct ast_context *con, const char *
/* scan the priority list to remove extension with exten->priority == priority */
for (peer = exten, next_peer = exten->peer ? exten->peer : exten->next;
- peer && !strcmp(peer->exten, extension) && (!matchcid || (!ast_strlen_zero(callerid) && !ast_strlen_zero(peer->cidmatch) && !strcmp(peer->cidmatch,callerid)) || (ast_strlen_zero(callerid) && ast_strlen_zero(peer->cidmatch)));
+ peer && !strcmp(peer->exten, extension) && (!matchcallerid || (!ast_strlen_zero(callerid) && !ast_strlen_zero(peer->cidmatch) && !strcmp(peer->cidmatch,callerid)) || (ast_strlen_zero(callerid) && ast_strlen_zero(peer->cidmatch)));
peer = next_peer, next_peer = next_peer ? (next_peer->peer ? next_peer->peer : next_peer->next) : NULL) {
if ((priority == 0 || peer->priority == priority) &&
- (!callerid || !matchcid || (matchcid && !strcmp(peer->cidmatch, callerid))) &&
+ (!callerid || !matchcallerid || (matchcallerid && !strcmp(peer->cidmatch, callerid))) &&
(!registrar || !strcmp(peer->registrar, registrar) )) {
found = 1;
@@ -6206,9 +6206,9 @@ int ast_build_timing(struct ast_timing *i, const char *info_in)
int ast_check_timing(const struct ast_timing *i)
{
struct ast_tm tm;
- struct timeval tv = ast_tvnow();
+ struct timeval now = ast_tvnow();
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&now, &tm, NULL);
/* If it's not the right month, return */
if (!(i->monthmask & (1 << tm.tm_mon)))
@@ -7086,14 +7086,14 @@ static int ast_pbx_outgoing_cdr_failed(void)
return 0; /* success */
}
-int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout, const char *context, const char *exten, int priority, int *reason, int sync, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **channel)
+int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout, const char *context, const char *exten, int priority, int *reason, int synchronous, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **channel)
{
struct ast_channel *chan;
struct async_stat *as;
int res = -1, cdr_res = -1;
struct outgoing_helper oh;
- if (sync) {
+ if (synchronous) {
oh.context = context;
oh.exten = exten;
oh.priority = priority;
@@ -7114,7 +7114,7 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout
res = 0;
ast_verb(4, "Channel %s was answered.\n", chan->name);
- if (sync > 1) {
+ if (synchronous > 1) {
if (channel)
ast_channel_unlock(chan);
if (ast_pbx_run(chan)) {
@@ -7252,7 +7252,7 @@ static void *ast_pbx_run_app(void *data)
return NULL;
}
-int ast_pbx_outgoing_app(const char *type, int format, void *data, int timeout, const char *app, const char *appdata, int *reason, int sync, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel)
+int ast_pbx_outgoing_app(const char *type, int format, void *data, int timeout, const char *app, const char *appdata, int *reason, int synchronous, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel)
{
struct ast_channel *chan;
struct app_tmp *tmp;
@@ -7269,7 +7269,7 @@ int ast_pbx_outgoing_app(const char *type, int format, void *data, int timeout,
res = -1;
goto outgoing_app_cleanup;
}
- if (sync) {
+ if (synchronous) {
chan = __ast_request_and_dial(type, format, data, timeout, reason, cid_num, cid_name, &oh);
if (chan) {
ast_set_variables(chan, vars);
@@ -7286,7 +7286,7 @@ int ast_pbx_outgoing_app(const char *type, int format, void *data, int timeout,
if (appdata)
ast_copy_string(tmp->data, appdata, sizeof(tmp->data));
tmp->chan = chan;
- if (sync > 1) {
+ if (synchronous > 1) {
if (locked_channel)
ast_channel_unlock(chan);
ast_pbx_run_app(tmp);
diff --git a/main/rtp.c b/main/rtp.c
index 03f19ef1a..bca955dea 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -1610,8 +1610,10 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
(rtp->them.sin_port != sock_in.sin_port)) {
rtp->them = sock_in;
if (rtp->rtcp) {
+ int h = 0;
memcpy(&rtp->rtcp->them, &sock_in, sizeof(rtp->rtcp->them));
- rtp->rtcp->them.sin_port = htons(ntohs(rtp->them.sin_port)+1);
+ h = ntohs(rtp->them.sin_port);
+ rtp->rtcp->them.sin_port = htons(h + 1);
}
rtp->rxseqno = 0;
ast_set_flag(rtp, FLAG_NAT_ACTIVE);