Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
f743e2e8
Commit
f743e2e8
authored
7 years ago
by
George Joseph
Committed by
Gerrit Code Review
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge "app_voicemail: IMAP logout on MWI unsubscribe"
parents
2c3c862c
023eede2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/app_voicemail.c
+37
-0
37 additions, 0 deletions
apps/app_voicemail.c
with
37 additions
and
0 deletions
apps/app_voicemail.c
+
37
−
0
View file @
f743e2e8
...
@@ -13106,6 +13106,40 @@ static void mwi_sub_destroy(struct mwi_sub *mwi_sub)
...
@@ -13106,6 +13106,40 @@ static void mwi_sub_destroy(struct mwi_sub *mwi_sub)
ast_free(mwi_sub);
ast_free(mwi_sub);
}
}
#ifdef IMAP_STORAGE
static void imap_logout(const char *mailbox_id)
{
char *context;
char *mailbox;
struct ast_vm_user vmus;
RAII_VAR(struct ast_vm_user *, vmu, NULL, free_user);
struct vm_state *vms = NULL;
if (ast_strlen_zero(mailbox_id)
|| separate_mailbox(ast_strdupa(mailbox_id), &mailbox, &context)) {
return;
}
memset(&vmus, 0, sizeof(vmus));
if (!(vmu = find_user(&vmus, context, mailbox)) || vmu->imapuser[0] == '\0') {
return;
}
vms = get_vm_state_by_imapuser(vmu->imapuser, 0);
if (!vms) {
vms = get_vm_state_by_mailbox(mailbox, context, 0);
}
if (!vms) {
return;
}
vms->mailstream = mail_close(vms->mailstream);
vmstate_delete(vms);
}
#endif
static int handle_unsubscribe(void *datap)
static int handle_unsubscribe(void *datap)
{
{
struct mwi_sub *mwi_sub;
struct mwi_sub *mwi_sub;
...
@@ -13117,6 +13151,9 @@ static int handle_unsubscribe(void *datap)
...
@@ -13117,6 +13151,9 @@ static int handle_unsubscribe(void *datap)
AST_LIST_REMOVE_CURRENT(entry);
AST_LIST_REMOVE_CURRENT(entry);
/* Don't break here since a duplicate uniqueid
/* Don't break here since a duplicate uniqueid
* may have been added as a result of a cache dump. */
* may have been added as a result of a cache dump. */
#ifdef IMAP_STORAGE
imap_logout(mwi_sub->mailbox);
#endif
mwi_sub_destroy(mwi_sub);
mwi_sub_destroy(mwi_sub);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment