aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_voicemail2.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_voicemail2.c')
-rwxr-xr-xapps/app_voicemail2.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/app_voicemail2.c b/apps/app_voicemail2.c
index e56b63487..1a46481d9 100755
--- a/apps/app_voicemail2.c
+++ b/apps/app_voicemail2.c
@@ -127,6 +127,7 @@ static char *app2 = "VoiceMailMain2";
static pthread_mutex_t vmlock = AST_MUTEX_INITIALIZER;
struct ast_vm_user *users;
+struct ast_vm_user *usersl;
static int attach_voicemail;
static int maxsilence;
static int silencethreshold;
@@ -2176,8 +2177,12 @@ static int append_mailbox(char *context, char *mbox, char *data)
strncpy(vmu->email, s, sizeof(vmu->email));
if ((s = strsep(&stringp, ",")))
strncpy(vmu->pager, s, sizeof(vmu->pager));
- vmu->next = users;
- users = vmu;
+ vmu->next = NULL;
+ if (usersl)
+ usersl->next = vmu;
+ else
+ users = vmu;
+ usersl = vmu;
}
return 0;
}
@@ -2204,6 +2209,7 @@ static int load_users(void)
free_user(l);
}
users = NULL;
+ usersl = NULL;
if (cfg) {
/* General settings */
attach_voicemail = 1;