aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-31 15:58:45 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-31 15:58:45 +0000
commit7945b5def287dd93b91d526aaa48d407dcfb49ad (patch)
tree141cb1dad9de6d28b6745a0e10475d9f381cf2c4 /apps
parent38980142a4bec113ad225288a75f7358bc1e0780 (diff)
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/branches/1.2@66744 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_macro.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/app_macro.c b/apps/app_macro.c
index 75c2e3cf1..4002a8b00 100644
--- a/apps/app_macro.c
+++ b/apps/app_macro.c
@@ -266,22 +266,23 @@ static int macro_exec(struct ast_channel *chan, void *data)
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;