[asterisk-commits] trunk r20357 - in /trunk: apps/app_voicemail.c configs/voicemail.conf.sample

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Apr 15 16:05:20 MST 2006


Author: file
Date: Sat Apr 15 18:05:18 2006
New Revision: 20357

URL: http://svn.digium.com/view/asterisk?rev=20357&view=rev
Log:
Allow the attachment format to be specified differently for different mailboxes (issue #6961 reported by the ever fabulous Corydon76)

Modified:
    trunk/apps/app_voicemail.c
    trunk/configs/voicemail.conf.sample

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?rev=20357&r1=20356&r2=20357&view=diff
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Sat Apr 15 18:05:18 2006
@@ -237,6 +237,7 @@
 	char dialout[80];
 	char uniqueid[20];		/*!< Unique integer identifier */
 	char exit[80];
+	char attachfmt[20];		/*!< Attachment format */
 	unsigned int flags;		/*!< VM_ flags */	
 	int saydurationm;
 	int maxmsg;			/*!< Maximum number of msgs per folder for this mailbox */
@@ -451,7 +452,9 @@
 {
 	int x;
 	if (!strcasecmp(var, "attach")) {
-		ast_set2_flag(vmu, ast_true(value), VM_ATTACH);	
+		ast_set2_flag(vmu, ast_true(value), VM_ATTACH);
+	} else if (!strcasecmp(var, "attachfmt")) {
+		ast_copy_string(vmu->attachfmt, value, sizeof(vmu->attachfmt));
 	} else if (!strcasecmp(var, "serveremail")) {
 		ast_copy_string(vmu->serveremail, value, sizeof(vmu->serveremail));
 	} else if (!strcasecmp(var, "language")) {
@@ -3291,6 +3294,10 @@
 	make_dir(todir, sizeof(todir), vmu->context, vmu->mailbox, "INBOX");
 	make_file(fn, sizeof(fn), todir, msgnum);
 	snprintf(ext_context, sizeof(ext_context), "%s@%s", vmu->mailbox, vmu->context);
+
+	if (!ast_strlen_zero(vmu->attachfmt)) {
+		fmt = vmu->attachfmt;
+	}
 
 	/* Attach only the first format */
 	if ((fmt = ast_strdupa(fmt))) {

Modified: trunk/configs/voicemail.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/voicemail.conf.sample?rev=20357&r1=20356&r2=20357&view=diff
==============================================================================
--- trunk/configs/voicemail.conf.sample (original)
+++ trunk/configs/voicemail.conf.sample Sat Apr 15 18:05:18 2006
@@ -162,6 +162,11 @@
 ; 
 ; tz=central 		; Timezone from zonemessages above.  Irrelevant if envelope=no.
 ; attach=yes 		; Attach the voicemail to the notification email *NOT* the pager email
+; attachfmt=wav49	; Which format to attach to the email.  Normally this is the
+			; first format specified in the format parameter above, but this
+			; option lets you customize the format sent to particular mailboxes.
+			; Useful if Windows users want wav49, but Linux users want gsm.
+			; [per-mailbox only]
 ; saycid=yes 		; Say the caller id information before the message. If not described, 
 			;     or set to no, it will be in the envelope
 ; cidinternalcontexts=intern	; Internal Context for Name Playback instead of 



More information about the asterisk-commits mailing list