[asterisk-commits] tilghman: branch 1.4 r66770 - in /branches/1.4: ./ apps/app_macro.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu May 31 10:15:12 MST 2007


Author: tilghman
Date: Thu May 31 12:15:09 2007
New Revision: 66770

URL: http://svn.digium.com/view/asterisk?view=rev&rev=66770
Log:
Merged revisions 66744 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r66744 | tilghman | 2007-05-31 10:58:45 -0500 (Thu, 31 May 2007) | 2 lines

Issue 9818 - Fix for issue 8329 breaks pbx_realtime.  Issue 8329 will remain unfixed for pbx_realtime, but only because we lack core API to do it.

........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/apps/app_macro.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_macro.c?view=diff&rev=66770&r1=66769&r2=66770
==============================================================================
--- branches/1.4/apps/app_macro.c (original)
+++ branches/1.4/apps/app_macro.c Thu May 31 12:15:09 2007
@@ -277,22 +277,23 @@
 	while(ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num)) {
 		struct ast_context *c;
 		struct ast_exten *e;
+		runningapp[0] = '\0';
+		runningdata[0] = '\0';
 
 		/* What application will execute? */
 		if (ast_lock_contexts()) {
 			ast_log(LOG_WARNING, "Failed to lock contexts list\n");
-			e = NULL;
 		} else {
 			for (c = ast_walk_contexts(NULL), e = NULL; c; c = ast_walk_contexts(c)) {
 				if (!strcmp(ast_get_context_name(c), chan->context)) {
 					if (ast_lock_context(c)) {
 						ast_log(LOG_WARNING, "Unable to lock context?\n");
-						runningapp[0] = '\0';
-						runningdata[0] = '\0';
 					} else {
 						e = find_matching_priority(c, chan->exten, chan->priority, chan->cid.cid_num);
-						ast_copy_string(runningapp, ast_get_extension_app(e), sizeof(runningapp));
-						ast_copy_string(runningdata, ast_get_extension_app_data(e), sizeof(runningdata));
+						if (e) { /* This will only be undefined for pbx_realtime, which is majorly broken. */
+							ast_copy_string(runningapp, ast_get_extension_app(e), sizeof(runningapp));
+							ast_copy_string(runningdata, ast_get_extension_app_data(e), sizeof(runningdata));
+						}
 						ast_unlock_context(c);
 					}
 					break;



More information about the asterisk-commits mailing list