aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2018-06-01 11:37:39 -0700
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2018-06-01 11:37:39 -0700
commit7591fb8b002ef8a077d21b7f28b0755772d05b5b (patch)
treea24b4f0d6b500e3104f465bce50ea7248e8071d3
parent2f50296728ca67432a192b53ca268e2d49b929ed (diff)
downloadasterisk-aastra-7591fb8b002ef8a077d21b7f28b0755772d05b5b.tar.gz
Add timezone to voicemail display
The voicemail box lists seconds past epoch and a UTC date. The UTC date isn't terribly useful because people want to see the local time of the message so use a static timezone to change the message list and message display into that zone. This should probably be further expanded to get the timezone from the phone somehow (later TODO). Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--include/Voicemail.class.php5
-rw-r--r--include/VoicemailListManager.class.php3
2 files changed, 6 insertions, 2 deletions
diff --git a/include/Voicemail.class.php b/include/Voicemail.class.php
index 483f018..f78f326 100644
--- a/include/Voicemail.class.php
+++ b/include/Voicemail.class.php
@@ -17,6 +17,7 @@ class Voicemail extends BaseAastra {
var $mailbox;
var $path = '/var/spool/asterisk/voicemail/default'; #fixme
var $box;
+ var $timezone = 'America/Los_Angeles';
private function __readbox($box) {
$this->box[$box] = array();
@@ -55,6 +56,7 @@ class Voicemail extends BaseAastra {
$this->__readbox($k);
}
$this->title = 'Voicemail Box '.$this->mailbox;
+ date_default_timezone_set($timezone);
}
function __construct() {
@@ -252,8 +254,9 @@ class Voicemail extends BaseAastra {
}
$c = new ConfigFile($this->path.'/'.$box.'/'.$msg.'.txt');
$m = $c->section('message');
+ $d = date('D, j M Y h:i:s A T Y', $m['origtime']);
$this->displayObject(new TextScreen());
- $this->do->addText('Received: '.$m['origdate']);
+ $this->do->addText('Received: '.$d);
$this->do->addText('From: '.$m['callerid']);
$this->do->addText('Length '.$m['duration'].' seconds');
$this->$ordinary($box, $msg, $i);
diff --git a/include/VoicemailListManager.class.php b/include/VoicemailListManager.class.php
index 467a69f..220ca72 100644
--- a/include/VoicemailListManager.class.php
+++ b/include/VoicemailListManager.class.php
@@ -35,7 +35,8 @@ class VoicemailListManager extends BaseList {
$c = new ConfigFile($this->path.'/'.$v.'.txt');
$m = $c->section('message');
$a = array();
- $a[0] = $i.': '.$m['origdate'];
+ $d = date('D, j M Y h:i:s A T Y', $m['origtime']);
+ $a[0] = $i.': '.$d;
$a[1] = $selecturl.$v;
$this->data[] = $a;
}