diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-07-20 00:25:54 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-07-20 00:25:54 +0000 |
commit | 3db82d8597d9429d3f7b63431f707c72a37dcc9b (patch) | |
tree | afb1124fc4c4860c4b1c941988dd09de3458cd18 /apps/app_voicemail.c | |
parent | 9ecdab9452a08a00bf6ac74c649d83e5123c1215 (diff) |
add OGG/Vorbis file format support (bug #4296)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rwxr-xr-x | apps/app_voicemail.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index e5a52f06d..c64fef8b4 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -1665,8 +1665,13 @@ static int sendmail(char *srcemail, struct ast_vm_user *vmu, int msgnum, char *c dur, msgnum + 1, mailbox, (cidname ? cidname : (cidnum ? cidnum : "an unknown caller")), date); } if (attach_user_voicemail) { + /* Eww. We want formats to tell us their own MIME type */ + char *ctype = "audio/x-"; + if (!strcasecmp(format, "ogg")) + ctype = "application/"; + fprintf(p, "--%s\n", bound); - fprintf(p, "Content-Type: audio/x-%s; name=\"msg%04d.%s\"\n", format, msgnum, format); + fprintf(p, "Content-Type: %s%s; name=\"msg%04d.%s\"\n", ctype, format, msgnum, format); fprintf(p, "Content-Transfer-Encoding: base64\n"); fprintf(p, "Content-Description: Voicemail sound attachment.\n"); fprintf(p, "Content-Disposition: attachment; filename=\"msg%04d.%s\"\n\n", msgnum, format); |