Review Board 1.7.16


Voicemail send email to multiple email addresses

Review Request #3829 - Created July 18, 2014 and submitted

Jacob Barber
12
ASTERISK-24045
Reviewers
asterisk-dev
Asterisk
Currently voicemail to email only works with a single email. This patch allows a user to use a space separated list of emails (up to 512 characters long), where the user would like for the emails to be sent. This is useful for people who don't want to go through setting up mailing groups, or for people who host provide VoIP services with asterisk as a backend, where their customers don't know how to set up mailing groups.
Tested calling and sending voicemails using the mysql realtime database and using the standard voicemail.conf implementation.

Changes between revision 1 and 2

1 2 3
1 2 3

  1. /branches/12/apps/app_voicemail.c: Loading...
/branches/12/apps/app_voicemail.c
Diff Revision 1 Diff Revision 2
[20] 5019 lines
[+20] [+] static void make_email_file(FILE *p,
5020

    
   
5020

   
5021
	if (strchr(vmu->email, ' ')) {
5021
	if (strchr(vmu->email, ' ')) {
5022
		fprintf(p, "To: ");
5022
		fprintf(p, "To: ");
5023
		tmp = ast_strdupa(vmu->email);
5023
		tmp = ast_strdupa(vmu->email);
5024
		while ((email = strsep(&tmp, " "))) {
5024
		while ((email = strsep(&tmp, " "))) {

    
   
5025
			/* Only append to the TO field if the string is empty */

    
   
5026
			if(*email != '\0'){
5025
			fprintf(p, "%s <%s>,", ast_str_quote(&str2, 0, vmu->fullname), email);
5027
				fprintf(p, "%s <%s>,", ast_str_quote(&str2, 0, vmu->fullname), email);
5026
		}
5028
			}

    
   
5029
		}
5027
		fprintf(p, ENDL);
5030
		fprintf(p, ENDL);
5028
	} else if (check_mime(vmu->fullname)) {
5031
	} else if (check_mime(vmu->fullname)) {
5029
		int first_line = 1;
5032
		int first_line = 1;
5030
		char *ptr;
5033
		char *ptr;
5031
		ast_str_encode_mime(&str2, 0, vmu->fullname, strlen("To: "), strlen(vmu->email) + 3);
5034
		ast_str_encode_mime(&str2, 0, vmu->fullname, strlen("To: "), strlen(vmu->email) + 3);
[+20] [20] 10746 lines
  1. /branches/12/apps/app_voicemail.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.