aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-11 01:30:10 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-11 01:30:10 +0000
commit82f45d616dd86f613946b2075f64a6561bc0381d (patch)
treea03845c71a4ae8db0e8ba06bbb8c943131c69e23 /apps
parent00fed0037aa6a412e4b96b0560ed767325ebb08a (diff)
Bug 6192 - behave correctly when mailbox is specified as argument
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@7955 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 9fc5bb1cc..9c047548f 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -5645,10 +5645,10 @@ static int vm_box_exists(struct ast_channel *chan, void *data)
static int vmauthenticate(struct ast_channel *chan, void *data)
{
struct localuser *u;
- char *s = data, *user=NULL, *context=NULL, mailbox[AST_MAX_EXTENSION];
+ char *s = data, *user=NULL, *context=NULL, mailbox[AST_MAX_EXTENSION] = "";
struct ast_vm_user vmus;
char *options = NULL;
- int silent = 0;
+ int silent = 0, skipuser = 0;
int res = -1;
LOCAL_USER_ADD(u);
@@ -5665,6 +5665,9 @@ static int vmauthenticate(struct ast_channel *chan, void *data)
s = user;
user = strsep(&s, "@");
context = strsep(&s, "");
+ if (!ast_strlen_zero(user))
+ skipuser++;
+ ast_copy_string(mailbox, user, sizeof(mailbox));
}
}
@@ -5672,9 +5675,10 @@ static int vmauthenticate(struct ast_channel *chan, void *data)
silent = (strchr(options, 's')) != NULL;
}
- if (!vm_authenticate(chan, mailbox, sizeof(mailbox), &vmus, context, NULL, 0, 3, silent)) {
+ if (!vm_authenticate(chan, mailbox, sizeof(mailbox), &vmus, context, NULL, skipuser, 3, silent)) {
pbx_builtin_setvar_helper(chan, "AUTH_MAILBOX", mailbox);
pbx_builtin_setvar_helper(chan, "AUTH_CONTEXT", vmus.context);
+ ast_play_and_wait(chan, "auth-thankyou");
res = 0;
}