summaryrefslogtreecommitdiff
path: root/main/pbx.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/pbx.c')
-rw-r--r--main/pbx.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/main/pbx.c b/main/pbx.c
index cfc5f7f9f..b313e0528 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -2823,7 +2823,6 @@ static int pbx_extension_helper(struct ast_channel *c, struct ast_context *con,
struct ast_exten *e;
struct ast_app *app;
char *substitute = NULL;
- int res;
struct pbx_find_info q = { .stacklen = 0 }; /* the rest is reset in pbx_find_extension */
char passdata[EXT_DATA_SIZE];
int matching_action = (action == E_MATCH || action == E_CANMATCH || action == E_MATCHMORE);
@@ -2840,9 +2839,12 @@ static int pbx_extension_helper(struct ast_channel *c, struct ast_context *con,
ast_unlock_contexts();
return -1; /* success, we found it */
} else if (action == E_FINDLABEL) { /* map the label to a priority */
- res = e->priority;
+ int res = e->priority;
+
ast_unlock_contexts();
- return res; /* the priority we were looking for */
+
+ /* the priority we were looking for */
+ return res;
} else { /* spawn */
if (!e->cached_app)
e->cached_app = pbx_findapp(e->app);
@@ -2892,7 +2894,7 @@ static int pbx_extension_helper(struct ast_channel *c, struct ast_context *con,
} else {
if (!q.swo->exec) {
ast_log(LOG_WARNING, "No execution engine for switch %s\n", q.swo->name);
- res = -1;
+ return -1;
}
return q.swo->exec(c, q.foundcontext ? q.foundcontext : context, exten, priority, callerid, q.data);
}
@@ -5256,8 +5258,8 @@ static char *handle_show_hint(struct ast_cli_entry *e, int cmd, struct ast_cli_a
ast_cli(a->fd, "%-20.20s: %-20.20s State:%-15.15s Presence:%-15.15s Watchers %2d\n",
buf,
ast_get_extension_app(hint->exten),
- ast_extension_state2str(hint->laststate),
- ast_presence_state2str(hint->last_presence_state),
+ ast_extension_state2str(hint->laststate),
+ ast_presence_state2str(hint->last_presence_state),
watchers);
num++;
}