Currently maintained by the PBX Open Source Software Alliance
https://github.com/POSSA/Hotel-Style-Wakeup-Calls
Last modified Oct 15, 2012
**********************************************************/
/***** remove check for updates now that module is pushed from FreePBX repo ***
// check to see if user has automatic updates enabled in FreePBX settings
$cm =& cronmanager::create($db);
$online_updates = $cm->updates_enabled() ? true : false;

// check dev site to see if new version of module is available
if ($online_updates && $foo = hotelwakeup_vercheck()) {
	print "<br>A <b>new version of this module is available</b> from the <a target='_blank' href='http://pbxossa.org'>PBX Open Source Software Alliance</a><br>";
	}
******************************************************************************/
echo FreePBX::Hotelwakeup()->showPage();
return;
// Process form if button B1 is clicked
if (isset($_POST['B1'])) {
    hotelwakeup_saveconfig();
}
// Process form if delete button clicked
if (isset($_POST['DELETE'])) {
    if (file_exists($_POST['filename'])) {
        unlink($_POST['filename']);
    }
}
//  Process form if Schedule button clicked
if (isset($_POST['SCHEDULE'])) {
    $HH = $_POST['HH'];
    $MM = $_POST['MM'];
예제 #2
0
        if ($lang == 'ja') {
            sim_playback($AGI, "10-minutes-from-now&rqsted-wakeup-for");
        } else {
            sim_playback($AGI, "rqsted-wakeup-for&digits/10&minutes&vm-from&now");
        }
        FreePBX::Hotelwakeup()->addWakeup($number, $time_wakeup, $lang);
        $AGI->hangup();
        break;
    case 4:
        $time_wakeup += 900;
        if ($lang == 'ja') {
            sim_playback($AGI, "15-minutes-from-now&rqsted-wakeup-for");
        } else {
            sim_playback($AGI, "rqsted-wakeup-for&digits/15&minutes&vm-from&now");
        }
        FreePBX::Hotelwakeup()->addWakeup($number, $time_wakeup, $lang);
        $AGI->hangup();
        break;
}
sim_playback($AGI, "goodbye");
$AGI->hangup();
/**
 * Simulate playback functionality like the dialplan
 * @param  object $AGI  The AGI Object
 * @param  string $file Audio files combined by/with '&'
 */
function sim_playback($AGI, $file)
{
    $files = explode('&', $file);
    foreach ($files as $f) {
        $AGI->stream_file($f);