![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/soundstudiopro.com/private_html/utils/ |
<?php
header('Content-Type: text/html; charset=utf-8');
?>
<!DOCTYPE html>
<html>
<head>
<title>SoundStudioPro - Callback Status</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
background: #0a0a0a;
color: white;
}
.success { color: #48bb78; }
.error { color: #f56565; }
.warning { color: #ed8936; }
.info { color: #4299e1; }
.status-section {
border: 1px solid #333;
padding: 20px;
margin: 20px 0;
border-radius: 8px;
background: #1a1a1a;
}
.btn {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
padding: 12px 24px;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
margin: 10px 5px;
text-decoration: none;
display: inline-block;
}
.btn:hover {
transform: translateY(-2px);
}
pre {
background: #2d2d2d;
padding: 15px;
border-radius: 8px;
border: 1px solid #444;
color: #e2e8f0;
overflow-x: auto;
}
.task-result {
background: #2d2d2d;
padding: 15px;
border-radius: 8px;
margin: 10px 0;
border: 1px solid #444;
}
</style>
</head>
<body>
<h1>๐ต SoundStudioPro - Callback Status</h1>
<div class="status-section">
<h2>๐ก Callback System Status</h2>
<p><strong>Callback URL:</strong> <span class="info">https://soundstudiopro.com/callback.php</span></p>
<p><strong>Status:</strong> <span class="success">โ
Active and Ready</span></p>
<p>This endpoint receives notifications from the api.box service when music generation tasks are complete.</p>
</div>
<div class="status-section">
<h2>๐ Recent Callbacks</h2>
<?php
$logFile = 'callback_log.txt';
if (file_exists($logFile)) {
$logContent = file_get_contents($logFile);
if ($logContent) {
echo '<pre>' . htmlspecialchars($logContent) . '</pre>';
} else {
echo '<p class="warning">No callbacks received yet.</p>';
}
} else {
echo '<p class="warning">Callback log file not found.</p>';
}
?>
</div>
<div class="status-section">
<h2>๐ Task Results</h2>
<?php
$taskResultsDir = 'task_results';
if (is_dir($taskResultsDir)) {
$files = glob($taskResultsDir . '/*.json');
if ($files) {
foreach ($files as $file) {
$taskId = basename($file, '.json');
$content = file_get_contents($file);
$data = json_decode($content, true);
echo '<div class="task-result">';
echo '<h3>Task ID: ' . htmlspecialchars($taskId) . '</h3>';
echo '<p><strong>Status:</strong> <span class="' . ($data['status'] === 'complete' ? 'success' : 'warning') . '">' . htmlspecialchars($data['status']) . '</span></p>';
if (isset($data['audio_url'])) {
echo '<p><strong>Audio URL:</strong> <a href="' . htmlspecialchars($data['audio_url']) . '" target="_blank" style="color: #4299e1;">' . htmlspecialchars($data['audio_url']) . '</a></p>';
}
echo '<details><summary>Full Response</summary><pre>' . htmlspecialchars($content) . '</pre></details>';
echo '</div>';
}
} else {
echo '<p class="warning">No task results found.</p>';
}
} else {
echo '<p class="warning">Task results directory not found.</p>';
}
?>
</div>
<div class="status-section">
<h2>๐งช Test Callback</h2>
<p>You can test the callback system by sending a POST request to the callback URL:</p>
<pre>curl -X POST https://soundstudiopro.com/callback.php \
-H "Content-Type: application/json" \
-d '{"task_id":"test123","status":"complete","audio_url":"https://example.com/test.mp3"}'</pre>
<button onclick="testCallback()" class="btn">๐งช Test Callback</button>
<div id="testResult"></div>
</div>
<div class="status-section">
<h2>๐ Quick Links</h2>
<a href="musicstudio.html" class="btn">๐ต SoundStudioPro</a>
<a href="demo_music_creation.php" class="btn">๐งช Demo Page</a>
<a href="diagnostic.php" class="btn">๐ง Server Diagnostic</a>
</div>
<script>
async function testCallback() {
const resultDiv = document.getElementById('testResult');
resultDiv.innerHTML = '<p>Testing callback...</p>';
try {
const response = await fetch('callback.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
task_id: 'test_' + Date.now(),
status: 'complete',
audio_url: 'https://example.com/test_' + Date.now() + '.mp3',
title: 'Test Track',
duration: 30
})
});
const data = await response.json();
if (data.success) {
resultDiv.innerHTML = '<p class="success">โ
Callback test successful! Check the logs above.</p>';
// Reload the page to show updated logs
setTimeout(() => location.reload(), 2000);
} else {
resultDiv.innerHTML = '<p class="error">โ Callback test failed: ' + data.error + '</p>';
}
} catch (error) {
resultDiv.innerHTML = '<p class="error">โ Callback test failed: ' + error.message + '</p>';
}
}
</script>
</body>
</html>