summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorAutomerge script <automerge@asterisk.org>2012-11-12 21:20:14 +0000
committerAutomerge script <automerge@asterisk.org>2012-11-12 21:20:14 +0000
commit69ae9ff20d866ad02cc86e9b08da85ee2b15390b (patch)
tree37319f592d386de4d68b34e81ad0dc2a9ef1ba3a /main
parent426e8d145437b44e5e8ba0adbde19eae94d906e1 (diff)
Merged revisions 376148,376169 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk ................ r376148 | elguero | 2012-11-12 14:18:47 -0600 (Mon, 12 Nov 2012) | 26 lines Fix Dynamic Hints Variable Substition - Underscore Problem When adding a dynamic hint, if an extension contains an underscore no variable subsitution is being performed. This patch changes from checking if the extension contains an underscore to checking if the extension begins with an underscore. (closes issue ASTERISK-20639) Reported by: Steven T. Wheeler Tested by: Steven T. Wheeler, Michael L. Young Patches: asterisk-20639-dynamic-hint-underscore.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2188/ ........ Merged revisions 376142 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 376143 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 376144 from http://svn.asterisk.org/svn/asterisk/branches/11 ................ r376169 | file | 2012-11-12 14:46:51 -0600 (Mon, 12 Nov 2012) | 20 lines Properly check if the "Context" and "Extension" headers are empty in a ShowDialPlan action. The code which handles the ShowDialPlan action wrongly assumed that a non-NULL return value from the function which retrieves headers from an action indicates that the header has a value. This is incorrect and the contents must be checked to see if they are blank. (closes issue ASTERISK-20628) Reported by: jkroon Patches: asterisk-showdialplan-incorrect-error.patch uploaded by jkroon ........ Merged revisions 376166 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 376167 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 376168 from http://svn.asterisk.org/svn/asterisk/branches/11 ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@376176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/pbx.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/main/pbx.c b/main/pbx.c
index ba66fcac5..19b284c83 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -7891,17 +7891,17 @@ static int manager_show_dialplan(struct mansession *s, const struct message *m)
manager_show_dialplan_helper(s, m, idtext, context, exten, &counters, NULL);
- if (context && !counters.context_existence) {
+ if (!ast_strlen_zero(context) && !counters.context_existence) {
char errorbuf[BUFSIZ];
snprintf(errorbuf, sizeof(errorbuf), "Did not find context %s", context);
astman_send_error(s, m, errorbuf);
return 0;
}
- if (exten && !counters.extension_existence) {
+ if (!ast_strlen_zero(exten) && !counters.extension_existence) {
char errorbuf[BUFSIZ];
- if (context)
+ if (!ast_strlen_zero(context))
snprintf(errorbuf, sizeof(errorbuf), "Did not find extension %s@%s", exten, context);
else
snprintf(errorbuf, sizeof(errorbuf), "Did not find extension %s in any context", exten);
@@ -7909,6 +7909,10 @@ static int manager_show_dialplan(struct mansession *s, const struct message *m)
return 0;
}
+ if (!counters.total_items) {
+ manager_dpsendack(s, m);
+ }
+
astman_append(s, "Event: ShowDialPlanComplete\r\n"
"EventList: Complete\r\n"
"ListItems: %d\r\n"
@@ -9566,7 +9570,7 @@ static int ast_add_extension2_lockopt(struct ast_context *con,
}
/* If we are adding a hint evalulate in variables and global variables */
- if (priority == PRIORITY_HINT && strstr(application, "${") && !strstr(extension, "_")) {
+ if (priority == PRIORITY_HINT && strstr(application, "${") && extension[0] != '_') {
struct ast_channel *c = ast_dummy_channel_alloc();
if (c) {