summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2012-10-29 21:27:09 +0000
committerMark Michelson <mmichelson@digium.com>2012-10-29 21:27:09 +0000
commitda85f8489f76d50989f1f030eea7b13dc1fda52d (patch)
tree2d73dea0a4ccd82b65bc8f35012cf1e5a66c2a8e /channels
parent1eb14dbff8bb10caba4e7bd6ebb284056d328821 (diff)
Make evaluation of channel variables consistently case-sensitive.
Due to inconsistencies in how variable names were evaluated, the decision was made to make all evaluations case-sensitive. See the UPGRADE.txt file or https://wiki.asterisk.org/wiki/display/AST/Case+Sensitivity for more details. (closes issue ASTERISK-20163) reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2160 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_mgcp.c11
-rw-r--r--channels/chan_sip.c22
-rw-r--r--channels/chan_skinny.c2
3 files changed, 13 insertions, 22 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index ff909a3be..0c3dac607 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -842,20 +842,11 @@ static int mgcp_call(struct ast_channel *ast, const char *dest, int timeout)
struct mgcp_endpoint *p;
struct mgcp_subchannel *sub;
char tone[50] = "";
- const char *distinctive_ring = NULL;
- struct varshead *headp;
- struct ast_var_t *current;
+ const char *distinctive_ring = pbx_builtin_getvar_helper(ast, "ALERT_INFO");
ast_debug(3, "MGCP mgcp_call(%s)\n", ast_channel_name(ast));
sub = ast_channel_tech_pvt(ast);
p = sub->parent;
- headp = ast_channel_varshead(ast);
- AST_LIST_TRAVERSE(headp,current,entries) {
- /* Check whether there is an ALERT_INFO variable */
- if (strcasecmp(ast_var_name(current),"ALERT_INFO") == 0) {
- distinctive_ring = ast_var_value(current);
- }
- }
ast_mutex_lock(&sub->lock);
switch (p->hookstate) {
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 343e66488..6b3fa6990 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -6256,28 +6256,28 @@ static int sip_call(struct ast_channel *ast, const char *dest, int timeout)
}
/* Check whether there is vxml_url, distinctive ring variables */
- headp=ast_channel_varshead(ast);
+ headp = ast_channel_varshead(ast);
AST_LIST_TRAVERSE(headp, current, entries) {
/* Check whether there is a VXML_URL variable */
- if (!p->options->vxml_url && !strcasecmp(ast_var_name(current), "VXML_URL")) {
+ if (!p->options->vxml_url && !strcmp(ast_var_name(current), "VXML_URL")) {
p->options->vxml_url = ast_var_value(current);
- } else if (!p->options->uri_options && !strcasecmp(ast_var_name(current), "SIP_URI_OPTIONS")) {
+ } else if (!p->options->uri_options && !strcmp(ast_var_name(current), "SIP_URI_OPTIONS")) {
p->options->uri_options = ast_var_value(current);
- } else if (!p->options->addsipheaders && !strncasecmp(ast_var_name(current), "SIPADDHEADER", strlen("SIPADDHEADER"))) {
+ } else if (!p->options->addsipheaders && !strncmp(ast_var_name(current), "SIPADDHEADER", strlen("SIPADDHEADER"))) {
/* Check whether there is a variable with a name starting with SIPADDHEADER */
p->options->addsipheaders = 1;
- } else if (!strcasecmp(ast_var_name(current), "SIPFROMDOMAIN")) {
+ } else if (!strcmp(ast_var_name(current), "SIPFROMDOMAIN")) {
ast_string_field_set(p, fromdomain, ast_var_value(current));
- } else if (!strcasecmp(ast_var_name(current), "SIPTRANSFER")) {
+ } else if (!strcmp(ast_var_name(current), "SIPTRANSFER")) {
/* This is a transfered call */
p->options->transfer = 1;
- } else if (!strcasecmp(ast_var_name(current), "SIPTRANSFER_REFERER")) {
+ } else if (!strcmp(ast_var_name(current), "SIPTRANSFER_REFERER")) {
/* This is the referrer */
referer = ast_var_value(current);
- } else if (!strcasecmp(ast_var_name(current), "SIPTRANSFER_REPLACES")) {
+ } else if (!strcmp(ast_var_name(current), "SIPTRANSFER_REPLACES")) {
/* We're replacing a call. */
p->options->replaces = ast_var_value(current);
- } else if (!strcasecmp(ast_var_name(current), "SIP_MAX_FORWARDS")) {
+ } else if (!strcmp(ast_var_name(current), "SIP_MAX_FORWARDS")) {
if (sscanf(ast_var_value(current), "%30d", &(p->maxforwards)) != 1) {
ast_log(LOG_WARNING, "The SIP_MAX_FORWARDS channel variable is not a valid integer.\n");
}
@@ -14025,7 +14025,7 @@ static int transmit_invite(struct sip_pvt *p, int sipmethod, int sdp, int init,
const struct ast_var_t *current;
AST_LIST_TRAVERSE(headp, current, entries) {
/* SIPADDHEADER: Add SIP header to outgoing call */
- if (!strncasecmp(ast_var_name(current), "SIPADDHEADER", strlen("SIPADDHEADER"))) {
+ if (!strncmp(ast_var_name(current), "SIPADDHEADER", strlen("SIPADDHEADER"))) {
char *content, *end;
const char *header = ast_var_value(current);
char *headdup = ast_strdupa(header);
@@ -32615,7 +32615,7 @@ static int sip_removeheader(struct ast_channel *chan, const char *data)
headp=ast_channel_varshead(chan);
AST_LIST_TRAVERSE_SAFE_BEGIN (headp, newvariable, entries) {
- if (strncasecmp(ast_var_name(newvariable), "SIPADDHEADER", strlen("SIPADDHEADER")) == 0) {
+ if (strncmp(ast_var_name(newvariable), "SIPADDHEADER", strlen("SIPADDHEADER")) == 0) {
if (removeall || (!strncasecmp(ast_var_value(newvariable),inbuf,strlen(inbuf)))) {
if (sipdebug) {
ast_debug(1,"removing SIP Header \"%s\" as %s\n",
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 01b1c6024..3e4046feb 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -4425,7 +4425,7 @@ static int skinny_call(struct ast_channel *ast, const char *dest, int timeout)
}
AST_LIST_TRAVERSE(ast_channel_varshead(ast), current, entries) {
- if (!(strcasecmp(ast_var_name(current),"SKINNY_AUTOANSWER"))) {
+ if (!(strcmp(ast_var_name(current), "SKINNY_AUTOANSWER"))) {
if (d->hookstate == SKINNY_ONHOOK && !sub->aa_sched) {
char buf[24];
int aatime;