--- app_minivm.c.orig 2008-11-25 16:01:28.000000000 -0500 +++ app_minivm.c.new 2008-11-25 16:01:04.000000000 -0500 @@ -286,7 +286,7 @@ This application is part of the Mini-Voicemail system, configured in minivm.conf. MiniVMnotify forwards messages about new voicemail to e-mail and pager. If there's no user account for that address, a temporary account will be used with default options (set in minivm.conf). - If the channel variable MVM_COUNTER is set, this will be used in the message file name and available in the template for the message. + If the channel variable MINIVM_COUNTER is set, this will be used in the message file name and available in the template for the message. If no template is given, the default email template will be used to send email and default pager template to send paging message (if the user account is configured with a paging address. @@ -309,7 +309,7 @@ This application is part of the Mini-Voicemail system, configured in minivm.conf. - It deletes voicemail file set in MVM_FILENAME or given filename. + It deletes voicemail file set in MINIVM_FILENAME or given filename. This is the status of the delete operation. @@ -641,7 +641,7 @@ ast_copy_string(template->name, name, sizeof(template->name)); ast_copy_string(template->dateformat, DEFAULT_DATEFORMAT, sizeof(template->dateformat)); ast_copy_string(template->charset, DEFAULT_CHARSET, sizeof(template->charset)); - ast_copy_string(template->subject, "New message in mailbox ${MVM_USERNAME}@${MVM_DOMAIN}", sizeof(template->subject)); + ast_copy_string(template->subject, "New message in mailbox ${MINIVM_USERNAME}@${MINIVM_DOMAIN}", sizeof(template->subject)); template->attachment = TRUE; return template; @@ -912,16 +912,16 @@ } /* Prepare variables for substition in email body and subject */ - pbx_builtin_setvar_helper(channel, "MVM_NAME", vmu->fullname); - pbx_builtin_setvar_helper(channel, "MVM_DUR", dur); - pbx_builtin_setvar_helper(channel, "MVM_DOMAIN", vmu->domain); - pbx_builtin_setvar_helper(channel, "MVM_USERNAME", vmu->username); - pbx_builtin_setvar_helper(channel, "MVM_CALLERID", ast_callerid_merge(callerid, sizeof(callerid), cidname, cidnum, "Unknown Caller")); - pbx_builtin_setvar_helper(channel, "MVM_CIDNAME", (cidname ? cidname : "an unknown caller")); - pbx_builtin_setvar_helper(channel, "MVM_CIDNUM", (cidnum ? cidnum : "an unknown caller")); - pbx_builtin_setvar_helper(channel, "MVM_DATE", date); + pbx_builtin_setvar_helper(channel, "MINIVM_NAME", vmu->fullname); + pbx_builtin_setvar_helper(channel, "MINIVM_DUR", dur); + pbx_builtin_setvar_helper(channel, "MINIVM_DOMAIN", vmu->domain); + pbx_builtin_setvar_helper(channel, "MINIVM_USERNAME", vmu->username); + pbx_builtin_setvar_helper(channel, "MINIVM_CALLERID", ast_callerid_merge(callerid, sizeof(callerid), cidname, cidnum, "Unknown Caller")); + pbx_builtin_setvar_helper(channel, "MINIVM_CIDNAME", (cidname ? cidname : "an unknown caller")); + pbx_builtin_setvar_helper(channel, "MINIVM_CIDNUM", (cidnum ? cidnum : "an unknown caller")); + pbx_builtin_setvar_helper(channel, "MINIVM_DATE", date); if (!ast_strlen_zero(counter)) - pbx_builtin_setvar_helper(channel, "MVM_COUNTER", counter); + pbx_builtin_setvar_helper(channel, "MINIVM_COUNTER", counter); } /*! \brief Set default values for Mini-Voicemail users */ @@ -1425,6 +1425,11 @@ while ((cmd >= 0) && (cmd != 't')) { switch (cmd) { + case '1': + ast_verb(3, "Saving message as is\n"); + ast_stream_and_wait(chan, "vm-msgsaved", ""); + cmd = 't'; + break; case '2': /* Review */ ast_verb(3, "Reviewing the message\n"); @@ -1584,15 +1589,15 @@ /* Read counter if available */ ast_channel_lock(chan); - if ((counter = pbx_builtin_getvar_helper(chan, "MVM_COUNTER"))) { + if ((counter = pbx_builtin_getvar_helper(chan, "MINIVM_COUNTER"))) { counter = ast_strdupa(counter); } ast_channel_unlock(chan); if (ast_strlen_zero(counter)) { - ast_debug(2, "-_-_- MVM_COUNTER not found\n"); + ast_debug(2, "-_-_- MINIVM_COUNTER not found\n"); } else { - ast_debug(2, "-_-_- MVM_COUNTER found - will use it with value %s\n", counter); + ast_debug(2, "-_-_- MINIVM_COUNTER found - will use it with value %s\n", counter); } res = sendmail(etemplate, vmu, cidnum, cidname, filename, messageformat, duration, etemplate->attachment, MVM_MESSAGE_EMAIL, counter); @@ -1762,10 +1767,10 @@ } /* Set channel variables for the notify application */ - pbx_builtin_setvar_helper(chan, "MVM_FILENAME", tmptxtfile); + pbx_builtin_setvar_helper(chan, "MINIVM_FILENAME", tmptxtfile); snprintf(timebuf, sizeof(timebuf), "%d", duration); - pbx_builtin_setvar_helper(chan, "MVM_DURATION", timebuf); - pbx_builtin_setvar_helper(chan, "MVM_FORMAT", fmt); + pbx_builtin_setvar_helper(chan, "MINIVM_DURATION", timebuf); + pbx_builtin_setvar_helper(chan, "MINIVM_FORMAT", fmt); } global_stats.lastreceived = ast_tvnow(); @@ -1905,17 +1910,17 @@ } ast_channel_lock(chan); - if ((filename = pbx_builtin_getvar_helper(chan, "MVM_FILENAME"))) { + if ((filename = pbx_builtin_getvar_helper(chan, "MINIVM_FILENAME"))) { filename = ast_strdupa(filename); } ast_channel_unlock(chan); /* Notify of new message to e-mail and pager */ if (!ast_strlen_zero(filename)) { ast_channel_lock(chan); - if ((format = pbx_builtin_getvar_helper(chan, "MVM_FORMAT"))) { + if ((format = pbx_builtin_getvar_helper(chan, "MINIVM_FORMAT"))) { format = ast_strdupa(format); } - if ((duration_string = pbx_builtin_getvar_helper(chan, "MVM_DURATION"))) { + if ((duration_string = pbx_builtin_getvar_helper(chan, "MINIVM_DURATION"))) { duration_string = ast_strdupa(duration_string); } ast_channel_unlock(chan); @@ -2004,7 +2009,7 @@ int ouseexten = 0; char tmp[PATH_MAX]; char dest[PATH_MAX]; - char prefile[PATH_MAX]; + char prefile[PATH_MAX] = ""; char tempfile[PATH_MAX] = ""; char ext_context[256] = ""; char *domain; @@ -2186,12 +2191,12 @@ ast_copy_string(filename, (char *) data, sizeof(filename)); } else { ast_channel_lock(chan); - ast_copy_string(filename, pbx_builtin_getvar_helper(chan, "MVM_FILENAME"), sizeof(filename)); + ast_copy_string(filename, pbx_builtin_getvar_helper(chan, "MINIVM_FILENAME"), sizeof(filename)); ast_channel_unlock(chan); } if (ast_strlen_zero(filename)) { - ast_log(LOG_ERROR, "No filename given in application arguments or channel variable MVM_FILENAME\n"); + ast_log(LOG_ERROR, "No filename given in application arguments or channel variable MINIVM_FILENAME\n"); return res; } @@ -2293,10 +2298,10 @@ prompt = "vm-rec-busy"; } else if (ast_test_flag(&flags, OPT_UNAVAIL_GREETING)) { message = "unavailable"; - prompt = "vm-rec-unavail"; + prompt = "vm-rec-unv"; } else if (ast_test_flag(&flags, OPT_TEMP_GREETING)) { message = "temp"; - prompt = "vm-temp-greeting"; + prompt = "vm-rec-temp"; } else if (ast_test_flag(&flags, OPT_NAME_GREETING)) { message = "greet"; prompt = "vm-rec-name";