Skip to content

Instantly share code, notes, and snippets.

@Jacoby6000
Created July 15, 2014 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jacoby6000/3eb7b9ca944da5e809cd to your computer and use it in GitHub Desktop.
Save Jacoby6000/3eb7b9ca944da5e809cd to your computer and use it in GitHub Desktop.
Asterisk 12.4 diff for multiple email voicemail
Index: apps/app_voicemail.c
===================================================================
--- apps/app_voicemail.c (revision 418713)
+++ apps/app_voicemail.c (working copy)
@@ -785,7 +785,7 @@
char mailbox[AST_MAX_EXTENSION]; /*!< Mailbox id, unique within vm context */
char password[80]; /*!< Secret pin code, numbers only */
char fullname[80]; /*!< Full name, for directory app */
- char email[80]; /*!< E-mail address */
+ char email[512]; /*!< E-mail address */
char *emailsubject; /*!< E-mail subject */
char *emailbody; /*!< E-mail body */
char pager[80]; /*!< E-mail address to pager (no attachment) */
@@ -4954,6 +4954,8 @@
struct ast_str *str1 = ast_str_create(16), *str2 = ast_str_create(16);
char *greeting_attachment;
char filename[256];
+ char *tmp;
+ char *email;
if (!str1 || !str2) {
ast_free(str1);
@@ -5016,7 +5018,14 @@
fprintf(p, "From: Asterisk PBX <%s>" ENDL, who);
}
- if (check_mime(vmu->fullname)) {
+ if (strchr(vmu->email, ' ')) {
+ fprintf(p, "To: ");
+ tmp = ast_strdupa(vmu->email);
+ while ((email = strsep(&tmp, " "))) {
+ fprintf(p, "%s <%s>,", ast_str_quote(&str2, 0, vmu->fullname), email);
+ }
+ fprintf(p, ENDL);
+ } else if (check_mime(vmu->fullname)) {
int first_line = 1;
char *ptr;
ast_str_encode_mime(&str2, 0, vmu->fullname, strlen("To: "), strlen(vmu->email) + 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment