aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-15 23:05:18 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-15 23:05:18 +0000
commit6c00b7ca23809b4c857dde78144ecb50d2af17f0 (patch)
treed45dcd17e5a979a57ba19dc3236a30dbdc539345 /apps/app_voicemail.c
parentdb5a6fcfc324f2f1d6e383d1bdcc0bcd12444eeb (diff)
Allow the attachment format to be specified differently for different mailboxes (issue #6961 reported by the ever fabulous Corydon76)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@20357 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r--apps/app_voicemail.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 65ded5395..22322477d 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -237,6 +237,7 @@ struct ast_vm_user {
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 @@ static void apply_option(struct ast_vm_user *vmu, const char *var, const char *v
{
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")) {
@@ -3292,6 +3295,10 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
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))) {
stringp = fmt;