[asterisk-commits] russell: branch russell/sla_updates r57085 - in /team/russell/sla_updates: ./...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Feb 28 11:14:14 MST 2007


Author: russell
Date: Wed Feb 28 12:14:14 2007
New Revision: 57085

URL: http://svn.digium.com/view/asterisk?view=rev&rev=57085
Log:
Merged revisions 57049,57053,57055 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r57049 | murf | 2007-02-28 11:15:27 -0600 (Wed, 28 Feb 2007) | 1 line

I was surprised that I had not yet downgraded missing goto targets and macro call defs to a warning, in case they are in extensions.conf; I rectified this problem. Also, A goto in a macro to a target in a catch block was not being found; I fixed this too; the cause was that I needed to treat catch statements like an extension in the find_match code.
........
r57053 | file | 2007-02-28 11:45:50 -0600 (Wed, 28 Feb 2007) | 2 lines

Better handle timeouts when the individual speaks after everything has been played but before the timeout ends.

........
r57055 | file | 2007-02-28 11:55:03 -0600 (Wed, 28 Feb 2007) | 2 lines

Picky compiler...

........

Modified:
    team/russell/sla_updates/   (props changed)
    team/russell/sla_updates/apps/app_meetme.c
    team/russell/sla_updates/apps/app_speech_utils.c
    team/russell/sla_updates/pbx/pbx_ael.c

Propchange: team/russell/sla_updates/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Feb 28 12:14:14 2007
@@ -1,1 +1,1 @@
-/branches/1.4:1-57001
+/branches/1.4:1-57084

Modified: team/russell/sla_updates/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/russell/sla_updates/apps/app_meetme.c?view=diff&rev=57085&r1=57084&r2=57085
==============================================================================
--- team/russell/sla_updates/apps/app_meetme.c (original)
+++ team/russell/sla_updates/apps/app_meetme.c Wed Feb 28 12:14:14 2007
@@ -3289,7 +3289,7 @@
 
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&sla.ringing_stations, ringing_station, entry) {
 		struct sla_trunk_ref *s_trunk_ref;
-		struct sla_ringing_trunk *ringing_trunk;
+		struct sla_ringing_trunk *ringing_trunk = NULL;
 		struct run_station_args args;
 		enum ast_dial_result dial_res;
 		pthread_attr_t attr;

Modified: team/russell/sla_updates/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/team/russell/sla_updates/apps/app_speech_utils.c?view=diff&rev=57085&r1=57084&r2=57085
==============================================================================
--- team/russell/sla_updates/apps/app_speech_utils.c (original)
+++ team/russell/sla_updates/apps/app_speech_utils.c Wed Feb 28 12:14:14 2007
@@ -587,7 +587,7 @@
                 }
 
 		/* Do timeout check (shared between audio/dtmf) */
