[asterisk-commits] russell: trunk r108927 - /trunk/apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Mar 16 12:53:47 CDT 2008


Author: russell
Date: Sun Mar 16 12:53:46 2008
New Revision: 108927

URL: http://svn.digium.com/view/asterisk?view=rev&rev=108927
Log:
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)

Modified:
    trunk/apps/app_voicemail.c

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=108927&r1=108926&r2=108927
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Sun Mar 16 12:53:46 2008
@@ -8017,6 +8017,7 @@
 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;
@@ -8028,18 +8029,27 @@
 		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;
 
 	mwi_sub->uniqueid = uniqueid;
 	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);




More information about the asterisk-commits mailing list