]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 164623 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Tue, 16 Dec 2008 15:01:31 +0000 (15:01 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 16 Dec 2008 15:01:31 +0000 (15:01 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
r164623 | russell | 2008-12-16 09:00:27 -0600 (Tue, 16 Dec 2008) | 5 lines

Set MINIVM_ACCMESS_STATUS in all cases.  Also, remove a variable that was not needed.

(closes issue #14081)
Reported by: pkempgen

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@164624 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_minivm.c

index 470c4debf0646ac0ab56bc8c8ab463eb537bf1d4..6dc52f2bbf61de47a3ffefa1140f847c2255e563 100644 (file)
@@ -1962,7 +1962,6 @@ static int minivm_accmess_exec(struct ast_channel *chan, void *data)
 {
        int argc = 0;
        char *argv[2];
-       int res = 0;
        char filename[PATH_MAX];
        char tmp[PATH_MAX];
        char *domain;
@@ -2004,8 +2003,10 @@ static int minivm_accmess_exec(struct ast_channel *chan, void *data)
                error = TRUE;
        }
 
-       if (error)
+       if (error) {
+               pbx_builtin_setvar_helper(chan, "MINIVM_ACCMESS_STATUS", "FAILED");
                return -1;
+       }
 
        ast_copy_string(tmp, argv[0], sizeof(tmp));
        username = tmp;
@@ -2016,6 +2017,7 @@ static int minivm_accmess_exec(struct ast_channel *chan, void *data)
        } 
        if (ast_strlen_zero(domain) || ast_strlen_zero(username)) {
                ast_log(LOG_ERROR, "Need username@domain as argument. Sorry. Argument 0 %s\n", argv[0]);
+               pbx_builtin_setvar_helper(chan, "MINIVM_ACCMESS_STATUS", "FAILED");
                return -1;
        }
 
@@ -2053,10 +2055,10 @@ static int minivm_accmess_exec(struct ast_channel *chan, void *data)
        if(ast_test_flag(vmu, MVM_ALLOCED))
                free_user(vmu);
 
+       pbx_builtin_setvar_helper(chan, "MINIVM_NOTIFY_STATUS", "SUCCESS");
 
        /* Ok, we're ready to rock and roll. Return to dialplan */
-       return res;
-
+       return 0;
 }
 
 /*! \brief Append new mailbox to mailbox list from configuration file */