[asterisk-commits] murf: branch murf/AEL2-1.2 r52243 - in
/team/murf/AEL2-1.2: ./ apps/ utils/
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Jan 25 11:38:00 MST 2007
Author: murf
Date: Thu Jan 25 12:38:00 2007
New Revision: 52243
URL: http://svn.digium.com/view/asterisk?view=rev&rev=52243
Log:
Merged revisions 52002,52137,52162 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r52002 | murf | 2007-01-24 10:43:50 -0700 (Wed, 24 Jan 2007) | 1 line
updated check_expr via 8322 (refactoring of expression checking impl); elfring contributed a nice code reorg, I contributed some time to get it working again, better messages
........
r52137 | russell | 2007-01-24 17:39:50 -0700 (Wed, 24 Jan 2007) | 3 lines
Fix a seg fault when running this application with no arguments from AGI.
(issue #8905, junky)
........
r52162 | file | 2007-01-24 18:48:52 -0700 (Wed, 24 Jan 2007) | 2 lines
Add another note about audio files being played back to each bridged party. (issue #8718 reported by ppyy)
........
Modified:
team/murf/AEL2-1.2/ (props changed)
team/murf/AEL2-1.2/apps/app_groupcount.c
team/murf/AEL2-1.2/apps/app_mixmonitor.c
team/murf/AEL2-1.2/utils/Makefile
team/murf/AEL2-1.2/utils/check_expr.c
Propchange: team/murf/AEL2-1.2/
------------------------------------------------------------------------------
automerge = da
Propchange: team/murf/AEL2-1.2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jan 25 12:38:00 2007
@@ -1,1 +1,1 @@
-/branches/1.2:1-51968
+/branches/1.2:1-52242
Modified: team/murf/AEL2-1.2/apps/app_groupcount.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/apps/app_groupcount.c?view=diff&rev=52243&r1=52242&r2=52243
==============================================================================
--- team/murf/AEL2-1.2/apps/app_groupcount.c (original)
+++ team/murf/AEL2-1.2/apps/app_groupcount.c Thu Jan 25 12:38:00 2007
@@ -153,6 +153,11 @@
if (!deprecation_warning) {
ast_log(LOG_WARNING, "The CheckGroup application has been deprecated, please use a combination of the GotoIf application and the GROUP_COUNT() function.\n");
deprecation_warning = 1;
+ }
+
+ if (ast_strlen_zero(data)) {
+ ast_log(LOG_WARNING, "CheckGroup requires an argument(max[@category][|options])\n");
+ return 0;
}
if (!(parse = ast_strdupa(data))) {
Modified: team/murf/AEL2-1.2/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/apps/app_mixmonitor.c?view=diff&rev=52243&r1=52242&r2=52243
==============================================================================
--- team/murf/AEL2-1.2/apps/app_mixmonitor.c (original)
+++ team/murf/AEL2-1.2/apps/app_mixmonitor.c Thu Jan 25 12:38:00 2007
@@ -61,7 +61,8 @@
"Valid options:\n"
" a - Append to the file instead of overwriting it.\n"
" b - Only save audio to the file while the channel is bridged.\n"
-" Note: does not include conferences.\n"
+" Note: Does not include conferences or sounds played to each bridged\n"
+" party.\n"
" v(<x>) - Adjust the heard volume by a factor of <x> (range -4 to 4)\n"
" V(<x>) - Adjust the spoken volume by a factor of <x> (range -4 to 4)\n"
" W(<x>) - Adjust the both heard and spoken volumes by a factor of <x>\n"
Modified: team/murf/AEL2-1.2/utils/Makefile
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/utils/Makefile?view=diff&rev=52243&r1=52242&r2=52243
==============================================================================
--- team/murf/AEL2-1.2/utils/Makefile (original)
+++ team/murf/AEL2-1.2/utils/Makefile Thu Jan 25 12:38:00 2007
@@ -20,6 +20,7 @@
CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
endif
+# to get check_expr, add it to the TARGET list
TARGET=stereorize streamplayer aelparse aelparse1
ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/popt.h),)
@@ -55,13 +56,13 @@
$(CC) $(CFLAGS) -o stereorize stereorize.o frame.o -lm
ast_expr2.o: ../ast_expr2.c
- gcc -g -c -o $@ $<
+ gcc -g $(CFLAGS) -c -o $@ $<
ast_expr2f.o: ../ast_expr2f.c
- gcc -g -c -DSTANDALONE -o $@ $<
+ gcc -g $(CFLAGS) -c -DSTANDALONE -o $@ $<
check_expr: check_expr.c ast_expr2.o ast_expr2f.o
- $(CC) $(CFLAGS) -o $@ $^
+ $(CC) $(CFLAGS) -o $@ check_expr.c ast_expr2.o ast_expr2f.o
aelparse : ../pbx/aelflex.o ../pbx/aelbison.o ../pbx/pbx_ael2.o ael_main.o ../ast_expr2f.o ../ast_expr2.o ../pbx/argdesc.tab.o ../pbx/argdesc_lex.o
$(CC) $(CFLAGS) -g -o aelparse ../pbx/aelflex.o ../pbx/aelbison.o ael_main.o ../pbx/pbx_ael2.o ../ast_expr2f.o ../ast_expr2.o ../pbx/argdesc.tab.o ../pbx/argdesc_lex.o
Modified: team/murf/AEL2-1.2/utils/check_expr.c
URL: http://svn.digium.com/view/asterisk/team/murf/AEL2-1.2/utils/check_expr.c?view=diff&rev=52243&r1=52242&r2=52243
==============================================================================
--- team/murf/AEL2-1.2/utils/check_expr.c (original)
+++ team/murf/AEL2-1.2/utils/check_expr.c Thu Jan 25 12:38:00 2007
@@ -23,12 +23,12 @@
#include <stdlib.h>
#include <../include/asterisk/ast_expr.h>
-int global_lineno = 1;
-int global_expr_count = 0;
-int global_expr_max_size = 0;
-int global_expr_tot_size = 0;
-int global_warn_count = 0;
-int global_OK_count = 0;
+static int global_lineno = 1;
+static int global_expr_count=0;
+static int global_expr_max_size=0;
+static int global_expr_tot_size=0;
+static int global_warn_count=0;
+static int global_OK_count=0;
struct varz
{
@@ -54,6 +54,22 @@
fflush(stdout);
va_end(vars);
}
+void ast_register_file_version(const char *file, const char *version);
+void ast_unregister_file_version(const char *file);
+
+char *find_var(const char *varname);
+void set_var(const char *varname, const char *varval);
+unsigned int check_expr(char* buffer, char* error_report);
+int check_eval(char *buffer, char *error_report);
+void parse_file(const char *fname);
+
+void ast_register_file_version(const char *file, const char *version)
+{
+}
+
+void ast_unregister_file_version(const char *file)
+{
+}
char *find_var(const char *varname) /* the list should be pretty short, if there's any list at all */
{
@@ -75,75 +91,79 @@
global_varlist = t;
}
-int check_expr(char *buffer, char *error_report)
-{
- char *cp;
- int oplen = 0;
- int warn_found = 0;
+unsigned int check_expr(char* buffer, char* error_report)
+{
+ char* cp;
+ unsigned int warn_found = 0;
error_report[0] = 0;
- for (cp=buffer;*cp;cp++) {
-
- if (*cp == '|'
- || *cp == '&'
- || *cp == '='
- || *cp == '>'
- || *cp == '<'
- || *cp == '+'
- || *cp == '-'
- || *cp == '*'
- || *cp == '/'
- || *cp == '%'
- || *cp == '?'
- || *cp == ':'
- /* || *cp == '('
- || *cp == ')' These are pretty hard to track, as they are in funcalls, etc. */
- || *cp == '"') {
- if (*cp == '"') {
+ for (cp = buffer; *cp; ++cp)
+ {
+ switch (*cp)
+ {
+ case '"':
/* skip to the other end */
- cp++;
- while (*cp && *cp != '"')
- cp++;
- if (*cp == 0) {
- fprintf(stderr,"Trouble? Unterminated double quote found at line %d\n",
- global_lineno);
- }
- }
- else {
- if ((*cp == '>'||*cp == '<' ||*cp=='!') && (*(cp+1) == '=')) {
- oplen = 2;
- }
- else {
- oplen = 1;
- }
-
- if ((cp > buffer && *(cp-1) != ' ') || *(cp+oplen) != ' ') {
- char tbuf[1000];
- if (oplen == 1)
- sprintf(tbuf,"WARNING: line %d, '%c' operator not separated by spaces. This may lead to confusion. You may wish to use double quotes to quote the grouping it is in. Please check!\n",
- global_lineno, *cp);
- else
- sprintf(tbuf,"WARNING: line %d, '%c%c' operator not separated by spaces. This may lead to confusion. You may wish to use double quotes to quote the grouping it is in. Please check!\n",
- global_lineno, *cp, *(cp+1));
- strcat(error_report,tbuf);
-
- global_warn_count++;
- warn_found++;
- }
- }
- }
- }
+ while (*(++cp) && *cp != '"') ;
+
+ if (*cp == 0)
+ {
+ fprintf(stderr,
+ "Trouble? Unterminated double quote found at line %d\n",
+ global_lineno);
+ }
+ break;
+
+ case '>':
+ case '<':
+ case '!':
+ if ( (*(cp + 1) == '=')
+ && ( ( (cp > buffer) && (*(cp - 1) != ' ') ) || (*(cp + 2) != ' ') ) )
+ {
+ char msg[200];
+ snprintf(msg,
+ sizeof(msg),
+ "WARNING: line %d: '%c%c' operator not separated by spaces. This may lead to confusion. You may wish to use double quotes to quote the grouping it is in. Please check!\n",
+ global_lineno, *cp, *(cp + 1));
+ strcat(error_report, msg);
+ ++global_warn_count;
+ ++warn_found;
+ }
+ break;
+
+ case '|':
+ case '&':
+ case '=':
+ case '+':
+ case '-':
+ case '*':
+ case '/':
+ case '%':
+ case '?':
+ case ':':
+ if ( ( (cp > buffer) && (*(cp - 1) != ' ') ) || (*(cp + 1) != ' ') )
+ {
+ char msg[200];
+ snprintf(msg,
+ sizeof(msg),
+ "WARNING: line %d: '%c' operator not separated by spaces. This may lead to confusion. You may wish to use double quotes to quote the grouping it is in. Please check!\n",
+ global_lineno, *cp );
+ strcat(error_report, msg);
+ ++global_warn_count;
+ ++warn_found;
+ }
+ break;
+ }
+ }
+
return warn_found;
}
int check_eval(char *buffer, char *error_report)
{
- char *cp, *ep, *xp;
+ char *cp, *ep;
char s[4096];
char evalbuf[80000];
- int oplen = 0;
- int warn_found = 0;
int result;
error_report[0] = 0;
@@ -219,7 +239,7 @@
char buffer[30000]; /* I sure hope no expr gets this big! */
if (!f) {
- fprintf(stderr,"Couldn't open %s for reading... need an extensions.conf file to parse!\n");
+ fprintf(stderr,"Couldn't open %s for reading... need an extensions.conf file to parse!\n",fname);
exit(20);
}
if (!l) {
@@ -301,13 +321,23 @@
}
-main(int argc,char **argv)
+int main(int argc,char **argv)
{
int argc1;
char *eq;
if (argc < 2) {
+ printf("check_expr -- a program to look thru extensions.conf files for $[...] expressions,\n");
+ printf(" and run them thru the parser, looking for problems\n");
printf("Hey-- give me a path to an extensions.conf file!\n");
+ printf(" You can also follow the file path with a series of variable decls,\n");
+ printf(" of the form, varname=value, each separated from the next by spaces.\n");
+ printf(" (this might allow you to avoid division by zero messages, check that math\n");
+ printf(" is being done correctly, etc.)\n");
+ printf(" Note that messages about operators not being surrounded by spaces is merely to alert\n");
+ printf(" you to possible problems where you might be expecting those operators as part of a string.\n");
+ printf(" (to include operators in a string, wrap with double quotes!)\n");
+
exit(19);
}
global_varlist = 0;
@@ -321,4 +351,5 @@
/* parse command args for x=y and set varz */
parse_file(argv[1]);
-}
+ return 0;
+}
More information about the asterisk-commits
mailing list