SIMON Master Console Rebuild
True command center for SIMON + WEB360
This rebuild gives you a cleaner production spine: interactive tree, live viewer, guarded editor, dynamic graphics, architecture map, and note storage. It is designed to sit beside your existing
console.php
and become the stronger replacement path.
Dashboard
Tree
Viewer
System Map
File Registry
Notes
Files
15,560
Folders
417
Scanned Size
3.85 GB
PHP Files
922
Editable Text Files
12,821
File viewer
guarded to /htdocs
/old/phone/transcription.php
<?php declare(strict_types=1); require_once __DIR__ . '/bootstrap.php'; require_once dirname(__DIR__) . '/_core/memory.php'; $text = si_phone_post('TranscriptionText'); $status = si_phone_post('TranscriptionStatus'); $recordingUrl = si_phone_post('RecordingUrl'); $caller = preg_replace('/\D+/', '', (string)($_GET['caller'] ?? si_phone_post('From'))) ?? ''; $notifyMode = (string)($_GET['notify'] ?? ''); $notifyBySms = in_array($notifyMode, ['sms', 'corporate_vm'], true); si_phone_log('voicemail_transcribed', [ 'status' => $status, 'transcript' => $text, 'recording_url' => $recordingUrl, 'caller' => $caller, 'transcription_sid' => si_phone_post('TranscriptionSid'), ]); if ($text !== '') si_memory_remember('phone', $caller, 'caller', '[Voicemail transcript] ' . $text); if ($text !== '') { $subject = $notifyMode === 'corporate_vm' ? '[SIMON] New corporate voicemail' : '[SIMON] New caller message'; $emailBody = "Caller: +{$caller}\nStatus: {$status}\nRecording: {$recordingUrl}\n\nTranscript:\n{$text}\n"; $emailed = @mail( 'admin@gaylordsinclair.com', $subject, $emailBody, "From: SIMON Operations <admin@gaylordsinclair.com>\r\nContent-Type: text/plain; charset=UTF-8" ); si_phone_log($emailed ? 'admin_email_relayed' : 'admin_email_failed', [ 'caller' => $caller, 'notification' => $notifyMode, ]); } if ($notifyBySms && $text !== '') { $to = $notifyMode === 'corporate_vm' ? (defined('SI_ADMIN_SMS_NUMBER') ? trim((string) SI_ADMIN_SMS_NUMBER) : '') : (defined('SI_TRANSFER_NUMBER') ? trim((string) SI_TRANSFER_NUMBER) : ''); $from = defined('TWILIO_PHONE_NUMBER') ? trim((string) TWILIO_PHONE_NUMBER) : ''; $account = defined('TWILIO_ACCOUNT_SID') ? trim((string) TWILIO_ACCOUNT_SID) : ''; $user = defined('TWILIO_API_KEY_SID') && str_starts_with((string) TWILIO_API_KEY_SID, 'SK') ? (string) TWILIO_API_KEY_SID : $account; $pass = defined('TWILIO_API_KEY_SECRET') && trim((string) TWILIO_API_KEY_SECRET) !== '' ? (string) TWILIO_API_KEY_SECRET : (defined('TWILIO_AUTH_TOKEN') ? (string) TWILIO_AUTH_TOKEN : ''); $sent = false; $error = 'Twilio SMS credentials are unavailable.'; if ($to !== '' && $from !== '' && $account !== '' && $pass !== '' && !str_contains($pass, 'PASTE_') && function_exists('curl_init')) { $prefix = $notifyMode === 'corporate_vm' ? 'SIMON corporate voicemail' : 'SIMON voice-to-text message'; $body = $prefix . ' from +' . $caller . ': ' . $text; $request = curl_init('https://api.twilio.com/2010-04-01/Accounts/' . rawurlencode($account) . '/Messages.json'); curl_setopt_array($request, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => http_build_query(['To' => $to, 'From' => $from, 'Body' => $body]), CURLOPT_RETURNTRANSFER => true, CURLOPT_USERPWD => $user . ':' . $pass, CURLOPT_HTTPAUTH => CURLAUTH_BASIC, CURLOPT_TIMEOUT => 20, ]); $response = curl_exec($request); $httpStatus = (int) curl_getinfo($request, CURLINFO_RESPONSE_CODE); $curlError = curl_error($request); curl_close($request); $sent = $httpStatus >= 200 && $httpStatus < 300; if (!$sent) { $decoded = is_string($response) ? json_decode($response, true) : null; $error = is_array($decoded) ? (string)($decoded['message'] ?? 'Twilio rejected the text.') : ($curlError ?: 'Twilio rejected the text.'); } } $successEvent = $notifyMode === 'corporate_vm' ? 'corporate_voicemail_alert_sent' : 'trusted_text_sent'; $failureEvent = $notifyMode === 'corporate_vm' ? 'corporate_voicemail_alert_failed' : 'trusted_text_failed'; si_phone_log($sent ? $successEvent : $failureEvent, [ 'caller' => $caller, 'transcript' => $text, 'error' => $sent ? '' : $error, ]); } http_response_code(204);
Save file
Quick jump
open a path
Open