[Asterisk-cvs] asterisk/apps app_voicemail.c,1.182,1.183
markster at lists.digium.com
markster at lists.digium.com
Tue Dec 21 18:15:51 CST 2004
Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv20543/apps
Modified Files:
app_voicemail.c
Log Message:
display new/old messages in voicemail event (bug #3117)
Index: app_voicemail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -d -r1.182 -r1.183
--- app_voicemail.c 19 Dec 2004 21:13:41 -0000 1.182
+++ app_voicemail.c 21 Dec 2004 23:11:40 -0000 1.183
@@ -2843,6 +2843,7 @@
static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu, int msgnum, long duration, char *fmt, char *cidnum, char *cidname)
{
char todir[256], fn[256], ext_context[256], *stringp;
+ int newmsgs = 0, oldmsgs = 0;
make_dir(todir, sizeof(todir), vmu->context, vmu->mailbox, "INBOX");
make_file(fn, sizeof(fn), todir, msgnum);
@@ -2879,7 +2880,10 @@
}
/* Leave voicemail for someone */
- manager_event(EVENT_FLAG_CALL, "MessageWaiting", "Mailbox: %s@%s\r\nWaiting: %d\r\n", vmu->mailbox, vmu->context, ast_app_has_voicemail(ext_context, NULL));
+ if (ast_app_has_voicemail(ext_context, NULL)) {
+ ast_app_messagecount(ext_context, &newmsgs, &oldmsgs);
+ }
+ manager_event(EVENT_FLAG_CALL, "MessageWaiting", "Mailbox: %s@%s\r\nWaiting: %d\r\nNew: %d\r\nOld: %d\r\n", vmu->mailbox, vmu->context, ast_app_has_voicemail(ext_context, NULL), newmsgs, oldmsgs);
run_externnotify(chan->context, ext_context);
return 0;
}
More information about the svn-commits
mailing list