]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 23 Apr 2008 22:15:07 +0000 (22:15 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 23 Apr 2008 22:15:07 +0000 (22:15 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8185 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_console.c

index 11f52518bee801e518e61e3add171f599889ed91..e6eedd6a81200b5f1b4de805b3fbdc2a80faeddd 100644 (file)
@@ -168,8 +168,10 @@ char *expand_alias(char *cmd, char *arg)
        char *sql;
        char *exp = NULL;
        switch_core_db_t *db = switch_core_db_handle();
+       int full = 0;
        
-       sql = switch_mprintf("select command from aliases where alias='%q' or alias='%q %q'", cmd, cmd, arg);
+       sql = switch_mprintf("select command from aliases where alias='%q'", cmd);
+
        switch_core_db_exec(db, sql, alias_callback, &r, &errmsg);
 
        if (errmsg) {
@@ -177,8 +179,23 @@ char *expand_alias(char *cmd, char *arg)
                free(errmsg);
        }
 
+       if (!r) {
+               sql = switch_mprintf("select command from aliases where alias='%q %q'", cmd, arg);
+               
+               switch_core_db_exec(db, sql, alias_callback, &r, &errmsg);
+               
+               if (errmsg) {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error [%s][%s]\n", sql, errmsg);
+                       free(errmsg);
+               }
+               if (r) {
+                       full++;
+               }
+       }
+
+
        if (r) {
-               if (arg) {
+               if (arg && !full) {
                        exp = switch_mprintf("%s %s", r, arg);
                        free(r);
                } else {