From 9d1acad76b611cc2400d00da0b60fd75d07d6263 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 9 Aug 2007 17:07:36 +0000 Subject: Fix a problem that I had introduced into MWI handling. I had ignored the mailbox context. Now, all related MWI event dealings pay attention to the context as well. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78747 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_voicemail.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'apps/app_voicemail.c') diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index ae2fa2f94..aba334717 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -3997,15 +3997,17 @@ static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu, static void queue_mwi_event(const char *mbox, int new, int old) { struct ast_event *event; - char *mailbox; + char *mailbox, *context; /* Strip off @default */ - mailbox = ast_strdupa(mbox); - if (strstr(mailbox, "@default")) - mailbox = strsep(&mailbox, "@"); + context = mailbox = ast_strdupa(mbox); + strsep(&context, "@"); + if (ast_strlen_zero(context)) + context = "default"; if (!(event = ast_event_new(AST_EVENT_MWI, AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox, + AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context, AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_UINT, new, AST_EVENT_IE_OLDMSGS, AST_EVENT_IE_PLTYPE_UINT, old, AST_EVENT_IE_END))) { @@ -4014,6 +4016,7 @@ static void queue_mwi_event(const char *mbox, int new, int old) ast_event_queue_and_cache(event, AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, + AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, AST_EVENT_IE_END); } -- cgit v1.2.3