Files
Claude ea49d36dad Speaking clock for Asterisk and FreePBX, with 81 voices
app_speakingclock adds SpeakingClock(), which places each announcement by
sample against the system clock, so the time mark (the third pip) lands on
the second it announces, as on the real machines. Voices are folders of
8 kHz WAV clips with a voice.conf; the module supports TIM-style
(phrase, hour, minute, seconds, pips), talking-clock, chime and hourly
voices.

voices/ holds the asterisk-tim pair (Pat Simmons, Gordon Gow), garrysblog's
Amy and Celine, and the Steve's Talking Clock library, converted by
tools/build_voices.py from what tools/fetch-sources.sh downloads. The
recordings belong to their original owners (NOTICE.md); the code is
GPL-2.0-or-later.

freepbx/speakingclock is a FreePBX module: clocks as destinations, with
optional numbers to dial, and speakingclock.conf from its settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRVXG9MBYPxmcs9cFxs
2026-11-10 17:41:05 +00:00

47 lines
1.7 KiB
PHP

<?php
// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright (C) 2026 D-Modem Authors
//
// views/clocks.php - the clocks. Given $clocks, $voices.
if (!defined('FREEPBX_IS_AUTH')) {
die('No direct script access allowed');
}
use FreePBX\modules\Speakingclock as S;
?>
<p>
<a href="?display=speakingclock&amp;view=form" class="btn btn-default">
<i class="fa fa-plus"></i> <?php echo _('Add clock'); ?></a>
</p>
<?php if (!$clocks): ?>
<div class="alert alert-info">
<?php echo _('No clocks yet. A clock is a voice with its time zone. Each one is a destination for inbound routes, IVRs and time conditions, under "Speaking Clock", and can have a number your extensions dial, such as 123.'); ?>
</div>
<?php else: ?>
<table class="table table-striped" id="speakingclock-clocks">
<thead>
<tr>
<th><?php echo _('Clock'); ?></th>
<th><?php echo _('Description'); ?></th>
<th><?php echo _('Voice'); ?></th>
<th><?php echo _('Number'); ?></th>
<th><?php echo _('Time zone'); ?></th>
<th><?php echo _('Destination'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($clocks as $name => $c): ?>
<tr>
<td><a href="?display=speakingclock&amp;view=form&amp;clock=<?php echo urlencode($name); ?>">
<?php echo S::h($name); ?></a></td>
<td><?php echo S::h($c['description']); ?></td>
<td><?php echo S::h(isset($voices[$c['voice']]) ? $voices[$c['voice']]['name'] : $c['voice'] . ' ' . _('(missing)')); ?></td>
<td><?php echo S::h($c['number']); ?></td>
<td><?php echo S::h($c['timezone'] !== '' ? $c['timezone'] : _('default')); ?></td>
<td><code><?php echo S::h(S::destination($name)); ?></code></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>