diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-16 17:54:13 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-16 17:54:13 +0000 |
commit | 3edb01ec6cd9abde82ecf6e94de6cc1185b27d47 (patch) | |
tree | 103f63e4454f91650af4c78684701c69d90cd9de | |
parent | 110d657ddf3f243a2426f6f3d4db2c4484dd4411 (diff) |
Merged revisions 108927 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r108927 | russell | 2008-03-16 12:53:46 -0500 (Sun, 16 Mar 2008) | 7 lines
Fix polling for mailbox changes in mailboxes that are not in the default vm context.
(closes issue #12223)
Reported by: DEA
Patches:
vm-polled-imap.txt uploaded by DEA (license 3)
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@108928 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | apps/app_voicemail.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 2988fca24..2a4f496b7 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -7999,6 +7999,7 @@ static void mwi_unsub_event_cb(const struct ast_event *event, void *userdata) static void mwi_sub_event_cb(const struct ast_event *event, void *userdata) { const char *mailbox; + const char *context; uint32_t uniqueid; unsigned int len; struct mwi_sub *mwi_sub; @@ -8010,12 +8011,16 @@ static void mwi_sub_event_cb(const struct ast_event *event, void *userdata) return; mailbox = ast_event_get_ie_str(event, AST_EVENT_IE_MAILBOX); + context = ast_event_get_ie_str(event, AST_EVENT_IE_CONTEXT); uniqueid = ast_event_get_ie_uint(event, AST_EVENT_IE_UNIQUEID); len = sizeof(*mwi_sub); if (!ast_strlen_zero(mailbox)) len += strlen(mailbox); + if (!ast_strlen_zero(context)) + len += strlen(context) + 1; /* Allow for seperator */ + if (!(mwi_sub = ast_calloc(1, len))) return; @@ -8023,6 +8028,11 @@ static void mwi_sub_event_cb(const struct ast_event *event, void *userdata) if (!ast_strlen_zero(mailbox)) strcpy(mwi_sub->mailbox, mailbox); + if (!ast_strlen_zero(context)) { + strcat(mwi_sub->mailbox, "@"); + strcat(mwi_sub->mailbox, context); + } + AST_RWLIST_WRLOCK(&mwi_subs); AST_RWLIST_INSERT_TAIL(&mwi_subs, mwi_sub, entry); AST_RWLIST_UNLOCK(&mwi_subs); |