]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 376148,376169 via svnmerge from
authorAutomerge script <automerge@asterisk.org>
Mon, 12 Nov 2012 21:20:14 +0000 (21:20 +0000)
committerAutomerge script <automerge@asterisk.org>
Mon, 12 Nov 2012 21:20:14 +0000 (21:20 +0000)
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

main/pbx.c

index ba66fcac57f9bbaaece4029109f3fb62292cce3d..19b284c83f3e83ddf0a69cad00a2bc5d07bbd358 100644 (file)
@@ -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) {