diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-05-31 17:16:38 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-05-31 17:16:38 +0000 |
commit | bfd11fcd7e8eb4a6ad0eb07d0a6fc8b35ac06268 (patch) | |
tree | cc8f910755e8bcc344d28be5d201963586763d92 /apps/app_macro.c | |
parent | efb9fda1000fd8c33fe3a4a41c238391ee222042 (diff) |
Merged revisions 66770 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r66770 | tilghman | 2007-05-31 12:15:09 -0500 (Thu, 31 May 2007) | 10 lines
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.
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@66771 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_macro.c')
-rw-r--r-- | apps/app_macro.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/app_macro.c b/apps/app_macro.c index 773e9af07..625c4543f 100644 --- a/apps/app_macro.c +++ b/apps/app_macro.c @@ -280,22 +280,23 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) 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_rdlock_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_rdlock_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; |