Summary:ASTERISK-01679: [Patch] MailboxExists doesn't work
Reporter:connor (connor)Labels:
Date Opened:2004-05-22 22:21:57Date Closed:2008-01-15 14:56:06.000-0600
Versions:Frequency of
Environment:Attachments:( 0) mailboxexists.c.diff.txt
( 1) mailboxexists.c.diff.txt
Description:Portions of the code are flawed..

       while (user) {
               if ((!strcmp(box,user->mailbox)) && (!strcmp(context,user->context))) {
                       branch = 1;

never advanceds the user..  need to add a user=user->next; in it somewhere.


Attached is a patch that fixes the problems, makes it work with SQL voicemail, and handles u,b,s in front of the mailbox # in case someone puts one in by mistake.  This new patch utilizes a already existing function called find_user instead of re-hazing old code.
Comments:By: Mark Spencer (markster) 2004-05-23 00:09:38

Should be fixed in CVS although i just did my own thing.

By: connor (connor) 2004-05-23 00:38:06

okay, Well, using that find_user function would allow it to work with SQL voicemail boxes as well (if the sql voicemail stuff is defined)
no need in re-hashing existing code to do same thing...  I've been running my patch for around 2 or 3 months now with no problems.

By: Mark Spencer (markster) 2004-05-23 00:43:38

(please confirm)

By: Mark Spencer (markster) 2004-05-23 00:54:25

Okay i updated it in CVS to use find_user, but i think if postgres is used, there are memory leaks.

By: connor (connor) 2004-05-23 00:55:18

okay, around line 349 is a find_user for SQL, line 471 is find_user for non SQL.

By: Mark Spencer (markster) 2004-05-23 01:56:17

so is CVS working for you?

By: connor (connor) 2004-05-23 22:33:36

OKay, No cvs didn't work..  vmail context didn't work with patch..  I've cleaned up my patch and re-diffed it agains origcvs.  This patch is confirmed to work on my system.. replaced spaces with tabs (sorry about that).

By: Mark Spencer (markster) 2004-05-24 15:24:43

Fixed in CVS

By: Digium Subversion (svnbot) 2008-01-15 14:56:06.000-0600

Repository: asterisk
Revision: 3060

U   trunk/apps/app_voicemail.c

r3060 | markster | 2008-01-15 14:56:05 -0600 (Tue, 15 Jan 2008) | 2 lines

Handle different contexts (bug ASTERISK-1679)