fix: voicemail message delete bug #2100 (#2221)

bug: voicemail_id was never set so wrong path constructed and glob finds no matching files.

test case:
delete a voicemail message from the web interface

expected result:
voicemail is deleted in the database + file system

actual results:
voicemail is still on the file system
This commit is contained in:
jebsolutions 2016-12-01 13:53:12 -05:00 committed by FusionPBX
parent 2946866316
commit c5a47e0287
1 changed files with 17 additions and 13 deletions

View File

@ -53,7 +53,16 @@
$this->domain_uuid = $_SESSION['domain_uuid'];
}
//get the voicemail_id
// note: no point calling get_voicemail_id here since $this->voicemail_uuid isn't set yet
}
public function __destruct() {
foreach ($this as $key => $value) {
unset($this->$key);
}
}
public function get_voicemail_id() {
if (!isset($this->voicemail_id)) {
$sql = "select voicemail_id from v_voicemails ";
$sql .= "where domain_uuid = '".$this->domain_uuid."' ";
@ -68,12 +77,6 @@
}
}
public function __destruct() {
foreach ($this as $key => $value) {
unset($this->$key);
}
}
public function voicemails() {
//set the voicemail id and voicemail uuid arrays
@ -296,6 +299,7 @@
public function message_delete() {
//delete the recording
$this->get_voicemail_id();
$file_path = $_SESSION['switch']['voicemail']['dir']."/default/".$_SESSION['domain_name']."/".$this->voicemail_id;
if ($this->voicemail_message_uuid != '') {
foreach (glob($file_path."/intro_".$this->voicemail_message_uuid.".*") as $file_name) {