mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Handle different contexts (bug #1702)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3423,31 +3423,33 @@ static int append_mailbox(char *context, char *mbox, char *data)
|
|||||||
|
|
||||||
static int vm_box_exists(struct ast_channel *chan, void *data) {
|
static int vm_box_exists(struct ast_channel *chan, void *data) {
|
||||||
struct localuser *u;
|
struct localuser *u;
|
||||||
struct ast_vm_user *vmu;
|
|
||||||
struct ast_vm_user svm;
|
struct ast_vm_user svm;
|
||||||
char *context, *box;
|
char *context, *box;
|
||||||
|
char tmp[256];
|
||||||
|
|
||||||
if (!data || !strlen(data)) {
|
if (!data || !strlen(data)) {
|
||||||
ast_log(LOG_ERROR, "MailboxExists requires an argument: (vmbox[@context])\n");
|
ast_log(LOG_ERROR, "MailboxExists requires an argument: (vmbox[@context])\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
} else {
|
||||||
|
strncpy(tmp, data, sizeof(tmp) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
context = ast_strdupa(data);
|
box = tmp;
|
||||||
if (index(context, '@')) {
|
|
||||||
box = strsep(&context, "@");
|
|
||||||
} else {
|
|
||||||
box = context;
|
|
||||||
context = "default";
|
|
||||||
}
|
|
||||||
while(*box) {
|
while(*box) {
|
||||||
if ((*box != 'u') && (*box != 's') && (*box != 'b'))
|
if ((*box == 's') || (*box == 'b') || (*box == 'u')) {
|
||||||
|
box++;
|
||||||
|
} else
|
||||||
break;
|
break;
|
||||||
box++;
|
|
||||||
}
|
}
|
||||||
vmu = find_user(&svm, context, box);
|
|
||||||
|
|
||||||
if (vmu) {
|
context = strchr(tmp, '@');
|
||||||
|
if (context) {
|
||||||
|
*context = '\0';
|
||||||
|
context++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((!find_user(&svm, context, box))) {
|
||||||
if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->callerid)) {
|
if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->callerid)) {
|
||||||
chan->priority += 100;
|
chan->priority += 100;
|
||||||
} else
|
} else
|
||||||
@@ -3457,7 +3459,6 @@ static int vm_box_exists(struct ast_channel *chan, void *data) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef USEMYSQLVM
|
#ifndef USEMYSQLVM
|
||||||
/* XXX TL Bug 690 */
|
/* XXX TL Bug 690 */
|
||||||
static char show_voicemail_users_help[] =
|
static char show_voicemail_users_help[] =
|
||||||
|
Reference in New Issue
Block a user