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:
@@ -53,7 +53,16 @@
|
|||||||
$this->domain_uuid = $_SESSION['domain_uuid'];
|
$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)) {
|
if (!isset($this->voicemail_id)) {
|
||||||
$sql = "select voicemail_id from v_voicemails ";
|
$sql = "select voicemail_id from v_voicemails ";
|
||||||
$sql .= "where domain_uuid = '".$this->domain_uuid."' ";
|
$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() {
|
public function voicemails() {
|
||||||
|
|
||||||
//set the voicemail id and voicemail uuid arrays
|
//set the voicemail id and voicemail uuid arrays
|
||||||
@@ -296,6 +299,7 @@
|
|||||||
public function message_delete() {
|
public function message_delete() {
|
||||||
|
|
||||||
//delete the recording
|
//delete the recording
|
||||||
|
$this->get_voicemail_id();
|
||||||
$file_path = $_SESSION['switch']['voicemail']['dir']."/default/".$_SESSION['domain_name']."/".$this->voicemail_id;
|
$file_path = $_SESSION['switch']['voicemail']['dir']."/default/".$_SESSION['domain_name']."/".$this->voicemail_id;
|
||||||
if ($this->voicemail_message_uuid != '') {
|
if ($this->voicemail_message_uuid != '') {
|
||||||
foreach (glob($file_path."/intro_".$this->voicemail_message_uuid.".*") as $file_name) {
|
foreach (glob($file_path."/intro_".$this->voicemail_message_uuid.".*") as $file_name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user