-		if (started == 1) {
+		if (!quieted && started == 1) {
 			time(&current);
 			if ((current-start) >= timeout) {
 				done = 1;
@@ -599,8 +599,9 @@
 
                 /* Do checks on speech structure to see if it's changed */
                 ast_mutex_lock(&speech->lock);
-                if (ast_test_flag(speech, AST_SPEECH_QUIET) && chan->stream != NULL) {
-                        ast_stopstream(chan);
+                if (ast_test_flag(speech, AST_SPEECH_QUIET)) {
+			if (chan->stream)
+				ast_stopstream(chan);
 			ast_clear_flag(speech, AST_SPEECH_QUIET);
 			quieted = 1;
                 }

Modified: team/russell/sla_updates/pbx/pbx_ael.c
URL: http://svn.digium.com/view/asterisk/team/russell/sla_updates/pbx/pbx_ael.c?view=diff&rev=57085&r1=57084&r2=57085
==============================================================================
--- team/russell/sla_updates/pbx/pbx_ael.c (original)
+++ team/russell/sla_updates/pbx/pbx_ael.c Wed Feb 28 12:14:14 2007
@@ -1275,9 +1275,10 @@
 						errs++;
 					}
 				} else {
-					ast_log(LOG_ERROR,"Error: file %s, line %d-%d: goto:  no context %s could be found that matches the goto target!\n",
+					/* here is where code would go to check for target existence in extensions.conf files */
+					ast_log(LOG_WARNING,"Warning: file %s, line %d-%d: goto:  no context %s could be found that matches the goto target!\n",
 							item->filename, item->startline, item->endline, item->u1.list->u1.str);
-					errs++;
+					warns++; /* this is just a warning, because this context could be in extensions.conf or somewhere */
 				}
 			}
 		}
@@ -1556,9 +1557,28 @@
 		           item->u2.statements == pval list of statements in context body
 		*/
 		/* printf("    matching in CATCH\n"); */
-		if ((x=match_pval(item->u2.statements))) {
-			/* printf("CATCH: Responded with pval match %x\n", x); */
-			return x;
+		if (!strcmp(match_exten,"*") || extension_matches(item, match_exten, item->u1.str) ) {
+			/* printf("Descending into matching catch %s => %s\n", match_exten, item->u1.str); */
+			if (strcmp(match_label,"1") == 0) {
+				if (item->u2.statements) {
+					struct pval *p5 = item->u2.statements;
+					while (p5 && p5->type == PV_LABEL)  /* find the first non-label statement in this context. If it exists, there's a "1" */
+						p5 = p5->next;
+					if (p5)
+						return p5;
+					else
+						return 0;
+				}
+				else
+					return 0;
+			}
+
+			if ((x=match_pval(item->u2.statements))) {
+				/* printf("CATCH: Responded with pval match %x\n", (unsigned int)x); */
+				return x;
+			}
+		} else {
+			/* printf("Skipping catch %s\n", item->u1.str); */
 		}
 		break;
 			
@@ -1737,6 +1757,7 @@
 	/* printf("  --- Got args %s, %s\n", exten, label); */
 	struct pval *ret;
 	struct pval *p3;
+	struct pval *startpt = ((curr_cont->type==PV_MACRO)?curr_cont->u3.macro_statements: curr_cont->u2.statements);
 	
 	count_labels = 0;
 	return_on_context_match = 0;
@@ -1750,7 +1771,7 @@
 					
 	/* the target of the goto could be in an included context!! Fancy that!! */
 	/* look for includes in the current context */
-	for (p3=curr_cont->u2.statements; p3; p3=p3->next) {
+	for (p3=startpt; p3; p3=p3->next) {
 		if (p3->type == PV_INCLUDES) {
 			struct pval *p4;
 			for (p4=p3->u1.list; p4; p4=p4->next) {
@@ -1777,19 +1798,25 @@
 	/* printf("  --- Got args %s, %s\n", exten, label); */
 	struct pval *ret;
 	struct pval *p3;
+	struct pval *startpt;
 	
 	count_labels = 0;
 	return_on_context_match = 0;
 	match_context = "*";
 	match_exten = exten;
 	match_label = label;
-	ret =  match_pval(curr_cont->u2.statements);
+	if (curr_cont->type == PV_MACRO)
+		startpt = curr_cont->u3.macro_statements;
+	else
+		startpt = curr_cont->u2.statements;
+
+	ret =  match_pval(startpt);
 	if (ret)
 		return ret;
 					
 	/* the target of the goto could be in an included context!! Fancy that!! */
 	/* look for includes in the current context */
-	for (p3=curr_cont->u2.statements; p3; p3=p3->next) {
+	for (p3=startpt; p3; p3=p3->next) {
 		if (p3->type == PV_INCLUDES) {
 			struct pval *p4;
 			for (p4=p3->u1.list; p4; p4=p4->next) {
@@ -2281,9 +2308,10 @@
 		*/
 		macro_def = find_macro(item->u1.str);
 		if (!macro_def) {
-			ast_log(LOG_ERROR, "Error: file %s, line %d-%d: macro call to non-existent %s !\n",
+			/* here is a good place to check to see if the definition is in extensions.conf! */
+			ast_log(LOG_WARNING, "Error: file %s, line %d-%d: macro call to non-existent %s ! Hopefully it is present in extensions.conf! \n",
 					item->filename, item->startline, item->endline, item->u1.str);
-			errs++;
+			warns++;
 		} else if (macro_def->type != PV_MACRO) {
 			ast_log(LOG_ERROR,"Error: file %s, line %d-%d: macro call to %s references a context, not a macro!\n",
 					item->filename, item->startline, item->endline, item->u1.str);



More information about the asterisk-commits mailing list