[asterisk-commits] tilghman: trunk r43641 - in /trunk: ./ apps/app_voicemail.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Sep 25 15:06:27 MST 2006


Author: tilghman
Date: Mon Sep 25 17:06:26 2006
New Revision: 43641

URL: http://svn.digium.com/view/asterisk?rev=43641&view=rev
Log:
Merged revisions 43640 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r43640 | tilghman | 2006-09-25 17:04:47 -0500 (Mon, 25 Sep 2006) | 12 lines

Merged revisions 43634 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43634 | tilghman | 2006-09-25 16:14:41 -0500 (Mon, 25 Sep 2006) | 4 lines

Two bugs when forwarding voicemail (Issue 7824):
1) delete=yes was ignored
2) maxmessages was ignored

........

................

Modified:
    trunk/   (props changed)
    trunk/apps/app_voicemail.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-1.4-merged (original)
+++ branch-1.4-merged Mon Sep 25 17:06:26 2006
@@ -1,1 +1,1 @@
-/branches/1.4:1-43376,43383,43386,43388,43392,43396,43405,43410,43422,43441,43445,43450,43454,43456,43464,43466,43469,43477,43482,43486,43489,43492,43518,43524,43553,43564,43616
+/branches/1.4:1-43376,43383,43386,43388,43392,43396,43405,43410,43422,43441,43445,43450,43454,43456,43464,43466,43469,43477,43482,43486,43489,43492,43518,43524,43553,43564,43616,43640

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?rev=43641&r1=43640&r2=43641&view=diff
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Mon Sep 25 17:06:26 2006
@@ -3784,19 +3784,8 @@
 	BODY *body;
 	char *header_content;
 	char *temp;
-#else
-	struct ast_config *mif;
-	char sys[256];
-	char miffile[256];
-	char callerid[512];
-	char tmp[256];
-	char ext_context[256]="";
 #endif
 	char username[70]="";
-	char todir[256];
-	int todircount=0;
-	int duration;
-	char fn[256];
 	int res = 0, cmd = 0;
 	struct ast_vm_user *receiver = NULL, *vmtmp;
 	AST_LIST_HEAD_NOLOCK_STATIC(extensions, ast_vm_user);
@@ -3993,74 +3982,7 @@
  				/* NULL category for IMAP storage */
  				sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox, chan->cid.cid_num, chan->cid.cid_name, fn, fmt, duration, attach_user_voicemail, chan, NULL);
 #else
-
-				/* if (ast_play_and_wait(chan, "vm-savedto"))
-					break;
-				*/
-				snprintf(todir, sizeof(todir), "%s%s/%s/INBOX", VM_SPOOL_DIR, vmtmp->context, vmtmp->mailbox);
-				snprintf(sys, sizeof(sys), "mkdir -p %s\n", todir);
-				snprintf(ext_context, sizeof(ext_context), "%s@%s", vmtmp->mailbox, vmtmp->context);
-				ast_safe_system(sys);
-		
-				res = count_messages(receiver, todir);
-
-				if ( (res == ERROR_LOCK_PATH) || (res < 0) ) {
-					if (res == ERROR_LOCK_PATH)
-						ast_log(LOG_WARNING, "Unable to lock the directory %s to forward the requested vmail msg!\n", todir);
-					else
-						ast_log(LOG_WARNING, "Unable to determine how many msgs are in the destination folder!\n");
-					break;
-				}
-				todircount = res;
-				ast_copy_string(tmp, fmt, sizeof(tmp));
-				stringp = tmp;
-				while ((s = strsep(&stringp, "|"))) {
-					/* XXX This is a hack -- we should use build_filename or similar XXX */
-					if (!strcasecmp(s, "wav49"))
-						s = "WAV";
-					snprintf(sys, sizeof(sys), "cp %s/msg%04d.%s %s/msg%04d.%s\n", dir, curmsg, s, todir, todircount, s);
-					ast_safe_system(sys);
-				}
-				snprintf(sys, sizeof(sys), "cp %s/msg%04d.txt %s/msg%04d.txt\n", dir, curmsg, todir, todircount);
-				ast_safe_system(sys);
-				snprintf(fn, sizeof(fn), "%s/msg%04d", todir,todircount);
-
-				STORE(todir, vmtmp->mailbox, vmtmp->context, todircount);
-	
-				/* load the information on the source message so we can send an e-mail like a new message */
-				snprintf(miffile, sizeof(miffile), "%s/msg%04d.txt", dir, curmsg);
-				if ((mif=ast_config_load(miffile))) {
-					const char *category = ast_variable_retrieve(mif, NULL, "category");
-
-					/* set callerid and duration variables */
-					snprintf(callerid, sizeof(callerid), "FWD from: %s from %s", sender->fullname, ast_variable_retrieve(mif, NULL, "callerid"));
-					s = ast_variable_retrieve(mif, NULL, "duration");
-					if (s)
-						duration = atoi(s);
-					else
-						duration = 0;
-					if (!ast_strlen_zero(vmtmp->email)) {
-						int attach_user_voicemail = ast_test_flag((&globalflags), VM_ATTACH);
-						char *myserveremail = serveremail;
-						attach_user_voicemail = ast_test_flag(vmtmp, VM_ATTACH);
-						if (!ast_strlen_zero(vmtmp->serveremail))
-							myserveremail = vmtmp->serveremail;
-						/*XXX POSSIBLE ISSUE FOR IMAP STORAGE but no idea how its an else statement XXX*/
-						sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox, chan->cid.cid_num, chan->cid.cid_name, fn, tmp, duration, attach_user_voicemail, chan, category);
-					}
-
-					if (!ast_strlen_zero(vmtmp->pager)) {
-						char *myserveremail = serveremail;
-						if (!ast_strlen_zero(vmtmp->serveremail))
-							myserveremail = vmtmp->serveremail;
-						sendpage(myserveremail, vmtmp->pager, todircount, vmtmp->context, vmtmp->mailbox, chan->cid.cid_num, chan->cid.cid_name, duration, vmtmp, category);
-					}
-
-					ast_config_destroy(mif); /* or here */
-				}
-				/* Leave voicemail for someone */
-				manager_event(EVENT_FLAG_CALL, "MessageWaiting", "Mailbox: %s\r\nWaiting: %d\r\n", ext_context, has_voicemail(ext_context, NULL));
-				run_externnotify(vmtmp->context, vmtmp->mailbox);
+				copy_message(chan, sender, 0, curmsg, 0, vmtmp, fmt);
 #endif
 				saved_messages++;
 				AST_LIST_REMOVE_CURRENT(&extensions, list);



More information about the asterisk-commits mailing list