X-Git-Url: https://git.infodrom.org/?p=infodrom%2Fphone;a=blobdiff_plain;f=phone.php;h=ff8e0bd6315777315741827ea8d204aed2159fcf;hp=5f77ba910923f3e2141ac979dd56541f1e389bd1;hb=cb3e539cdc964f2cbfe1bfe2c92adbb13e946c3d;hpb=05d1bb257d5716fffeffe42b9c6edf3bdcbad40c diff --git a/phone.php b/phone.php index 5f77ba9..ff8e0bd 100644 --- a/phone.php +++ b/phone.php @@ -75,7 +75,7 @@ function read_directory($directory) if ($dir = opendir(SPOOL_DIR . '/' . $directory)) { while (($filename = readdir($dir)) !== false) { - if (($pos = strpos($filename, '.vmsg')) !== false) { + if (($pos = strpos($filename, '.vmsg')) !== false || ($pos = strpos($filename, '.msg')) !== false) { $fname = substr($filename,0,$pos); $info = message_info($directory, $fname); $info['fname'] = $fname; @@ -98,7 +98,13 @@ function send_call($dir, $call) { $dir = str_replace('/','x',$dir); $call = str_replace('/','x',$call); - $fname = SPOOL_DIR . '/' . $dir . '/' . $call . '.vmsg'; + + if ($dir == 'messages') + $ext = '.msg'; + else + $ext = '.vmsg'; + + $fname = SPOOL_DIR . '/' . $dir . '/' . $call . $ext; if (!is_file($fname)) { printf("

Anruf %s in %s nicht gefunden!

", $call, $dir); @@ -148,8 +154,7 @@ function save_call() $info = read_info($_POST['dir'], $_POST['call']); $info['name'] = $_POST['name']; $info['note'] = $_POST['note']; - - error_log(var_export($info,true)); + write_info($_POST['dir'], $_POST['call'], $info); } ?>