$fcc->setDescription("{$id}: Call Flow Toggle"); } $fcc->setDefault('*28' . $id); if ($code != '*28' && $code != '') { $fcc->setCode($code . $id); } if (!$enabled) { $fcc->setEnabled(false); } $fcc->update(); unset($fcc); } } $fcc = new featurecode('daynight', 'toggle-mode-all'); $fcc->setDescription("All: Call Flow Toggle"); $fcc->setDefault('*28'); if ($delete_old) { if ($code != '*28' && $code != '') { $fcc->setCode($code); } if (!$enabled) { $fcc->setEnabled(false); } } $fcc->update(); unset($fcc); // Sqlite3 does not like this syntax, but no migration needed since it started in 2.5 // if ($amp_conf["AMPDBENGINE"] != "sqlite3") { outn(_("changing primary keys to all fields..")); $sql = 'ALTER TABLE `daynight` DROP PRIMARY KEY , ADD PRIMARY KEY ( `ext` , `dmode` , `dest` )';
echo "The file {$filename} is not writable"; } ?> Verifying / Installing cronjob into the FreePBX cron manager.<br> <?php $sql = "SELECT * FROM `cronmanager` WHERE `module` = 't' LIMIT 1;"; $res = $db->query($sql); if ($res->numRows() != 2) { $sql = "INSERT INTO\tcronmanager (module,id,time,freq,command) VALUES ('trunkalarm','every_day',23,24,'/usr/bin/find /var/lib/asterisk/sounds/tts -name \"*.wav\" -mtime +1 -exec rm {} \\\\;')"; $sql = "INSERT INTO\tcronmanager (module,id,time,freq,command) VALUES ('trunkalarm',*,15,*,'/asterisk/agi-bin/monitor_trunk.php \\\\;')"; $check = $db->query($sql); if (DB::IsError($check)) { die_freepbx("Can not create values in cronmanager table: " . $check->getMessage() . "\n"); } } ?> Verifying / Creating TTS Folder.<br> <?php $parm_tts_dir = '/var/lib/asterisk/sounds/tts'; if (!is_dir($parm_tts_dir)) { mkdir($parm_tts_dir, 0775); } ?> Creating Feature Code.<br> <?php // Register FeatureCode - Trunk Monitor; $fcc = new featurecode('trunkalarm', 'trunkalarm'); $fcc->setDescription('Trunk Alarm'); $fcc->setDefault('*878625'); $fcc->update(); unset($fcc);
<?php global $db; global $amp_conf; // Add Feature Codes for Toggle Queues - Using *45 $fcc = new featurecode('queues', 'que_toggle'); $fcc->setDescription('Queue Toggle'); $fcc->setDefault('*45'); $fcc->update(); unset($fcc); if (!function_exists("out")) { function out($text) { echo $text . "<br />"; } } if (!function_exists("outn")) { function outn($text) { echo $text; } } $results = array(); $sql = "SELECT args, extension, priority FROM extensions WHERE context = 'ext-queues' AND descr = 'jump'"; $results = $db->getAll($sql, DB_FETCHMODE_ASSOC); if (!DB::IsError($results)) { // error - table must not be there foreach ($results as $result) { $old_dest = $result['args']; $extension = $result['extension']; $priority = $result['priority'];
function recordings_update($id, $rname, $descr, $request, $fcode = 0, $fcode_pass = '') { global $db; // Update the descriptive fields $fcode_pass = preg_replace("/[^0-9*]/", "", trim($fcode_pass)); $results = sql("UPDATE recordings SET displayname = '" . $db->escapeSimple($rname) . "', description = '" . $db->escapeSimple($descr) . "', fcode='{$fcode}', fcode_pass='******' WHERE id = '{$id}'"); // Build the file list from _REQUEST $astsnd = isset($asterisk_conf['astvarlibdir']) ? $asterisk_conf['astvarlibdir'] : '/var/lib/asterisk'; $astsnd .= "/sounds/"; $recordings = array(); // Set the file names from the submitted page, sysrec[N] // We don't set if feature code was selected, we use what was already there // because the fields will have been disabled and won't be accessible in the // $_REQUEST array anyhow // if ($fcode != 1) { // delete the feature code if it existed // $fcc = new featurecode('recordings', 'edit-recording-' . $id); $fcc->delete(); unset($fcc); foreach ($request as $key => $val) { $res = strpos($key, 'sysrec'); if ($res !== false) { // strip out any relative paths, since this is coming from a URL str_replace('..', '', $val); $recordings[substr($key, 6)] = $val; } } // Stick the filename in the database recordings_set_file($id, implode('&', $recordings)); } else { // Add the feature code if it is needed // $fcc = new featurecode('recordings', 'edit-recording-' . $id); $fcc->setDescription("Edit Recording: {$rname}"); $fcc->setDefault('*29' . $id); $fcc->update(); unset($fcc); } // In _REQUEST there are also various actions (possibly) // up[N] - Move file id N up one place // down[N] - Move fid N down one place // del[N] - Delete fid N foreach ($request as $key => $val) { if (strpos($key, "_") == 0) { $up = strpos($key, "up"); $down = strpos($key, "down"); $del = strpos($key, "del"); } if ($up !== false) { $up = substr($key, 2); recordings_move_file_up($id, $up); } if ($del !== false) { $del = substr($key, 3); recordings_delete_file($id, $del); } if ($down !== false) { $down = substr($key, 4); recordings_move_file_down($id, $down); } } }
<?php //for translation only if (false) { _("Do-Not-Disturb (DND)"); _("DND Activate"); _("DND Deactivate"); _("DND Toggle"); } // Register FeatureCode - Activate $fcc = new featurecode('donotdisturb', 'dnd_on'); $fcc->setDescription('DND Activate'); $fcc->setDefault('*78'); $fcc->update(); unset($fcc); // Register FeatureCode - Deactivate $fcc = new featurecode('donotdisturb', 'dnd_off'); $fcc->setDescription('DND Deactivate'); $fcc->setDefault('*79'); $fcc->update(); unset($fcc); // Register FeatureCode - Activate $fcc = new featurecode('donotdisturb', 'dnd_toggle'); $fcc->setDescription('DND Toggle'); $fcc->setDefault('*76'); $fcc->update(); unset($fcc);
// Enable intercom as a feature code $fcc = new featurecode('paging', 'intercom-prefix'); $fcc->setDescription('Intercom prefix'); $fcc->setDefault('*80', false); $fcc->update(); unset($fcc); // User intercom enable code $fcc = new featurecode('paging', 'intercom-on'); $fcc->setDescription('User Intercom Allow'); $fcc->setDefault('*54', false); $fcc->update(); unset($fcc); // User intercom disable $fcc = new featurecode('paging', 'intercom-off'); $fcc->setDescription('User Intercom Disallow'); $fcc->setDefault('*55', false); $fcc->update(); unset($fcc); // Remove old tables that were never used // $sql = "DROP TABLE IF EXISTS paging_phones"; $result = $db->query($sql); if (DB::IsError($result)) { die_freepbx($result->getDebugInfo()); } $sql = "DROP TABLE IF EXISTS paging_overview"; $result = $db->query($sql); if (DB::IsError($result)) { die_freepbx($result->getDebugInfo()); } $sql = "CREATE TABLE IF NOT EXISTS paging_groups \n\t( page_number VARCHAR(50), \n\t ext VARCHAR(25),\n\t\tPRIMARY KEY (page_number, ext)\n\t)";
//for translation only if (false) { _("Findme Follow Toggle"); } global $db; global $amp_conf; global $astman; $sql = "\nCREATE TABLE IF NOT EXISTS `findmefollow` \n( \n\t`grpnum` VARCHAR( 20 ) NOT NULL , \n\t`strategy` VARCHAR( 50 ) NOT NULL , \n\t`grptime` SMALLINT NOT NULL , \n\t`grppre` VARCHAR( 100 ) NULL , \n\t`grplist` VARCHAR( 255 ) NOT NULL , \n\t`annmsg_id` INTEGER,\n\t`postdest` VARCHAR( 255 ) NULL , \n\t`dring` VARCHAR ( 255 ) NULL , \n\t`remotealert_id` INTEGER,\n\t`needsconf` VARCHAR ( 10 ), \n\t`toolate_id` INTEGER,\n\t`pre_ring` SMALLINT NOT NULL DEFAULT 0, \n\tPRIMARY KEY (`grpnum`) \n)\n"; $check = $db->query($sql); if (DB::IsError($check)) { die_freepbx("Can not create annoucment table"); } //TODO: Also need to create all the states if enabled $fcc = new featurecode('findmefollow', 'fmf_toggle'); $fcc->setDescription('Findme Follow Toggle'); $fcc->setDefault('*21'); $fcc->update(); unset($fcc); // Adding support for a pre_ring before follow-me group $sql = "SELECT pre_ring FROM findmefollow"; $check = $db->getRow($sql, DB_FETCHMODE_ASSOC); if (DB::IsError($check)) { // add new field $sql = "ALTER TABLE findmefollow ADD pre_ring SMALLINT( 6 ) NOT NULL DEFAULT 0 ;"; $result = $db->query($sql); if (DB::IsError($result)) { die_freepbx($result->getDebugInfo()); } } // If there is no needsconf then this is a really old upgrade. We create the 2 old fields // here and then the migration code below will change them as needed but will work properly
} else { echo "The file {$filename} is not writable"; } ?> Verifying / Installing cronjob into the FreePBX cron manager.<br> <?php $sql = "SELECT * FROM `cronmanager` WHERE `module` = 't' LIMIT 1;"; $res = $db->query($sql); if ($res->numRows() != 1) { $sql = "INSERT INTO\tcronmanager (module,id,time,freq,command) VALUES ('xtide','every_day',23,24,'/usr/bin/find /var/lib/asterisk/sounds/tts -name \"*.wav\" -mtime +1 -exec rm {} \\\\;')"; $check = $db->query($sql); if (DB::IsError($check)) { die_freepbx("Can not create values in cronmanager table: " . $check->getMessage() . "\n"); } } ?> Verifying / Creating TTS Folder.<br> <?php $parm_tts_dir = '/var/lib/asterisk/sounds/tts'; if (!is_dir($parm_tts_dir)) { mkdir($parm_tts_dir, 0775); } ?> Creating Feature Code.<br> <?php // Register FeatureCode - Xtide Reports; $fcc = new featurecode('xtide', 'xtide'); $fcc->setDescription('Xtide Reports'); $fcc->setDefault('8433'); $fcc->update(); unset($fcc);
_("Directory"); _("Call Trace"); _("Echo Test"); _("Speaking Clock"); _("Speak Your Exten Number"); } $fcc = new featurecode('infoservices', 'directory'); $fcc->setDescription('Directory'); $fcc->setDefault('#'); $fcc->update(); unset($fcc); $fcc = new featurecode('infoservices', 'calltrace'); $fcc->setDescription('Call Trace'); $fcc->setDefault('*69'); $fcc->update(); unset($fcc); $fcc = new featurecode('infoservices', 'echotest'); $fcc->setDescription('Echo Test'); $fcc->setDefault('*43'); $fcc->update(); unset($fcc); $fcc = new featurecode('infoservices', 'speakingclock'); $fcc->setDescription('Speaking Clock'); $fcc->setDefault('*60'); $fcc->update(); unset($fcc); $fcc = new featurecode('infoservices', 'speakextennum'); $fcc->setDescription('Speak Your Exten Number'); $fcc->setDefault('*65'); $fcc->update(); unset($fcc);
function daynight_edit($post, $id = 0) { global $db; // TODO: Probably have separate add and edit (and change in page.daynight.php also) // Need to set the day/night mode in the system if new // Delete all the old dests if ($post['action'] != "add") { sql("DELETE FROM daynight WHERE dmode IN ('day', 'night', 'password', 'fc_description','day_recording_id','night_recording_id') AND ext = {$id}"); } $day = isset($post[$post['goto0'] . '0']) ? $post[$post['goto0'] . '0'] : ''; $night = isset($post[$post['goto1'] . '1']) ? $post[$post['goto1'] . '1'] : ''; sql("INSERT INTO daynight (ext, dmode, dest) VALUES ({$id}, 'day', '{$day}')"); sql("INSERT INTO daynight (ext, dmode, dest) VALUES ({$id}, 'night', '{$night}')"); if (isset($post['password']) && trim($post['password'] != "")) { $password = trim($post['password']); sql("INSERT INTO daynight (ext, dmode, dest) VALUES ({$id}, 'password', '{$password}')"); } $fc_description = isset($post['fc_description']) ? trim($post['fc_description']) : ""; sql("INSERT INTO daynight (ext, dmode, dest) VALUES ({$id}, 'fc_description', '" . $db->escapeSimple($fc_description) . "')"); $day_recording_id = isset($post['day_recording_id']) ? trim($post['day_recording_id']) : ""; sql("INSERT INTO daynight (ext, dmode, dest) VALUES ({$id}, 'day_recording_id', '{$day_recording_id}')"); $night_recording_id = isset($post['night_recording_id']) ? trim($post['night_recording_id']) : ""; sql("INSERT INTO daynight (ext, dmode, dest) VALUES ({$id}, 'night_recording_id', '{$night_recording_id}')"); $dn = new dayNightObject($id); $dn->del(); $dn->create($post['state']); $fcc = new featurecode('daynight', 'toggle-mode-' . $id); if ($fc_description) { $fcc->setDescription("{$id}: {$fc_description}"); } else { $fcc->setDescription("{$id}: Call Flow Toggle Control"); } $fcc->setDefault('*28' . $id); $fcc->setProvideDest(); $fcc->update(); unset($fcc); needreload(); }
$id = $item['timeconditions_id']; $displayname = $item['displayname']; $fcc = new featurecode('timeconditions', 'toggle-mode-' . $id); if ($displayname) { $fcc->setDescription("{$id}: {$displayname}"); } else { $fcc->setDescription($id . _(": Time Condition Override")); } $fcc->setDefault('*27' . $id); $fcc->update(); unset($fcc); } } $fcc = new featurecode('timeconditions', 'toggle-mode-all'); $fcc->setDescription("All: Time Condition Override"); $fcc->setDefault('*27'); $fcc->update(); unset($fcc); out(_("OK")); // bring db up to date on install/upgrade // function timeconditions_updatedb() { $ver = modules_getversion('timeconditions'); if ($ver !== null && version_compare_freepbx($ver, '2.5', 'lt')) { outn(_("Checking for old timeconditions to upgrade..")); $upgradelist = timeconditions_list_forupgrade(); if (isset($upgradelist)) { // we have old conditions to upgrade // out(_("starting migration"));
<?php if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } global $db; global $amp_conf; $fcc = new featurecode('conferences', 'conf_status'); $fcc->setDescription('Conference Status'); $fcc->setDefault('*87'); $fcc->update(); unset($fcc);
// Add Feature Codes for Toggle Queues - Using *45 $fcc = new featurecode('queues', 'que_toggle'); $fcc->setDescription(_('Allow Dynamic Members of a Queue to login or logout. See the Queues Module for how to assign a Dynamic Member to a Queue.')); $fcc->setDefault('*45'); $fcc->update(); unset($fcc); // Add Feature Codes for Toggle Queue Pause- Using *46 $fcc = new featurecode('queues', 'que_pause_toggle'); $fcc->setDescription(_('Queue Pause Toggle')); $fcc->setDefault('*46'); $fcc->update(); unset($fcc); // Add Feature Codes for Queue Callers - Using *47 $fcc = new featurecode('queues', 'que_callers'); $fcc->setDescription(_('Playback Queue Caller Count')); $fcc->setDefault('*47'); $fcc->update(); unset($fcc); $results = array(); $sql = "SELECT args, extension, priority FROM extensions WHERE context = 'ext-queues' AND descr = 'jump'"; $results = $db->getAll($sql, DB_FETCHMODE_ASSOC); if (!DB::IsError($results)) { // error - table must not be there foreach ($results as $result) { $old_dest = $result['args']; $extension = $result['extension']; $priority = $result['priority']; $new_dest = merge_ext_followme(trim($old_dest)); if ($new_dest != $old_dest) { $sql = "UPDATE extensions SET args = '{$new_dest}' WHERE extension = '{$extension}' AND priority = '{$priority}' AND context = 'ext-queues' AND descr = 'jump' AND args = '{$old_dest}'"; $results = $db->query($sql);
<?php //for translation only if (false) { _("Dictation"); _("Perform dictation"); _("Email completed dictation"); } // Register Feature Code - Perform Dictation $fcc = new featurecode('dictate', 'dodictate'); $fcc->setDescription('Perform dictation'); $fcc->setDefault('*34'); $fcc->update(); unset($fcc); // Email dictation to user $fcc = new featurecode('dictate', 'senddictate'); $fcc->setDescription('Email completed dictation'); $fcc->setDefault('*35'); $fcc->update(); unset($fcc);
} unset($fcc); // If we found the old one then we must create all the new ones // if ($delete_old) { $list = daynight_list(); foreach ($list as $item) { $id = $item['ext']; $fc_description = $item['dest']; $fcc = new featurecode('daynight', 'toggle-mode-' . $id); if ($fc_description) { $fcc->setDescription("{$id}: {$fc_description}"); } else { $fcc->setDescription("{$id}: Day Night Control"); } $fcc->setDefault('*28' . $id); if ($code != '*28' && $code != '') { $fcc->setCode($code . $id); } if (!$enabled) { $fcc->setEnabled(false); } $fcc->update(); unset($fcc); } } // Sqlite3 does not like this syntax, but no migration needed since it started in 2.5 // if ($amp_conf["AMPDBENGINE"] != "sqlite3") { outn(_("changing primary keys to all fields..")); $sql = 'ALTER TABLE `daynight` DROP PRIMARY KEY , ADD PRIMARY KEY ( `ext` , `dmode` , `dest` )';
public function createFeatureCode($id, $displayname = '') { $fcc = new \featurecode('timeconditions', 'toggle-mode-' . $id); if ($displayname) { $fcc->setDescription("{$id}: {$displayname}"); } else { $fcc->setDescription($id . _(": Time Condition Override")); } $fcc->setDefault('*27' . $id); $fcc->setProvideDest(); $fcc->update(); unset($fcc); $this->setState($id, ''); }
_("Voicemail"); _("My Voicemail"); _("Dial Voicemail"); } global $astman; global $amp_conf; // Register FeatureCode - Activate $fcc = new featurecode('voicemail', 'myvoicemail'); $fcc->setDescription('My Voicemail'); $fcc->setDefault('*97'); $fcc->update(); unset($fcc); // Register FeatureCode - Deactivate $fcc = new featurecode('voicemail', 'dialvoicemail'); $fcc->setDescription('Dial Voicemail'); $fcc->setDefault('*98'); $fcc->update(); unset($fcc); //1.6.2 $ver = modules_getversion('voicemail'); if ($ver !== null && version_compare($ver, '1.6.2', 'lt')) { //we have to fix existing users with wrong values for vm ticket #1697 if ($astman) { $sql = "select * from users where voicemail='disabled' or voicemail='';"; $users = sql($sql, "getAll", DB_FETCHMODE_ASSOC); foreach ($users as $user) { $astman->database_put("AMPUSER", $user['extension'] . "/voicemail", "\"novm\""); } } else { echo _("Cannot connect to Asterisk Manager with ") . $amp_conf["AMPMGRUSER"] . "/" . $amp_conf["AMPMGRPASS"]; return false;
{ echo $text; } } $recordings_astsnd_path = isset($amp_conf['ASTVARLIBDIR']) ? $amp_conf['ASTVARLIBDIR'] : '/var/lib/asterisk'; $recordings_astsnd_path .= "/sounds/"; $autoincrement = $amp_conf["AMPDBENGINE"] == "sqlite" || $amp_conf["AMPDBENGINE"] == "sqlite3" ? "AUTOINCREMENT" : "AUTO_INCREMENT"; require_once $amp_conf['AMPWEBROOT'] . '/admin/modules/recordings/functions.inc.php'; $fcc = new featurecode('recordings', 'record_save'); $fcc->setDescription('Save Recording'); $fcc->setDefault('*77'); $fcc->update(); unset($fcc); $fcc = new featurecode('recordings', 'record_check'); $fcc->setDescription('Check Recording'); $fcc->setDefault('*99'); $fcc->update(); unset($fcc); // Make sure table exists if ($amp_conf["AMPDBENGINE"] == 'sqlite3') { $sql = "CREATE TABLE IF NOT EXISTS recordings ( \n\t\t`id` integer NOT NULL PRIMARY KEY AUTOINCREMENT, \n\t\tdisplayname VARCHAR(50) , filename BLOB, description \n\t\tVARCHAR(254))\n\t;"; } else { $sql = "CREATE TABLE IF NOT EXISTS recordings ( \n\t\tid INTEGER NOT NULL PRIMARY KEY {$autoincrement},\n\t\tdisplayname VARCHAR(50) , \n\t\tfilename BLOB, \n\t\tdescription VARCHAR(254))\n\t;"; } $result = $db->query($sql); if (DB::IsError($result)) { die_freepbx($result->getDebugInfo()); } // load up any recordings that might be in the directory $recordings_directory = $recordings_astsnd_path . "custom/"; if (!file_exists($recordings_directory)) {
} else { out(_("unknown error")); } } else { out(_("done")); } outn(_("Updating simu_fax in miscdest table..")); $check = $db->query("UPDATE miscdests set destdial = '{fax:simu_fax}' WHERE destdial = '{core:simu_fax}'"); if (DB::IsError($check)) { out(_("not needed")); } else { out(_("done")); } $fcc = new featurecode('fax', 'simu_fax'); $fcc->setDescription('Dial System FAX'); $fcc->setDefault('666'); $fcc->setProvideDest(); $fcc->update(); unset($fcc); //check to make sure that min/maxrate and ecm are set; if not set them to defaults $settings = sql('SELECT * FROM fax_details', 'getAssoc', 'DB_FETCHMODE_ASSOC'); foreach ($settings as $setting => $value) { $set[$setting] = $value['0']; } if (!is_array($set)) { $set = array(); } //never return a null value if (!$set['minrate']) { $sql[] = 'REPLACE INTO fax_details (`key`, `value`) VALUES ("minrate","14400")'; }
public function edit($miscapps_id, $description, $ext, $dest, $enabled = true) { $db = $this->db; $sql = 'UPDATE miscapps SET description = ?, ext = ?, dest = ? WHERE miscapps_id = ?'; $q = $db->prepare($sql); $q->execute(array($description, $ext, $dest, $miscapps_id)); if ($q) { $fc = new \featurecode('miscapps', 'miscapp_' . $miscapps_id); $fc->setDescription($description); $fc->setDefault($ext, true); $fc->setEnabled($enabled); $fc->update(); } }
/** * Update Recording by ID * @param integer $id The recording ID * @param string $name The recording short name * @param string $description The recording long name * @param string $files & separated list of files to playback * @param integer $fcode Feature Code number_format * @param string $fcode_pass Feature code password */ public function updateRecording($id, $name, $description, $files, $fcode = 0, $fcode_pass = '') { $sql = "UPDATE recordings SET displayname = ?, description = ?, filename = ?, fcode = ?, fcode_pass = ? WHERE id = ?"; $sth = $this->db->prepare($sql); $sth->execute(array($name, $description, $files, $fcode, $fcode_pass, $id)); if ($fcode != 1) { // delete the feature code if it existed // $fcc = new \featurecode('recordings', 'edit-recording-' . $id); $fcc->delete(); unset($fcc); } else { // Add the feature code if it is needed // $fcc = new \featurecode('recordings', 'edit-recording-' . $id); $fcc->setDescription("Edit Recording: {$name}"); $fcc->setDefault('*29' . $id); $fcc->setProvideDest(); $fcc->update(); unset($fcc); } needreload(); }
out('Removed no longer needed column ' . $row[0] . ' from hotelwakeup_calls table'); } } } //add missing columns to the hotelwakeup_calls table foreach ($sc_cols as $key => $val) { if (!in_array($key, $sc_curret_cols)) { $sql = "ALTER TABLE hotelwakeup_calls ADD " . $key . " " . $val; $check = $db->query($sql); if (DB::IsError($check)) { die_freepbx("Can not add column " . $key . ": " . $check->getMessage() . "<br>"); } else { out('Added column ' . $key . ' to hotelwakeup_calls table'); } } } // Set default values - need mechanism to prevent overwriting existing values out("Installing Default Values"); $sql = "INSERT INTO hotelwakeup (maxretries, waittime, retrytime, cnam, cid, operator_mode, operator_extensions, extensionlength, application, data) "; $sql .= " VALUES ('3', '60', '60', 'Wake Up Calls', '*68', '1', '00 , 01', '4', 'AGI', 'wakeconfirm.php')"; $check = $db->query($sql); // Removed the following check because it prevents install if the query above fails to overwrite existing values. //if (DB::IsError($check)) { // die_freepbx( "Can not create default values in `hotelwakeup` table: " . $check->getMessage() . "\n"); //} // Register FeatureCode - Hotel Wakeup; $fcc = new featurecode('hotelwakeup', 'hotelwakeup'); $fcc->setDescription('Wake Up Calls'); $fcc->setDefault('*68'); $fcc->update(); unset($fcc);
$fcc->setDefault('##'); $fcc->update(); unset($fcc); $fcc = new featurecode('core', 'atxfer'); $fcc->setDescription('In-Call Asterisk Attended Transfer'); $fcc->setDefault('*2'); $fcc->update(); unset($fcc); $fcc = new featurecode('core', 'automon'); $fcc->setDescription('In-Call Asterisk Toggle Call Recording'); $fcc->setDefault('*1'); $fcc->update(); unset($fcc); $fcc = new featurecode('core', 'disconnect'); $fcc->setDescription('In-Call Asterisk Disconnect Code'); $fcc->setDefault('**'); $fcc->update(); unset($fcc); // Version 2.5 Upgrade needs to migrate directdid user info to incoming table // outn(_("Checking if directdids need migrating..")); $sql = "SELECT `directdid` FROM `users`"; $check = $db->getRow($sql, DB_FETCHMODE_ASSOC); if (!DB::IsError($check)) { out(_("starting migration")); $errors = 0; $sql = "SELECT * FROM `users` WHERE `directdid` != '' AND `directdid` IS NOT NULL"; $direct_dids_arr = $db->getAll($sql, DB_FETCHMODE_ASSOC); if (!DB::IsError($direct_dids_arr)) { foreach ($direct_dids_arr as $direct_dids) { $did_vars['destination'] = 'from-did-direct,' . $direct_dids['extension'] . ',1';
$sql = "DELETE FROM globals WHERE `variable` = 'VM_PREFIX'"; out(_("migrated VM_PREFIX to feature codes")); outn(_("deleting VM_PREFIX from globals..")); $res = $db->query($sql); if (!DB::IsError($globals)) { out(_("done")); } else { out(_("could not delete")); } } } // Now setup the new feature code, if blank then disable // $fcc = new featurecode('voicemail', 'directdialvoicemail'); $fcc->setDescription('Direct Dial Prefix'); $fcc->setDefault($default_prefix); if ($current_prefix != $default_prefix) { if ($current_prefix != '') { $fcc->setCode($current_prefix); } else { $fcc->setEnabled(false); } } $fcc->update(); unset($fcc); //1.6.2 $ver = modules_getversion('voicemail'); if ($ver !== null && version_compare($ver, '1.6.2', 'lt')) { //we have to fix existing users with wrong values for vm ticket #1697 if ($astman) { $sql = "select * from users where voicemail='disabled' or voicemail='';";
function miscapps_edit($miscapps_id, $description, $ext, $dest, $enabled = true) { global $db; $sql = "UPDATE miscapps SET " . "description = '" . $db->escapeSimple($description) . "', " . "ext = '" . $db->escapeSimple($ext) . "', " . "dest = '" . $db->escapeSimple($dest) . "' " . "WHERE miscapps_id = " . $db->escapeSimple($miscapps_id); $result = $db->query($sql); if (DB::IsError($result)) { die_freepbx($result->getMessage() . $sql); } $fc = new featurecode('miscapps', 'miscapp_' . $miscapps_id); $fc->setDescription($description); $fc->setDefault($ext, true); $fc->setEnabled($enabled); $fc->update(); }
// but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with FreePBX. If not, see <http://www.gnu.org/licenses/>. // // Copyright (C) 2006 Magnus Ullberg (magnus@ullberg.us) // // For translations if (false) { _("Blacklist a number"); _("Remove a number from the blacklist"); _("Blacklist the last caller"); _("Blacklist"); } $fcc = new featurecode('blacklist', 'blacklist_add'); $fcc->setDescription('Blacklist a number'); $fcc->setDefault('*30'); $fcc->update(); unset($fcc); $fcc = new featurecode('blacklist', 'blacklist_remove'); $fcc->setDescription('Remove a number from the blacklist'); $fcc->setDefault('*31'); $fcc->update(); unset($fcc); $fcc = new featurecode('blacklist', 'blacklist_last'); $fcc->setDescription('Blacklist the last caller'); $fcc->setDefault('*32'); $fcc->update(); unset($fcc);
<?php if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } //for translation only if (false) { _("Phonebook dial-by-name directory"); } // Enable phonebook directory as a feature code $fcc = new featurecode('pbdirectory', 'app-pbdirectory'); $fcc->setDescription('Phonebook dial-by-name directory'); $fcc->setDefault('411'); $fcc->setProvideDest(); $fcc->update(); unset($fcc);
<?php //for translation only if (false) { _("Connect to Gabcast"); } // Enable direct dial to Gabcast as a feature code $connecttogabcast = _("Connect to Gabcast"); $fcc = new featurecode('gabcast', 'gabdial'); $fcc->setDescription('Connect to Gabcast'); $fcc->setDefault('*422'); $fcc->update(); unset($fcc);
// the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // FreePBX is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with FreePBX. If not, see <http://www.gnu.org/licenses/>. // // Copyright (C) 2005 mheydon1973 // //for translation only if (false) { _("Call Waiting"); _("Call Waiting - Activate"); _("Call Waiting - Deactivate"); } // Register FeatureCode - Activate $fcc = new featurecode('callwaiting', 'cwon'); $fcc->setDescription('Call Waiting - Activate'); $fcc->setDefault('*70'); $fcc->update(); unset($fcc); // Register FeatureCode - Deactivate $fcc = new featurecode('callwaiting', 'cwoff'); $fcc->setDescription('Call Waiting - Deactivate'); $fcc->setDefault('*71'); $fcc->update(); unset($fcc);
<?php if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } //for translation only if (false) { _("Speed Dial Functions"); _("Speeddial prefix"); _("Set user speed dial"); } // Enable phonebook directory as a feature code $fcc = new featurecode('speeddial', 'callspeeddial'); $fcc->setDescription('Speeddial prefix'); $fcc->setDefault('*0'); $fcc->update(); unset($fcc); $fcc = new featurecode('speeddial', 'setspeeddial'); $fcc->setDescription('Set user speed dial'); $fcc->setDefault('*75'); $fcc->update(); unset($fcc);