mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 19:43:03 +00:00
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/trunk@164623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2194,7 +2194,6 @@ static int minivm_accmess_exec(struct ast_channel *chan, void *data)
|
|||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
char *argv[2];
|
char *argv[2];
|
||||||
int res = 0;
|
|
||||||
char filename[PATH_MAX];
|
char filename[PATH_MAX];
|
||||||
char tmp[PATH_MAX];
|
char tmp[PATH_MAX];
|
||||||
char *domain;
|
char *domain;
|
||||||
@@ -2236,8 +2235,10 @@ static int minivm_accmess_exec(struct ast_channel *chan, void *data)
|
|||||||
error = TRUE;
|
error = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error)
|
if (error) {
|
||||||
|
pbx_builtin_setvar_helper(chan, "MINIVM_ACCMESS_STATUS", "FAILED");
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
ast_copy_string(tmp, argv[0], sizeof(tmp));
|
ast_copy_string(tmp, argv[0], sizeof(tmp));
|
||||||
username = tmp;
|
username = tmp;
|
||||||
@@ -2248,6 +2249,7 @@ static int minivm_accmess_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
if (ast_strlen_zero(domain) || ast_strlen_zero(username)) {
|
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]);
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2285,10 +2287,10 @@ static int minivm_accmess_exec(struct ast_channel *chan, void *data)
|
|||||||
if(ast_test_flag(vmu, MVM_ALLOCED))
|
if(ast_test_flag(vmu, MVM_ALLOCED))
|
||||||
free_user(vmu);
|
free_user(vmu);
|
||||||
|
|
||||||
|
pbx_builtin_setvar_helper(chan, "MINIVM_NOTIFY_STATUS", "SUCCESS");
|
||||||
|
|
||||||
/* Ok, we're ready to rock and roll. Return to dialplan */
|
/* 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 */
|
/*! \brief Append new mailbox to mailbox list from configuration file */
|
||||||
|
|||||||
Reference in New Issue
Block a user