diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-05-23 05:07:43 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-05-23 05:07:43 +0000 |
commit | 88701eb576868c29572aa4b766ac718763fed7d2 (patch) | |
tree | c0cd9d0c39ce95a27ab2cf8f9013de6de3a6925d /apps | |
parent | 81195806113e27481fb59dd14f0d06ec44b155c3 (diff) |
Use find_user for existsmailbox
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3044 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-x | apps/app_voicemail.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index c0c3d06ec..c30085ed1 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -3423,7 +3423,8 @@ static int append_mailbox(char *context, char *mbox, char *data) static int vm_box_exists(struct ast_channel *chan, void *data) { struct localuser *u; - struct ast_vm_user *user; + struct ast_vm_user *vmu; + struct ast_vm_user svm; char *context, *box; int branch=0; @@ -3445,18 +3446,9 @@ static int vm_box_exists(struct ast_channel *chan, void *data) { break; box++; } - ast_mutex_lock(&vmlock); - user = users; - while (user) { - if ((!strcmp(box,user->mailbox)) && (!strcmp(context,user->context))) { - branch = 1; - break; - } - user = user->next; - } - ast_mutex_unlock(&vmlock); + vmu = find_user(&svm, context, box); - if (branch) { + if (vmu) { if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->callerid)) { chan->priority += 100; } else |