function checkUser($called, $caller) { global $mailbox; global $user; global $file; $query = "SELECT count(*) as count FROM extensions WHERE extension='{$called}'"; $res = query_to_array($query); if (!$res[0]["count"]) { return false; } $user = vmGetVoicemailDir($called); if (!is_dir($user)) { mkdir($user); } $mailbox = $called; $file = vmBuildNewFilename($caller); return true; }
function vmHasMessageDir($mailbox) { return is_dir(vmGetVoicemailDir($mailbox)); }
function initUser() { global $dir; global $mailbox; global $files; vmInitMessageDir($mailbox); vmGetMessageFiles($mailbox, $files); $all_files = $files; // this array contains both .mp3 and .slin files $files = array(); for ($i = 0; $i < count($all_files); $i++) { if (substr($all_files[$i], -5) == ".slin") { $files[] = $all_files[$i]; } } $dir = vmGetVoicemailDir($mailbox); debug("found " . count($files) . " file entries for mailbox {$mailbox}"); setState("prompt"); }