Patch for bug #2142 adds the option for pagerfromline so that you can have more personalized message. Matt O'Gorman Index: apps/app_voicemail.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v retrieving revision 1.136 diff -u -r1.136 app_voicemail.c --- apps/app_voicemail.c 18 Jul 2004 20:50:37 -0000 1.136 +++ apps/app_voicemail.c 3 Aug 2004 06:41:00 -0000 @@ -275,6 +275,7 @@ static int pbxskip = 0; static char *emailsubject = NULL; static char fromstring[100]; +static char pagerfromstring[100]; static char emailtitle[100]; static char charset[32] = "ISO-8859-1"; @@ -1031,6 +1032,21 @@ strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", &tm); fprintf(p, "Date: %s\n", date); + + if (*pagerfromstring) { + struct ast_channel *ast = ast_channel_alloc(0); + if (ast) { + char *passdata; + int vmlen = strlen(fromstring)*3 + 200; + if ((passdata = alloca(vmlen))) { + memset(passdata, 0, vmlen); + prep_email_sub_vars(ast,vmu,msgnum + 1,mailbox,callerid,dur,date,passdata, vmlen); + pbx_substitute_variables_helper(ast,pagerfromstring,passdata,vmlen); + fprintf(p, "From: %s <%s>\n",passdata,who); + } else ast_log(LOG_WARNING, "Cannot allocate workspace for variable substitution\n"); + ast_channel_free(ast); + } else ast_log(LOG_WARNING, "Cannot allocate the channel for variables substitution\n"); + } else fprintf(p, "From: Asterisk PBX <%s>\n", who); fprintf(p, "To: %s\n", pager); fprintf(p, "Subject: New VM\n\n"); @@ -4431,6 +4447,7 @@ cat = ast_category_browse(cfg, cat); } memset(fromstring,0,sizeof(fromstring)); + memset(pagerfromstring,0,sizeof(pagerfromstring)); memset(emailtitle,0,sizeof(emailtitle)); strncpy(charset, "ISO-8859-1", sizeof(charset) - 1); if (emailbody) { @@ -4445,6 +4462,8 @@ pbxskip = ast_true(s); if ((s=ast_variable_retrieve(cfg, "general", "fromstring"))) strncpy(fromstring,s,sizeof(fromstring)-1); + if ((s=ast_variable_retrieve(cfg, "general", "pagerfromstring"))) + strncpy(pagerfromstring,s,sizeof(pagerfromstring)-1); if ((s=ast_variable_retrieve(cfg, "general", "charset"))) strncpy(charset,s,sizeof(charset)-1); if ((s=ast_variable_retrieve(cfg, "general", "emailtitle"))) {