"in mailbox %s from %s, on %s so you might\n"
- "want to check it when you get a chance. Thanks!\n\n\t\t\t\t--Asterisk\n\n", name,
+ "want to check it when you get a chance. Thanks!\n\n\t\t\t\t--Asterisk\n\n", vmu->fullname,
dur, msgnum + 1, mailbox, (callerid ? callerid : "an unknown caller"), date);
}
if (attach_user_voicemail) {
@@ -733,7 +753,7 @@
return 0;
}
-static int sendpage(char *srcemail, char *pager, int msgnum, char *mailbox, char *callerid, long duration)
+static int sendpage(char *srcemail, char *pager, int msgnum, char *mailbox, char *callerid, long duration, struct ast_vm_user *vmu)
{
FILE *p;
char date[256];
@@ -742,6 +762,7 @@
char dur[256];
time_t t;
struct tm tm;
+ struct vm_zone *the_zone = NULL;
p = popen(SENDMAIL, "w");
if (p) {
@@ -753,7 +774,26 @@
}
snprintf(dur, sizeof(dur), "%ld:%02ld", duration / 60, duration % 60);
time(&t);
- localtime_r(&t,&tm);
+
+ /* Does this user have a timezone specified? */
+ if (strlen(vmu->zonetag)) {
+ /* Find the zone in the list */
+ struct vm_zone *z;
+ z = zones;
+ while (z) {
+ if (!strcmp(z->name, vmu->zonetag)) {
+ the_zone = z;
+ break;
+ }
+ z = z->next;
+ }
+ }
+
+ if (the_zone)
+ ast_localtime(&t,&tm,the_zone->timezone);
+ else
+ ast_localtime(&t,&tm,NULL);
+
strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", &tm);
fprintf(p, "Date: %s\n", date);
fprintf(p, "From: Asterisk PBX <%s>\n", who);
@@ -1176,13 +1216,13 @@
attach_user_voicemail = vmu->attach;
if (strlen(vmu->serveremail))
myserveremail = vmu->serveremail;
- sendmail(myserveremail, vmu->email, vmu->fullname, msgnum, ext, chan->callerid, fn, fmt, end - start, attach_user_voicemail);
+ sendmail(myserveremail, vmu, msgnum, ext, chan->callerid, fn, fmt, end - start, attach_user_voicemail);
}
if (strlen(vmu->pager)) {
char *myserveremail = serveremail;
if (strlen(vmu->serveremail))
myserveremail = vmu->serveremail;
- sendpage(myserveremail, vmu->pager, msgnum, ext, chan->callerid, end - start);
+ sendpage(myserveremail, vmu->pager, msgnum, ext, chan->callerid, end - start, vmu);
}
} else
ast_log(LOG_WARNING, "No more messages possible\n");
@@ -1889,14 +1929,14 @@
attach_user_voicemail = receiver->attach;
if (strlen(receiver->serveremail))
myserveremail = receiver->serveremail;
- sendmail(myserveremail, receiver->email, receiver->fullname, todircount, username, callerid, fn, tmp, atol(ast_variable_retrieve(mif, NULL, "duration")), attach_user_voicemail);
+ sendmail(myserveremail, receiver, todircount, username, callerid, fn, tmp, atol(ast_variable_retrieve(mif, NULL, "duration")), attach_user_voicemail);
}
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum