mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-01 18:09:41 +00:00
These changes are in regards to bug 13249, where users are being surprised by the changes made
to the Set app in trunk/1.6.x, as they come from the 1.4 world. They are only bitten if they write their AEL dialplan in the 1.4 world, and then carry it over to a trunk/1.6.x installation where a "make samples" was executed, or where they hand-edited the asterisk.conf file and added the [compat] category with app_set = 1.6 (or higher). (this commit does not totally solve 13249, at least not yet) The change involves issueing a single warning while the AEL file is loading, if: 1. app_set is present in the config file, and set to 1.6 or higher. 2. there are double quotes in an assignment statement (eg x = "hi there";) 3. the warning was not already issued. The standalone app, aelparse, does not (yet) issue this warning. I'd have to have it read in the asterisk.conf file, and that's a bit of hassle. I'll add it if users request it, tho. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@138815 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -669,6 +669,11 @@ static struct pbx_builtin {
|
||||
"channel. If the variable name is prefixed with __, the variable will be\n"
|
||||
"inherited into channels created from the current channel and all children\n"
|
||||
"channels.\n"
|
||||
"Compatibility note: If (and only if), in /etc/asterisk/asterisk.conf, you have a [compat]\n"
|
||||
"category, and you have app_set = 1.6 under that, then the behavior of this\n"
|
||||
"app changes, and does not strip surrounding quotes from the right hand side\n"
|
||||
"as it did previously in 1.4. The app_set = 1.6 is only inserted if 'make samples'\n"
|
||||
"is executed, or if the users inserts this by hand into the asterisk.conf file.\n"
|
||||
},
|
||||
|
||||
{ "MSet", pbx_builtin_setvar_multiple,
|
||||
@@ -681,7 +686,8 @@ static struct pbx_builtin {
|
||||
"inherited into channels created from the current channel and all children\n"
|
||||
"channels.\n\n"
|
||||
"MSet behaves in a similar fashion to the way Set worked in 1.2/1.4 and is thus\n"
|
||||
"prone to doing things that you may not expect. Avoid its use if possible.\n"
|
||||
"prone to doing things that you may not expect. For example, it strips surrounding\n"
|
||||
"double-quotes from the right-hand side (value). Avoid its use if possible.\n"
|
||||
},
|
||||
|
||||
{ "SetAMAFlags", pbx_builtin_setamaflags,
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,9 @@
|
||||
/* A Bison parser, made by GNU Bison 2.1a. */
|
||||
/* A Bison parser, made by GNU Bison 2.3. */
|
||||
|
||||
/* Skeleton parser for Yacc-like parsing with Bison,
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -18,10 +20,18 @@
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, when this file is copied by Bison into a
|
||||
Bison output file, you may use that output file without restriction.
|
||||
This special exception was added by the Free Software Foundation
|
||||
in version 1.24 of Bison. */
|
||||
/* As a special exception, you may create a larger work that contains
|
||||
part or all of the Bison parser skeleton and distribute that work
|
||||
under terms of your choice, so long as that work isn't itself a
|
||||
parser generator using the skeleton or a modified version thereof
|
||||
as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
the parser skeleton itself, you may (at your option) remove this
|
||||
special exception, which will cause the skeleton and the resulting
|
||||
Bison output files to be licensed under the GNU General Public
|
||||
License without this special exception.
|
||||
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
@@ -120,14 +130,14 @@
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
#line 56 "ael.y"
|
||||
#line 58 "ael.y"
|
||||
{
|
||||
int intval; /* integer value, typically flags */
|
||||
char *str; /* strings */
|
||||
struct pval *pval; /* full objects */
|
||||
}
|
||||
/* Line 1536 of yacc.c. */
|
||||
#line 131 "ael.tab.h"
|
||||
/* Line 1489 of yacc.c. */
|
||||
#line 141 "ael.tab.h"
|
||||
YYSTYPE;
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
@@ -150,5 +160,3 @@ typedef struct YYLTYPE
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -34,6 +34,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/lock.h"
|
||||
#include "asterisk/hashtab.h"
|
||||
#include "asterisk/ael_structs.h"
|
||||
#include "asterisk/utils.h"
|
||||
|
||||
pval * linku1(pval *head, pval *tail);
|
||||
static void set_dads(pval *dad, pval *child_list);
|
||||
@@ -49,6 +50,7 @@ extern char *my_file;
|
||||
int ael_is_funcname(char *name);
|
||||
#endif
|
||||
static char *ael_token_subst(const char *mess);
|
||||
static int only_one_app_set_warning = 0;
|
||||
|
||||
%}
|
||||
|
||||
@@ -238,6 +240,10 @@ global_statements : { $$ = NULL; }
|
||||
|
||||
assignment : word EQ { reset_semicount(parseio->scanner); } word SEMI {
|
||||
$$ = npval2(PV_VARDEC, &@1, &@5);
|
||||
if (!ast_compat_app_set && !only_one_app_set_warning && strchr($4,'"')) {
|
||||
ast_log(LOG_NOTICE,"Note: In asterisk.conf, in the [compat] section, the app_set is set to 1.6 or greater. The Set() function no longer removes double quotes from the value. If this is a surprise to you, you can set app_set to 1.4.\n");
|
||||
only_one_app_set_warning = 1;
|
||||
}
|
||||
$$->u1.str = $1;
|
||||
$$->u2.val = $4; }
|
||||
;
|
||||
|
Reference in New Issue
Block a user