[asterisk-commits] anthonyl: branch anthonyl/7824-patch r43615 -
/team/anthonyl/7824-patch/apps/
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Mon Sep 25 08:14:26 MST 2006
Author: anthonyl
Date: Mon Sep 25 10:14:25 2006
New Revision: 43615
URL: http://svn.digium.com/view/asterisk?rev=43615&view=rev
Log:
applying patch
Modified:
team/anthonyl/7824-patch/apps/app_voicemail.c
Modified: team/anthonyl/7824-patch/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/7824-patch/apps/app_voicemail.c?rev=43615&r1=43614&r2=43615&view=diff
==============================================================================
--- team/anthonyl/7824-patch/apps/app_voicemail.c (original)
+++ team/anthonyl/7824-patch/apps/app_voicemail.c Mon Sep 25 10:14:25 2006
@@ -3377,18 +3377,8 @@
char *fmt, int flag, signed char record_gain)
{
char username[70]="";
- char sys[256];
- char todir[256];
- int todircount=0;
- int duration;
- struct ast_config *mif;
- char miffile[256];
- char fn[256];
- char callerid[512];
- char ext_context[256]="";
int res = 0, cmd = 0;
struct ast_vm_user *receiver = NULL, *extensions = NULL, *vmtmp = NULL, *vmfree;
- char tmp[256];
char *stringp, *s;
int saved_messages = 0, found = 0;
int valid_extensions = 0;
@@ -3523,74 +3513,7 @@
cmd = vm_forwardoptions(chan, sender, dir, curmsg, vmfmts, context, record_gain);
if (!cmd) {
while (!res && vmtmp) {
- /* 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_log(LOG_DEBUG, "%s", sys);
- 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_log(LOG_DEBUG, "%s", sys);
- ast_safe_system(sys);
- }
- snprintf(sys, sizeof(sys), "cp %s/msg%04d.txt %s/msg%04d.txt\n", dir, curmsg, todir, todircount);
- ast_log(LOG_DEBUG, "%s", sys);
- 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))) {
-
- /* 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;
- sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox, chan->cid.cid_num, chan->cid.cid_name, fn, tmp, duration, attach_user_voicemail);
- }
-
- 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);
- }
-
- 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);
saved_messages++;
vmfree = vmtmp;
More information about the asterisk-commits
mailing list