[asterisk-commits] mmichelson: branch mmichelson/imap_consistency_trunk r135591 - /team/mmichels...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Aug 4 17:04:29 CDT 2008
Author: mmichelson
Date: Mon Aug 4 17:04:28 2008
New Revision: 135591
URL: http://svn.digium.com/view/asterisk?view=rev&rev=135591
Log:
Only play the message saved file once if using IMAP storage.
Remove a bunch of debug messages
Modified:
team/mmichelson/imap_consistency_trunk/apps/app_voicemail.c
Modified: team/mmichelson/imap_consistency_trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/imap_consistency_trunk/apps/app_voicemail.c?view=diff&rev=135591&r1=135590&r2=135591
==============================================================================
--- team/mmichelson/imap_consistency_trunk/apps/app_voicemail.c (original)
+++ team/mmichelson/imap_consistency_trunk/apps/app_voicemail.c Mon Aug 4 17:04:28 2008
@@ -1460,8 +1460,6 @@
make_file(vms->fn, sizeof(vms->fn), dir, msgnum);
snprintf(vms->introfn, sizeof(vms->introfn), "%sintro\n", vms->fn);
- ast_log(LOG_NOTICE, "The filenames are %s and %s\n", vms->fn, vms->introfn);
-
/* Don't try to retrieve a message from IMAP if it already is on the file system */
if (ast_fileexists(vms->fn, NULL, NULL) > 0) {
res = 0;
@@ -1509,9 +1507,6 @@
if (save_body(body, vms, "3", attachedfilefmt, 1)) {
*vms->introfn = '\0';
}
-
- ast_log(LOG_NOTICE, "Now the filenames are %s and %s\n", vms->fn, vms->introfn);
- ast_log(LOG_NOTICE, "BREAKPOINT!!!\n");
/* Get info from headers!! */
snprintf(text_file, sizeof(text_file), "%s.%s", vms->fn, "txt");
@@ -1778,8 +1773,6 @@
imap_delete_old_greeting(fn, vms);
}
- ast_log(LOG_NOTICE, "I'm to be storing the following files: %s(%s) and %s(%s) to mailbox %s\n", fn, ast_fileexists(fn, NULL, NULL) > 0 ? "Exists" : "Don't Exists", introfn, ast_fileexists(introfn, NULL, NULL) > 0 ? "Exists" : "Ain't Exists", vmu->mailbox);
-
make_email_file(p, myserveremail, vmu, msgnum, vmu->context, vmu->mailbox, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL), fn, introfn, fmt, duration, 1, chan, NULL, 1, flag);
/* read mail file to memory */
len = ftell(p);
@@ -2623,7 +2616,6 @@
if (!newlen) {
return -1;
}
- ast_log(LOG_NOTICE, "Hey, I found something and will be writing it to %s.%s\n", fn, format);
write_file(filename, (char *) body_decoded, newlen);
} else {
ast_debug(5, "Body of message is NULL.\n");
@@ -5767,14 +5759,11 @@
#ifdef IMAP_STORAGE
/* Record new intro file */
- ast_log(LOG_NOTICE, "msgfile is %s and textfile is %s\n", msgfile, textfile);
make_file(vms->introfn, sizeof(vms->introfn), curdir, curmsg);
strncat(vms->introfn, "intro", sizeof(vms->introfn));
res = ast_play_and_wait(chan, INTRO);
res = ast_play_and_wait(chan, "beep");
res = play_record_review(chan, NULL, vms->introfn, vmu->maxsecs, vmfmts, 1, vmu, (int *)duration, NULL, record_gain, vms, flag);
- ast_log(LOG_NOTICE, "I believe I just recorded an intro...%s\n", vms->introfn);
- ast_log(LOG_NOTICE, "btw, the address of vms is %p\n", vms);
cmd = 't';
#else
@@ -5828,7 +5817,6 @@
case '2':
/* NULL out introfile so we know there is no intro! */
*vms->introfn = '\0';
- ast_log(LOG_NOTICE, "I just nulled out the vms->introfn for some reason...\n");
cmd = 't';
break;
case '*':
@@ -6193,7 +6181,6 @@
myserveremail = vmtmp->serveremail;
attach_user_voicemail = ast_test_flag(vmtmp, VM_ATTACH);
/* NULL category for IMAP storage */
- ast_log(LOG_NOTICE, "Sanity check, the files are %s(%s) and %s(%s)\n", vmstmp.fn, ast_fileexists(vmstmp.fn, NULL, NULL) > 0 ? "Exists!" : "Nonexistent!", vmstmp.introfn, ast_fileexists(vmstmp.introfn, NULL, NULL) > 0 ? "Exists!" : "Nonexistent!");
sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL), vmstmp.fn, vmstmp.introfn, fmt, duration, attach_user_voicemail, chan, NULL, urgent_str);
#else
copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt, dir, urgent_str);
@@ -6214,9 +6201,10 @@
res = ast_play_and_wait(chan, "vm-messages");
if (!res)
res = ast_play_and_wait(chan, "vm-saved"); */
-
+#ifndef IMAP_STORAGE
/* If forwarded with intro, DON'T PLAY THIS MESSAGE AGAIN! */
res = ast_play_and_wait(chan, "vm-msgsaved");
+#endif
}
}
}
@@ -6565,12 +6553,10 @@
* as a separate file from the rest of the message
*/
if (!ast_strlen_zero(vms->introfn)) {
- ast_log(LOG_NOTICE, "Gonna play intro %s\n", vms->introfn);
wait_file(chan, vms, vms->introfn);
}
#endif
if ((res = wait_file(chan, vms, vms->fn)) < 0) {
- ast_log(LOG_NOTICE, "Glonna play %s\n", vms->fn);
ast_log(AST_LOG_WARNING, "Playback of message %s failed\n", vms->fn);
res = 0;
}
@@ -6593,7 +6579,6 @@
ast_copy_string(fn, dir, sizeof(fn));
if ((msgnum < 0 && imapgreetings) || msgnum > -1) {
- ast_log(LOG_NOTICE, "Disposing of file %s and %s.txt\n", fn, fn);
ast_filedelete(fn, NULL);
snprintf(full_fn, sizeof(full_fn), "%s.txt", fn);
unlink(full_fn);
More information about the asterisk-commits
mailing list