}
//required class
require_once "app/voicemails/resources/classes/voicemail.php";
//download the message
if (check_str($_REQUEST["action"]) == "download") {
    $voicemail_message_uuid = check_str($_REQUEST["uuid"]);
    $voicemail_id = check_str($_REQUEST["id"]);
    $voicemail_uuid = check_str($_REQUEST["voicemail_uuid"]);
    if ($voicemail_message_uuid != '' && $voicemail_id != '' && $voicemail_uuid != '') {
        $voicemail = new voicemail();
        $voicemail->db = $db;
        $voicemail->domain_uuid = $_SESSION['domain_uuid'];
        $voicemail->voicemail_id = $voicemail_id;
        $voicemail->voicemail_uuid = $voicemail_uuid;
        $voicemail->voicemail_message_uuid = $voicemail_message_uuid;
        $result = $voicemail->message_download();
        unset($voicemail);
        header("Location: voicemail_edit.php?id=" . $voicemail_uuid);
    }
    exit;
}
//get the html values and set them as variables
$order_by = check_str($_GET["order_by"]);
$order = check_str($_GET["order"]);
//get the voicemail
$vm = new voicemail();
$vm->db = $db;
$vm->domain_uuid = $_SESSION['domain_uuid'];
$vm->voicemail_uuid = $voicemail_uuid;
$vm->order_by = $order_by;
$vm->order = $order;