[asterisk-commits] kmoore: branch 11 r414859 - in /branches/11: ./ main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 29 13:33:38 CDT 2014


Author: kmoore
Date: Thu May 29 13:33:34 2014
New Revision: 414859

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=414859
Log:
PBX: Prevent incorrect hint parsing

Dynamic and pattern matching hints should not be checked for their last
known state until they are instantiated by subscribers.

(closes issue AFS-56)
Reported by: John Hardin
Patch AFS-56-pbx.diff submitted by Matt Jordan (license 6283)
........

Merged revisions 414813 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/11/   (props changed)
    branches/11/main/pbx.c

Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/11/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/pbx.c?view=diff&rev=414859&r1=414858&r2=414859
==============================================================================
--- branches/11/main/pbx.c (original)
+++ branches/11/main/pbx.c Thu May 29 13:33:34 2014
@@ -5883,12 +5883,18 @@
 		return -1;
 	}
 	hint_new->exten = e;
-	hint_new->laststate = ast_extension_state2(e, NULL);
-	if ((presence_state = extension_presence_state_helper(e, &subtype, &message)) > 0) {
-		hint_new->last_presence_state = presence_state;
-		hint_new->last_presence_subtype = subtype;
-		hint_new->last_presence_message = message;
-		message = subtype = NULL;
+	if (strstr(e->app, "${") && e->exten[0] == '_') {
+		/* The hint is dynamic and hasn't been evaluted yet */
+		hint_new->laststate = AST_DEVICE_INVALID;
+		hint_new->last_presence_state = AST_PRESENCE_INVALID;
+	} else {
+		hint_new->laststate = ast_extension_state2(e, NULL);
+		if ((presence_state = extension_presence_state_helper(e, &subtype, &message)) > 0) {
+			hint_new->last_presence_state = presence_state;
+			hint_new->last_presence_subtype = subtype;
+			hint_new->last_presence_message = message;
+			message = subtype = NULL;
+		}
 	}
 
 	/* Prevent multiple add hints from adding the same hint at the same time. */
@@ -7882,7 +7888,11 @@
 		struct ast_exten *e;
 		struct ast_include *i;
 		struct ast_ignorepat *ip;
+#ifndef LOW_MEMORY
+		char buf[1024], buf2[1024];
+#else
 		char buf[256], buf2[256];
+#endif
 		int context_info_printed = 0;
 
 		if (context && strcmp(ast_get_context_name(c), context))




More information about the asterisk-commits mailing list