本文整理汇总了PHP中core_users_list函数的典型用法代码示例。如果您正苦于以下问题:PHP core_users_list函数的具体用法?PHP core_users_list怎么用?PHP core_users_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了core_users_list函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: usermanShowPage
public function usermanShowPage()
{
if (isset($_REQUEST['action'])) {
switch ($_REQUEST['action']) {
case 'showuser':
$user = $this->getUserByID($_REQUEST['user']);
if (isset($_POST['submit']) || isset($_POST['submittype'])) {
$this->processModuleConfigPages($user);
$this->expireUserSessions($_REQUEST['user']);
}
if (!empty($_REQUEST['deletesession'])) {
$this->expireUserSession($_REQUEST['deletesession']);
$this->setUsermanMessage(_('Deleted User Session'), 'success');
}
$fpbxusers = array();
$cul = array();
foreach (core_users_list() as $list) {
$cul[$list[0]] = array("name" => $list[1]);
}
$sassigned = $this->getSetting($user['username'], 'Settings', 'assigned');
$sassigned = !empty($sassigned) ? $sassigned : array();
foreach ($user['assigned'] as $assigned) {
$fpbxusers[] = array("ext" => $assigned, "data" => $cul[$assigned], "selected" => in_array($assigned, $sassigned));
}
return load_view(dirname(__FILE__) . '/views/users_hook.php', array("fpbxusers" => $fpbxusers, "mHtml" => $this->constructModuleConfigPages($user), "user" => $user, "allowLogin" => FreePBX::create()->Userman->getModuleSettingByID($_REQUEST['user'], 'ucp|Global', 'allowLogin'), "sessions" => $this->getUserSessions($user['id'])));
break;
case 'adduser':
if (isset($_POST['submit'])) {
$user = $this->getUserByUsername($_REQUEST['username']);
$this->processModuleConfigPages($user);
}
$fpbxusers = array();
$cul = array();
foreach (core_users_list() as $list) {
$cul[$list[0]] = array("name" => $list[1]);
}
return load_view(dirname(__FILE__) . '/views/users_hook.php', array("fpbxusers" => $fpbxusers, "mHtml" => $this->constructModuleConfigPages($user), "user" => array(), "allowLogin" => true, "sessions" => array()));
break;
default:
break;
}
}
}
示例2: getUCPAdminDisplay
/**
* get the Admin display in UCP
* @param array $user The user array
*/
public function getUCPAdminDisplay($user)
{
$fpbxusers = array();
$cul = array();
foreach (core_users_list() as $list) {
$cul[$list[0]] = array("name" => $list[1], "vmcontext" => $list[2]);
}
$download = $this->FreePBX->Ucp->getSetting($user['username'], 'Cdr', 'download');
$playback = $this->FreePBX->Ucp->getSetting($user['username'], 'Cdr', 'playback');
$download = is_null($download) ? true : $download;
$playback = is_null($playback) ? true : $playback;
$cdrassigned = $this->FreePBX->Ucp->getSetting($user['username'], 'Cdr', 'assigned');
$cdrassigned = !empty($cdrassigned) ? $cdrassigned : array();
foreach ($user['assigned'] as $assigned) {
$fpbxusers[] = array("ext" => $assigned, "data" => $cul[$assigned], "selected" => in_array($assigned, $cdrassigned));
}
$html[0]['description'] = '<a href="#" class="info">' . _("Allowed CDR") . ':<span>' . _("These are the assigned and active extensions which will show up for this user to control and edit in UCP") . '</span></a>';
$html[0]['content'] = load_view(dirname(__FILE__) . "/views/ucp_config.php", array("fpbxusers" => $fpbxusers));
$html[1]['description'] = '<a href="#" class="info">' . _("Allow CDR Playback") . ':<span>' . _("Allow this user to playback recordings in UCP") . '</span></a>';
$html[1]['content'] = load_view(dirname(__FILE__) . "/views/ucp_config_playback.php", array("playback" => $playback));
$html[2]['description'] = '<a href="#" class="info">' . _("Allow CDR Downloads") . ':<span>' . _("Allow users to download recordings in UCP") . '</span></a>';
$html[2]['content'] = load_view(dirname(__FILE__) . "/views/ucp_config_downloads.php", array("download" => $download));
return $html;
}
示例3: core_users_list
<?php
/* $Id: page.extensions.php 7630 2009-05-03 08:37:52Z mickecarlsson $ */
//This file is part of FreePBX.
//
// FreePBX is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// 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) 2004 Coalescent Systems Inc. (info@coalescentsystems.ca)
//
?>
<div class="rnav">
<?php
$extens = core_users_list();
$description = _("Extension");
drawListMenu($extens, $skip, $type, $display, $extdisplay, $description);
?>
<br />
</div>
示例4: generate_module_repo_url
/**
* function generate_module_repo_url
* short create array of full URLs to get a file from repo
* use this function to generate an array of URLs for all configured REPOs
* @author Philippe Lindheimer
*
* @pram string
* @returns string
*/
function generate_module_repo_url($path, $add_options = false)
{
global $db;
global $amp_conf;
$urls = array();
if ($add_options) {
$firstinstall = false;
$type = null;
$sql = "SELECT * FROM module_xml WHERE id = 'installid'";
$result = sql($sql, 'getRow', DB_FETCHMODE_ASSOC);
// if not set so this is a first time install
// get a new hash to account for first time install
//
if (!isset($result['data']) || trim($result['data']) == "") {
$firstinstall = true;
$install_hash = _module_generate_unique_id();
$installid = $install_hash['uniqueid'];
$type = $install_hash['type'];
// save the hash so we remeber this is a first time install
//
$data4sql = $db->escapeSimple($installid);
sql("INSERT INTO module_xml (id,time,data) VALUES ('installid'," . time() . ",'" . $data4sql . "')");
$data4sql = $db->escapeSimple($type);
sql("INSERT INTO module_xml (id,time,data) VALUES ('type'," . time() . ",'" . $data4sql . "')");
// Not a first time so save the queried hash and check if there is a type set
//
} else {
$installid = $result['data'];
$sql = "SELECT * FROM module_xml WHERE id = 'type'";
$result = sql($sql, 'getRow', DB_FETCHMODE_ASSOC);
if (isset($result['data']) && trim($result['data']) != "") {
$type = $result['data'];
}
}
// Now we have the id and know if this is a firstime install so we can get the announcement
//
$options = "?installid=" . urlencode($installid);
if (trim($type) != "") {
$options .= "&type=" . urlencode($type);
}
if ($firstinstall) {
$options .= "&firstinstall=yes";
}
// We check specifically for false because evenif blank it means the file
// was there so we want module.xml to do appropriate actions
$brandid = _module_brandid();
if ($brandid !== false) {
$options .= "&brandid=" . urlencode($brandid);
}
$deploymentid = _module_deploymentid();
if ($deploymentid !== false) {
$options .= "&depolymentid=" . urlencode($deploymentid);
}
$engver = engine_getinfo();
if ($engver['engine'] == 'asterisk' && trim($engver['engine']) != "") {
$options .= "&astver=" . urlencode($engver['version']);
} else {
$options .= "&astver=" . urlencode($engver['raw']);
}
$options .= "&phpver=" . urlencode(phpversion());
$distro_info = _module_distro_id();
$options .= "&distro=" . urlencode($distro_info['pbx_type']);
$options .= "&distrover=" . urlencode($distro_info['pbx_version']);
$options .= "&fpbxver=" . urlencode(getversion());
if (function_exists('core_users_list')) {
$options .= "&ucount=" . urlencode(count(core_users_list()));
}
$path .= $options;
// Other modules may need to add 'get' paramters to the call to the repo. Check and add them
// here if we are adding paramters. The module should return an array of key/value pairs each of which
// is to be appended to the GET parameters. The variable name will be prepended with the module name
// when sent.
//
$repo_params = array();
foreach (mod_func_iterator('module_repo_parameters_callback', $path) as $mod => $res) {
if (is_array($res)) {
foreach ($res as $p => $v) {
$path .= '&' . urlencode($mod) . '_' . urlencode($p) . '=' . urlencode($v);
}
}
}
}
$repos = explode(',', $amp_conf['MODULE_REPO']);
foreach ($repos as $repo) {
$urls[] = $repo . $path;
}
return $urls;
}
示例5: myShowPage
public function myShowPage()
{
if (!function_exists('core_users_list')) {
return _("Module Core is disabled. Please enable it");
}
$module_hook = \moduleHook::create();
$mods = $this->FreePBX->Hooks->processHooks();
$moduleHtml = '';
foreach ($mods as $mod) {
$moduleHtml .= $mod;
}
$action = !empty($_REQUEST['action']) ? $_REQUEST['action'] : '';
$html = '';
$users = $this->getAllUsers();
$html .= load_view(dirname(__FILE__) . '/views/rnav.php', array("users" => $users));
switch ($action) {
case 'showuser':
case 'adduser':
if ($action == 'showuser' && !empty($_REQUEST['user'])) {
$user = $this->getUserByID($_REQUEST['user']);
$assigned = $this->getGlobalSettingByID($_REQUEST['user'], 'assigned');
$assigned = !empty($assigned) ? $assigned : array();
$default = $user['default_extension'];
} else {
$user = array();
$assigned = array();
$default = null;
}
$fpbxusers = array();
$dfpbxusers = array();
$cul = array();
foreach (core_users_list() as $list) {
$cul[$list[0]] = array("name" => $list[1], "vmcontext" => $list[2]);
}
foreach ($cul as $e => $u) {
$fpbxusers[] = array("ext" => $e, "name" => $u['name'], "selected" => in_array($e, $assigned));
}
$iuext = $this->getAllInUseExtensions();
$dfpbxusers[] = array("ext" => 'none', "name" => 'none', "selected" => false);
foreach ($cul as $e => $u) {
if ($e != $default && in_array($e, $iuext)) {
continue;
}
$dfpbxusers[] = array("ext" => $e, "name" => $u['name'], "selected" => $e == $default);
}
$html .= load_view(dirname(__FILE__) . '/views/users.php', array("dfpbxusers" => $dfpbxusers, "fpbxusers" => $fpbxusers, "moduleHtml" => $moduleHtml, "hookHtml" => $module_hook->hookHtml, "user" => $user, "message" => $this->message));
break;
case 'general':
$html .= load_view(dirname(__FILE__) . '/views/general.php', array("subject" => $this->getGlobalsetting('emailsubject'), "email" => $this->getGlobalsetting('emailbody'), "message" => $this->message, "brand" => $this->brand));
break;
default:
$html .= load_view(dirname(__FILE__) . '/views/welcome.php', array());
break;
}
return $html;
}
示例6: _
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span id="audio_label-help" class="help-block fpbx-help-block">' . _("Play this message to the caller so they can confirm they have dialed the proper voice mail group number, or have the system simply read the group number.") . '</span>
</div>
</div>
</div>
<!--END Audio Label-->
';
} else {
$default = isset($audio_label) ? $audio_label : -1;
$alabelhtml = '<input type="hidden" name="audio_label" value="' . $default . '">';
}
$results = core_users_list();
if (!is_array($results)) {
$results = array();
}
foreach ($results as $result) {
if ($result[2] != 'novm') {
$extenlopts .= '<option value="' . $result[0] . '" ';
if (array_search($result[0], $grplist) !== false) {
$extenlopts .= ' SELECTED ';
}
$extenlopts .= '>' . $result[0] . ' (' . $result[1] . ')</option>';
}
}
echo $usagehtml;
?>
示例7: get_users
/**
* @verb GET
* @return - a list of users
* @uri /core/users
*/
function get_users()
{
return core_users_list();
}
示例8: core_devices_configpageinit
//.........这里部分代码省略.........
$tmparr = array();
$tmparr['channel'] = array('value' => '', 'level' => 0, 'jsvalidation' => 'isEmpty()', 'failvalidationmsg' => $msgInvalidChannel);
$tmparr['context'] = array('value' => 'from-internal', 'level' => 1);
$tmparr['immediate'] = array('value' => 'no', 'level' => 1);
$tmparr['signalling'] = array('value' => 'fxo_ks', 'level' => 1);
$tmparr['echocancel'] = array('value' => 'yes', 'level' => 1);
$tmparr['echocancelwhenbridged'] = array('value' => 'no', 'level' => 1);
$tmparr['echotraining'] = array('value' => '800', 'level' => 1);
$tmparr['busydetect'] = array('value' => 'no', 'level' => 1);
$tmparr['busycount'] = array('value' => '7', 'level' => 1);
$tmparr['callprogress'] = array('value' => 'no', 'level' => 1);
$tmparr['dial'] = array('value' => '', 'level' => 1);
$tmparr['accountcode'] = array('value' => '', 'level' => 1);
$tmparr['callgroup'] = array('value' => '', 'level' => 1);
$tmparr['pickupgroup'] = array('value' => '', 'level' => 1);
$tmparr['mailbox'] = array('value' => '', 'level' => 1);
$currentcomponent->addgeneralarrayitem('devtechs', 'dahdi', $tmparr);
unset($tmparr);
// iax2
$tmparr = array();
$tmparr['secret'] = array('value' => '', 'level' => 0, 'jsvalidation' => 'isEmpty() && !confirm("' . $msgConfirmSecret . '")', 'failvalidationmsg' => $msgInvalidSecret);
$tmparr['secret'] = array('value' => '', 'level' => 0, 'jsvalidation' => '(isEmpty() && !confirm("' . $msgConfirmSecret . '")) || (!isEmpty() && weakSecret())', 'failvalidationmsg' => $msgInvalidSecret);
$tmparr['notransfer'] = array('value' => 'yes', 'level' => 1);
$tmparr['context'] = array('value' => 'from-internal', 'level' => 1);
$tmparr['host'] = array('value' => 'dynamic', 'level' => 1);
$tmparr['type'] = array('value' => 'friend', 'level' => 1);
$tmparr['port'] = array('value' => '4569', 'level' => 1);
$tmparr['qualify'] = array('value' => 'yes', 'level' => 1);
$tmparr['disallow'] = array('value' => '', 'level' => 1);
$tmparr['allow'] = array('value' => '', 'level' => 1);
$tmparr['dial'] = array('value' => '', 'level' => 1);
$tmparr['accountcode'] = array('value' => '', 'level' => 1);
$tmparr['mailbox'] = array('value' => '', 'level' => 1);
$tmparr['deny'] = array('value' => '0.0.0.0/0.0.0.0', 'level' => 1);
$tmparr['permit'] = array('value' => '0.0.0.0/0.0.0.0', 'level' => 1);
$tmparr['requirecalltoken'] = array('value' => '', 'level' => 1);
$currentcomponent->addgeneralarrayitem('devtechs', 'iax2', $tmparr);
unset($tmparr);
// sip
$tmparr = array();
$tmparr['secret'] = array('value' => '', 'level' => 0, 'jsvalidation' => '(isEmpty() && !confirm("' . $msgConfirmSecret . '")) || (!isEmpty() && weakSecret())', 'failvalidationmsg' => $msgInvalidSecret);
$tmparr['dtmfmode'] = array('value' => 'rfc2833', 'level' => 0, 'jsvalidation' => 'isEmpty()', 'failvalidationmsg' => $msgInvalidDTMFMODE);
$tmparr['canreinvite'] = array('value' => 'no', 'level' => 1);
$tmparr['context'] = array('value' => 'from-internal', 'level' => 1);
$tmparr['host'] = array('value' => 'dynamic', 'level' => 1);
$tmparr['type'] = array('value' => 'friend', 'level' => 1);
$tmparr['nat'] = array('value' => 'yes', 'level' => 1);
$tmparr['port'] = array('value' => '5060', 'level' => 1);
$tmparr['qualify'] = array('value' => 'yes', 'level' => 1);
$tmparr['callgroup'] = array('value' => '', 'level' => 1);
$tmparr['pickupgroup'] = array('value' => '', 'level' => 1);
$tmparr['disallow'] = array('value' => '', 'level' => 1);
$tmparr['allow'] = array('value' => '', 'level' => 1);
$tmparr['dial'] = array('value' => '', 'level' => 1);
$tmparr['accountcode'] = array('value' => '', 'level' => 1);
$tmparr['mailbox'] = array('value' => '', 'level' => 1);
$tmparr['vmexten'] = array('value' => '', 'level' => 1);
$tmparr['deny'] = array('value' => '0.0.0.0/0.0.0.0', 'level' => 1);
$tmparr['permit'] = array('value' => '0.0.0.0/0.0.0.0', 'level' => 1);
$currentcomponent->addgeneralarrayitem('devtechs', 'sip', $tmparr);
unset($tmparr);
// custom
$tmparr = array();
$tmparr['dial'] = array('value' => '', 'level' => 0);
$currentcomponent->addgeneralarrayitem('devtechs', 'custom', $tmparr);
unset($tmparr);
// Devices list
if ($_SESSION["AMP_user"]->checkSection('999')) {
$currentcomponent->addoptlistitem('devicelist', 'sip_generic', _("Generic SIP Device"));
$currentcomponent->addoptlistitem('devicelist', 'iax2_generic', _("Generic IAX2 Device"));
if (!ast_with_dahdi() || $amp_conf['ZAP2DAHDICOMPAT']) {
$currentcomponent->addoptlistitem('devicelist', 'zap_generic', _("Generic ZAP Device"));
}
if (ast_with_dahdi()) {
$currentcomponent->addoptlistitem('devicelist', 'dahdi_generic', _("Generic DAHDI Device"));
}
$currentcomponent->addoptlistitem('devicelist', 'custom_custom', _("Other (Custom) Device"));
}
if ($dispnum != 'devices') {
$currentcomponent->addoptlistitem('devicelist', 'virtual', _("None (virtual exten)"));
}
$currentcomponent->setoptlistopts('devicelist', 'sort', false);
// Option lists used by the gui
$currentcomponent->addoptlistitem('devicetypelist', 'fixed', _("Fixed"));
$currentcomponent->addoptlistitem('devicetypelist', 'adhoc', _("Adhoc"));
$currentcomponent->setoptlistopts('devicetypelist', 'sort', false);
$currentcomponent->addoptlistitem('deviceuserlist', 'none', _("none"));
$currentcomponent->addoptlistitem('deviceuserlist', 'new', _("New User"));
$users = core_users_list();
if (isset($users)) {
foreach ($users as $auser) {
$currentcomponent->addoptlistitem('deviceuserlist', $auser[0], $auser[0]);
}
}
$currentcomponent->setoptlistopts('deviceuserlist', 'sort', false);
// Add the 'proces' functions
$currentcomponent->addguifunc('core_devices_configpageload');
$currentcomponent->addprocessfunc('core_devices_configprocess');
}
}
示例9: directory_draw_entries_all_users
function directory_draw_entries_all_users($id)
{
$html = '';
foreach (core_users_list() as $user) {
$html .= directory_draw_entries_tr($id, $user[0], '', $user[1], 'vm', '', $id++, true);
}
return $html;
}
示例10: generate_queues_additional
function generate_queues_additional($ast_version)
{
global $db;
global $amp_conf;
$additional = "";
$output = "";
// Asterisk 1.4 does not like blank assignments so just don't put them there
//
$ver12 = version_compare($ast_version, '1.4', 'lt');
$ver16 = version_compare($ast_version, '1.6', 'ge');
$ast_ge_14_25 = version_compare($ast_version, '1.4.25', 'ge');
// legacy but in case someone was using this we will leave it
//
$sql = "SELECT keyword,data FROM queues_details WHERE id='-1' AND keyword <> 'account'";
$results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
if (DB::IsError($results)) {
die($results->getMessage());
}
foreach ($results as $result) {
if (!$ver12 && trim($result['data']) == '') {
continue;
}
$additional .= $result['keyword'] . "=" . $result['data'] . "\n";
}
if ($ast_ge_14_25) {
$devices = array();
$device_results = core_devices_list('all', 'full', true);
if (is_array($device_results)) {
foreach ($device_results as $device) {
if (!isset($devices[$device['user']]) && $device['devicetype'] == 'fixed') {
$devices[$device['user']] = $device['dial'];
}
}
unset($device_results);
}
}
if ($amp_conf['USEQUEUESTATE'] || $ast_ge_14_25) {
$users = array();
$user_results = core_users_list();
if (is_array($user_results)) {
foreach ($user_results as $user) {
$users[$user[0]] = $user[1];
}
unset($user_results);
}
}
$results = queues_list(true);
foreach ($results as $result) {
$output .= "[" . $result[0] . "]\n";
// passing 2nd param 'true' tells queues_get to send back only queue_conf required params
// and nothing else
//
$results2 = queues_get($result[0], true);
// memebers is an array of members so we set it asside and remove it
// and then generate each later
//
$members = $results2['member'];
unset($results2['member']);
foreach ($results2 as $keyword => $data) {
if ($ver12) {
switch ($keyword) {
case 'ringinuse':
case 'autofill':
break;
case 'retry':
if ($data == 'none') {
$data = 0;
}
// no break, fallthrough to default
// no break, fallthrough to default
default:
$output .= $keyword . "=" . $data . "\n";
break;
}
} else {
switch ($keyword) {
case trim($data) == '':
case 'monitor-join':
break;
case 'monitor-format':
if (strtolower($data) != 'no') {
$output .= "monitor-type=mixmonitor\n";
$output .= $keyword . "=" . $data . "\n";
}
break;
case 'announce-position':
if ($ver16) {
$output .= $keyword . "=" . $data . "\n";
}
break;
case 'retry':
if ($data == 'none') {
$data = 0;
}
// no break, fallthrough to default
// no break, fallthrough to default
default:
$output .= $keyword . "=" . $data . "\n";
break;
}
//.........这里部分代码省略.........
示例11: core_devices_configpageinit
//.........这里部分代码省略.........
$tt = _("Whether to offer SRTP encrypted media (and only SRTP encrypted media) on outgoing calls to a peer. Calls will fail with HANGUPCAUSE=58 if the peer does not support SRTP. Defaults to no.");
$tmparr['encryption'] = array('prompttext' => _('Enable Encryption'), 'value' => $amp_conf['DEVICE_SIP_ENCRYPTION'], 'tt' => $tt, 'select' => $select, 'level' => 1);
}
$tt = _("Callgroup(s) that this device is part of, can be one or more callgroups, e.g. '1,3-5' would be in groups 1,3,4,5.");
$tmparr['callgroup'] = array('prompttext' => _('Call Groups'), 'value' => $amp_conf['DEVICE_CALLGROUP'], 'tt' => $tt, 'level' => 1);
$tt = _("Pickupgroups(s) that this device can pickup calls from, can be one or more groups, e.g. '1,3-5' would be in groups 1,3,4,5. Device does not have to be in a group to be able to pickup calls from that group.");
$tmparr['pickupgroup'] = array('prompttext' => _('Pickup Groups'), 'value' => $amp_conf['DEVICE_PICKUPGROUP'], 'tt' => $tt, 'level' => 1);
$tt = _("Disallowed codecs. Set this to all to remove all codecs defined in the general settings and then specify specific codecs separated by '&' on the 'allow' setting, or just disallow specific codecs separated by '&'.");
$tmparr['disallow'] = array('prompttext' => _('Disallowed Codecs'), 'value' => $amp_conf['DEVICE_DISALLOW'], 'tt' => $tt, 'level' => 1);
$tt = _("Allow specific codecs, separated by the '&' sign and in priority order. E.g. 'ulaw&g729'. Codecs allowed in the general settings will also be allowed unless removed with the 'disallow' directive.");
$tmparr['allow'] = array('prompttext' => _('Allowed Codecs'), 'value' => $amp_conf['DEVICE_ALLOW'], 'tt' => $tt, 'level' => 1);
$tt = _("How to dial this device, this should not be changed unless you know what you are doing.");
$tmparr['dial'] = array('prompttext' => _('Dial'), 'value' => '', 'tt' => $tt, 'level' => 2);
$tt = _("Accountcode for this device.");
$tmparr['accountcode'] = array('prompttext' => _('Account Code'), 'value' => '', 'tt' => $tt, 'level' => 1);
$tt = _("Mailbox for this device. This should not be changed unless you know what you are doing.");
$tmparr['mailbox'] = array('prompttext' => _('Mailbox'), 'value' => '', 'tt' => $tt, 'level' => 2);
$tt = _("Asterisk dialplan extension to reach voicemail for this device. Some devices use this to auto-program the voicemail button on the endpoint. If left blank, the default vmexten setting is automatically configured by the voicemail module. Only change this on devices that may have special needs.");
$tmparr['vmexten'] = array('prompttext' => _('Voicemail Extension'), 'value' => '', 'tt' => $tt, 'level' => 1);
$tt = _("IP Address range to deny access to, in the form of network/netmask.");
$tmparr['deny'] = array('prompttext' => _('Deny'), 'value' => '0.0.0.0/0.0.0.0', 'tt' => $tt, 'level' => 1);
$tt = _("IP Address range to allow access to, in the form of network/netmask. This can be a very useful security option when dealing with remote extensions that are at a known location (such as a branch office) or within a known ISP range for some home office situations.");
$tmparr['permit'] = array('prompttext' => _('Permit'), 'value' => '0.0.0.0/0.0.0.0', 'tt' => $tt, 'level' => 1);
$currentcomponent->addgeneralarrayitem('devtechs', 'sip', $tmparr);
//pjsip shares common functionality with chan_sip so unset all of those which dont make sense to pjsip
unset($tmparr['force_avp'], $tmparr['permit'], $tmparr['deny'], $tmparr['accountcode'], $tmparr['encryption'], $tmparr['type'], $tmparr['qualify'], $tmparr['port'], $tmparr['canreinvite'], $tmparr['host'], $tmparr['nat']);
$tt = _("Maximum number of Endpoints that can associate with this Device");
$tmparr['max_contacts'] = array('prompttext' => _('Max Contacts'), 'value' => '1', 'tt' => $tt, 'level' => 1);
unset($select);
$select[] = array('value' => 'yes', 'text' => 'Yes');
$select[] = array('value' => 'no', 'text' => 'No');
if (version_compare($amp_conf['ASTVERSION'], '12.4.0', 'ge')) {
//media_use_received_transport
$tt = _("Determines whether res_pjsip will use the media transport received in the offer SDP in the corresponding answer SDP.");
$tmparr['media_use_received_transport'] = array('prompttext' => _('Media Use Received Transport'), 'value' => 'no', 'tt' => $tt, 'select' => $select, 'level' => 1);
}
$tt = _("Enforce that RTP must be symmetric. If this device is natting in it is usually a good idea to enable this. Disable only if you are having issues.");
$tmparr['rtp_symmetric'] = array('prompttext' => _('RTP Symmetric'), 'value' => 'yes', 'tt' => $tt, 'select' => $select, 'level' => 1);
$tt = _("Allow Contact header to be rewritten with the source IP address-port");
$tmparr['rewrite_contact'] = array('prompttext' => _('Rewrite Contact'), 'value' => 'yes', 'tt' => $tt, 'select' => $select, 'level' => 1);
unset($select);
$select[] = array('value' => 'solicited', 'text' => 'Solicited');
$select[] = array('value' => 'unsolicited', 'text' => 'Unsolicited');
$tt = _("For Message Waiting indicators there are two types: Solicited and Unsolicited. Solicited means Subscribe 200 then Notify 200. Unsolicited means only Notify 200. No need to Subscribe. Solicited is the default and should only be changed if you see errors in the Asterisk logs");
$tmparr['mwi_subscription'] = array('prompttext' => _('MWI Subscription Type'), 'value' => 'solicited', 'tt' => $tt, 'select' => $select, 'level' => 1);
unset($select);
//Use the transport engine, don't cross migrate anymore, it just doesn't work
$transports = FreePBX::create()->PJSip->getActiveTransports();
foreach ($transports as $transport) {
$select[] = array('value' => $transport['value'], 'text' => $transport['text']);
}
$tmparr['transport']['select'] = $select;
$tmparr['transport']['level'] = 0;
unset($select);
$currentcomponent->addgeneralarrayitem('devtechs', 'pjsip', $tmparr);
unset($tmparr);
$currentcomponent->addjsfunc('changeDriver()', "\n\t\tif(confirm('" . _('Are you Sure you want to Change the SIP Channel Driver? (The Page will Refresh, then you MUST hit save when you are done to propagate the new settings)') . "')) {\n\t\t\tif(\$('#devinfo_sipdriver').val() == 'chan_sip') {\n\t\t\t\t\$('#devinfo_sipdriver').val('chan_pjsip');\n\t\t\t} else {\n\t\t\t\t\$('#devinfo_sipdriver').val('chan_sip');\n\t\t\t}\n\t\t\t\$('form[name=frm_" . $dispnum . "]').append('<input type=\"hidden\" name=\"changesipdriver\" value=\"yes\">');\n\t\t\t\$('form[name=frm_" . $dispnum . "]').submit();\n\t\t}\n\t\t", 0);
// custom
$tmparr = array();
$tt = _("How to dial this device. This will be device specific. For example, a custom device which is really a remote SIP URI might be configured such as SIP/joe@somedomain.com");
$tmparr['dial'] = array('value' => '', 'tt' => $tt, 'level' => 0);
$currentcomponent->addgeneralarrayitem('devtechs', 'custom', $tmparr);
unset($tmparr);
// Devices list
if ($_SESSION["AMP_user"]->checkSection('999')) {
$sipdriver = FreePBX::create()->Config->get_conf_setting('ASTSIPDRIVER');
if ($sipdriver == 'both') {
$currentcomponent->addoptlistitem('devicelist', 'pjsip_generic', _("Generic PJSIP Device"));
$currentcomponent->addoptlistitem('devicelist', 'sip_generic', _("Generic CHAN SIP Device"));
} elseif ($sipdriver == 'chan_sip') {
$currentcomponent->addoptlistitem('devicelist', 'sip_generic', _("Generic CHAN SIP Device"));
} elseif ($sipdriver == 'chan_pjsip') {
$currentcomponent->addoptlistitem('devicelist', 'pjsip_generic', _("Generic PJSIP Device"));
}
$currentcomponent->addoptlistitem('devicelist', 'iax2_generic', _("Generic IAX2 Device"));
$currentcomponent->addoptlistitem('devicelist', 'dahdi_generic', _("Generic DAHDi Device"));
$currentcomponent->addoptlistitem('devicelist', 'custom_custom', _("Other (Custom) Device"));
}
if ($dispnum != 'devices') {
$currentcomponent->addoptlistitem('devicelist', 'virtual', _("None (virtual exten)"));
}
$currentcomponent->setoptlistopts('devicelist', 'sort', false);
// Option lists used by the gui
$currentcomponent->addoptlistitem('devicetypelist', 'fixed', _("Fixed"));
$currentcomponent->addoptlistitem('devicetypelist', 'adhoc', _("Adhoc"));
$currentcomponent->setoptlistopts('devicetypelist', 'sort', false);
$currentcomponent->addoptlistitem('deviceuserlist', 'none', _("none"));
$currentcomponent->addoptlistitem('deviceuserlist', 'new', _("New User"));
$users = core_users_list();
if (isset($users)) {
foreach ($users as $auser) {
$currentcomponent->addoptlistitem('deviceuserlist', $auser[0], $auser[0] . " (" . $auser[1] . ")");
}
}
$currentcomponent->setoptlistopts('deviceuserlist', 'sort', false);
// Add the 'proces' functions
$currentcomponent->addguifunc('core_devices_configpageload');
$currentcomponent->addprocessfunc('core_devices_configprocess');
}
}
示例12: show_aststats
function show_aststats()
{
global $amp_conf;
global $astinfo;
global $db;
$out = '';
$channels = $astinfo->get_channel_totals();
// figure out max_calls
// guess at the max calls: number of users
if (!isset($_SESSION["calculated_max_calls"])) {
// set max calls to either MAXCALLS in amportal.conf, or the number of users in the system
if (isset($amp_conf['MAXCALLS'])) {
$_SESSION["calculated_max_calls"] = $amp_conf["MAXCALLS"];
} else {
if (function_exists('core_users_list')) {
$_SESSION["calculated_max_calls"] = count(core_users_list());
} else {
$_SESSION["calculated_max_calls"] = 1;
}
}
}
// we currently see more calls than we guessed, increase it
if ($channels['total_calls'] > $_SESSION["calculated_max_calls"]) {
$_SESSION["calculated_max_calls"] = $channels['total_calls'];
}
$max_calls = $_SESSION["calculated_max_calls"];
$classes = array(0 => 'graphok');
$max_chans = $max_calls * 2;
$out .= "<h3>" . _("FreePBX Statistics") . "</h3>";
$out .= draw_graph(_('Total active calls'), '', $channels['total_calls'], $max_calls, $classes, false, BAR_WIDTH_LEFT);
$out .= draw_graph(_('Internal calls'), '', $channels['internal_calls'], $max_calls, $classes, false, BAR_WIDTH_LEFT);
$out .= draw_graph(_('External calls'), '', $channels['external_calls'], $max_calls, $classes, false, BAR_WIDTH_LEFT);
$out .= draw_graph(_('Total active channels'), '', $channels['total_channels'], $max_chans, $classes, false, BAR_WIDTH_LEFT);
$out .= "<h4>" . _("FreePBX Connections") . "</h4>";
/* This is generally very bad style, and we should look at adding this to core_devices_list or another core
* function. However, since this is in Ajax lite weight code, it is currently the cleanest way to get the sip and iax2
* devices in a hash format that we would like to pass to the class
*/
$sql = "SELECT `id` FROM `devices` WHERE `tech` IN ('sip', 'iax2')";
$devices = $db->getCol($sql);
if (DB::IsError($devices)) {
$devices = false;
} else {
$devices = array_flip($devices);
}
$conns = $astinfo->get_connections($devices);
if ($conns['users_total'] > 0) {
$out .= draw_graph(_('IP Phones Online'), '', $conns['users_online'], $conns['users_total'], $classes, false, BAR_WIDTH_LEFT);
}
if ($conns['trunks_total'] > 0) {
$out .= draw_graph(_('IP Trunks Online'), '', $conns['trunks_online'], $conns['trunks_total'], $classes, false, BAR_WIDTH_LEFT);
}
if ($conns['registrations_total'] > 0) {
$out .= draw_graph(_('IP Trunk Registrations'), '', $conns['registrations_online'], $conns['registrations_total'], $classes, false, BAR_WIDTH_LEFT);
}
return $out;
}
示例13: campon_toggle
function campon_toggle($c)
{
global $ext;
global $amp_conf;
if (!$amp_conf['CC_ENABLE']) {
return true;
}
$id = "app-campon-toggle";
// The context to be included
$hint_context = 'ext-local';
$ext->addInclude('from-internal-additional', $id);
// Add the include from from-internal
$ext->add($id, $c, '', new ext_answer(''));
$ext->add($id, $c, '', new ext_set('CCSS_SETUP', 'TRUE'));
// keep from calling normal sub-ccss
$ext->add($id, $c, '', new ext_macro('user-callerid'));
$ext->add($id, $c, '', new ext_execif('$["${EXTENSION_STATE(' . $c . '${AMPUSER}@' . $hint_context . ')}" = "INUSE"]', 'CallCompletionCancel', '', 'CallCompletionRequest', ''));
$ext->add($id, $c, '', new ext_noop_trace('CC_REQUEST_RESULT: ${CC_REQUEST_RESULT} CC_REQUEST_REASON: ${CC_REQUEST_REASON} LastNumber: ${DB(AMPUSER/${AMPUSER}/ccss/last_number)}'));
$ext->add($id, $c, '', new ext_noop_trace('CC_CANCEL_RESULT: ${CC_CANCEL_RESULT} CC_CANCEL_REASON: ${CC_CANCEL_REASON}'));
$ext->add($id, $c, '', new ext_playback('beep'));
$ext->add($id, $c, '', new ext_macro('hangupcall'));
$ext->addGlobal('CAMPONTOGGLE', $c);
$userlist = core_users_list();
if (is_array($userlist)) {
foreach ($userlist as $item) {
$hint_code = $c . $item[0];
$ext->add($hint_context, $hint_code, '', new ext_goto('1', $c, $id));
if (!$amp_conf['DYNAMICHINTS']) {
$devices = core_hint_get($item[0]);
$dev_arr = explode('&', $devices);
$hint_val = 'ccss:' . implode('&ccss:', $dev_arr);
$ext->addHint($hint_context, $hint_code, $hint_val);
}
}
}
}
示例14: findmefollow_draw_general
function findmefollow_draw_general($fmfm, &$currentcomponent, $category, $fmfmdisabled, $recordingslist, $moh)
{
global $display;
$js = "\n\tif(\$('#extension').val().trim().length === 0) {\n\t\t\$('#fmfm_ddial1').prop('checked', true);\n\t\twarnInvalid(\$('#extension'),'" . sprintf(_("Please enter a valid %s number"), $display == "extensions" ? _("extension") : _("device")) . "');\n\t\treturn false;\n\t}\n\tvar curval = \$('#fmfm_grplist').val();\n\tif(curval.trim().length === 0){\n\t\t\$('#fmfm_grplist').val(\$('#extension').val()+'\\n');\n\t}\n\treturn true;\n\t";
$currentcomponent->addjsfunc('fmfmEnabled(notused)', $js);
$js = "\n\t\tvar ext = \$('#fmfm_quickpick').val(),\n\t\t\t\tfml = \$('#fmfm_grplist').val().trim()\n\t\tif(fml.length > 0) {\n\t\t\t\$('#fmfm_grplist').val(fml + '\\n' + ext).trigger('autosize.resize');;\n\t\t} else {\n\t\t\t\$('#fmfm_grplist').val(ext).trigger('autosize.resize');;\n\t\t}\n\t";
$currentcomponent->addjsfunc('fmfmQuickPick(notused)', $js);
$section = _("General Settings");
$guidefaults = array("elemname" => "", "prompttext" => "", "helptext" => "", "currentvalue" => "", "valarray" => array(), "jsonclick" => '', "jsvalidation" => "", "failvalidationmsg" => "", "canbeempty" => true, "maxchars" => 0, "disable" => false, "inputgroup" => false, "class" => "", "cblabel" => 'Enable', "disabled_value" => 'DEFAULT', "check_enables" => 'true', "cbdisable" => false, "cbclass" => '');
$el = array("elemname" => "fmfm_ddial", "prompttext" => _('Enabled'), "helptext" => _('By default (Yes) any call to this extension will go to this Follow-Me instead, including directory calls by name from IVRs. If set to "No", calls will go only to the extension. Destinations that directly specify FollowMe will come here regardless. Setting this to "No" is often used in conjunction with VmX Locater, where you want a call to ring the extension, and then only if the caller chooses to find you do you want the call to go through FollowMe.'), "currentvalue" => $fmfmdisabled ? 'disabled' : 'enabled', "valarray" => array(array("value" => "enabled", "text" => _("Yes")), array("value" => "disabled", "text" => _("No"))), "jsonclick" => "frm_{$display}_fmfmEnabled() && frm_{$display}_fmfmConfirmEnabled() && frm_{$display}_fmfmCIDMode()", "class" => "", "disable" => "", "pairedvalues" => false);
$currentcomponent->addguielem($section, new gui_radio(array_merge($guidefaults, $el)), $category);
$sixtey = array();
for ($i = 0; $i <= 60; $i++) {
$sixtey[] = array("value" => $i, "text" => $i);
}
$el = array("elemname" => "fmfm_pre_ring", "prompttext" => _('Initial Ring Time'), "helptext" => _("This is the number of seconds to ring the primary extension prior to proceeding to the follow-me list. The extension can also be included in the follow-me list. A 0 setting will bypass this."), "currentvalue" => $fmfm['pre_ring'], "valarray" => $sixtey, "class" => "fpbx-fmfm", "canbeempty" => false, "jsvalidation" => "frm_{$display}_fmfmCheckFixed()");
$currentcomponent->addguielem($section, new gui_selectbox(array_merge($guidefaults, $el)), $category);
$helptext = '<b>' . _("ringallv2") . '</b>: ' . _("ring Extension for duration set in Initial Ring Time, and then, while continuing call to extension, ring Follow-Me List for duration set in Ring Time.") . '<br>' . '<b>' . _("ringall") . '</b>: ' . _("ring Extension for duration set in Initial Ring Time, and then terminate call to Extension and ring Follow-Me List for duration set in Ring Time.") . '<br>' . '<b>' . _("hunt") . '</b>: ' . _("take turns ringing each available extension") . '<br>' . '<b>' . _("memoryhunt") . '</b>: ' . _("ring first extension in the list, then ring the 1st and 2nd extension, then ring 1st 2nd and 3rd extension in the list.... etc.") . '<br>' . '<b>' . _("*-prim") . '</b>: ' . _("these modes act as described above. However, if the primary extension (first in list) is occupied, the other extensions will not be rung. If the primary is FreePBX DND, it won't be rung. If the primary is FreePBX CF unconditional, then all will be rung") . '<br>' . '<b>' . _("firstavailable") . '</b>: ' . _("ring only the first available channel") . '<br>' . '<b>' . _("firstnotonphone") . '</b>: ' . _("ring only the first channel which is not off hook - ignore CW") . '';
$items = array('ringallv2', 'ringallv2-prim', 'ringall', 'ringall-prim', 'hunt', 'hunt-prim', 'memoryhunt', 'memoryhunt-prim', 'firstavailable', 'firstnotonphone');
$optlist = array();
foreach ($items as $item) {
$optlist[] = array("value" => $item, "text" => $item);
}
$el = array("elemname" => "fmfm_strategy", "prompttext" => _("Ring Strategy"), "helptext" => $helptext, "currentvalue" => $fmfm['strategy'], "valarray" => $optlist, "class" => "fpbx-fmfm", "canbeempty" => false);
$currentcomponent->addguielem($section, new gui_selectbox(array_merge($guidefaults, $el)), $category);
$el = array("elemname" => "fmfm_grptime", "prompttext" => _('Ring Time'), "helptext" => _("Time in seconds that the phones will ring. For all hunt style ring strategies, this is the time for each iteration of phone(s) that are rung"), "currentvalue" => $fmfm['grptime'], "valarray" => $sixtey, "class" => "fpbx-fmfm", "canbeempty" => false);
$currentcomponent->addguielem($section, new gui_selectbox(array_merge($guidefaults, $el)), $category);
$el = array("elemname" => "fmfm_grplist", "prompttext" => _('Follow-Me List'), "helptext" => _("List extensions to ring, one per line, or use the Extension Quick Pick below.<br><br>You can include an extension on a remote system, or an external number by suffixing a number with a pound (#). ex: 2448089# would dial 2448089 on the appropriate trunk (see Outbound Routing)."), "currentvalue" => str_replace("-", "\n", $fmfm['grplist']), "canbeempty" => false, "class" => "fpbx-fmfm", "jsvalidation" => "frm_{$display}_fmfmListEmpty()", "failvalidationmsg" => _('Follow-Me List can not be empty if Follow-Me is enabled'));
$currentcomponent->addguielem($section, new gui_textarea(array_merge($guidefaults, $el)), $category);
$optlist = array();
$optlist[] = array("value" => "", "text" => _("(pick extension)"));
foreach (core_users_list() as $result) {
$optlist[] = array("value" => $result[0], "text" => $result[0] . " (" . $result[1] . ")");
}
$el = array("elemname" => "fmfm_quickpick", "prompttext" => _('Extension Quick Pick'), "helptext" => _("Choose an extension to append to the end of the extension list above."), "currentvalue" => "", "valarray" => $optlist, "class" => "fpbx-fmfm", "canbeempty" => false, "onchange" => "frm_{$display}_fmfmQuickPick()");
$currentcomponent->addguielem($section, new gui_selectbox(array_merge($guidefaults, $el)), $category);
$el = array("elemname" => "fmfm_annmsg_id", "prompttext" => _('Announcement'), "helptext" => _("Message to be played to the caller before dialing this group.<br><br>To add additional recordings please use the \"System Recordings\" MENU to the left"), "currentvalue" => $fmfm['annmsg_id'], "valarray" => $recordingslist, "class" => "fpbx-fmfm", "canbeempty" => false);
$currentcomponent->addguielem($section, new gui_selectbox(array_merge($guidefaults, $el)), $category);
$optlist = array();
$optlist[] = array("value" => "Ring", "text" => _("Ring"));
if (!empty($moh)) {
foreach ($moh as $music) {
$optlist[] = array("value" => $music, "text" => $music);
}
}
$el = array("elemname" => "fmfm_ringing", "prompttext" => _('Play Music On Hold'), "helptext" => _("If you select a Music on Hold class to play, instead of 'Ring', they will hear that instead of Ringing while they are waiting for someone to pick up."), "currentvalue" => $fmfm['ringing'], "valarray" => $optlist, "class" => "fpbx-fmfm", "canbeempty" => false);
$currentcomponent->addguielem($section, new gui_selectbox(array_merge($guidefaults, $el)), $category);
$el = array("elemname" => "fmfm_grppre", "prompttext" => _('CID Name Prefix'), "helptext" => _('You can optionally prefix the Caller ID name when ringing extensions in this group. ie: If you prefix with "Sales:", a call from John Doe would display as "Sales:John Doe" on the extensions that ring.'), "currentvalue" => $fmfm['grppre'], "canbeempty" => true, "class" => "fpbx-fmfm");
$currentcomponent->addguielem($section, new gui_textbox(array_merge($guidefaults, $el)), $category);
$el = array("elemname" => "fmfm_dring", "prompttext" => _('Alert Info'), "helptext" => _('You can optionally include an Alert Info which can create distinctive rings on SIP phones.'), "currentvalue" => $fmfm['dring'], "canbeempty" => true, "class" => "fpbx-fmfm");
$currentcomponent->addguielem($section, new gui_alertinfodrawselects(array_merge($guidefaults, $el)), $category);
}
示例15: getUCPAdminDisplay
/**
* get the Admin display in UCP
* @param array $user The user array
*/
public function getUCPAdminDisplay($user)
{
$fpbxusers = array();
$cul = array();
foreach (core_users_list() as $list) {
$cul[$list[0]] = array("name" => $list[1], "vmcontext" => $list[2]);
}
$vmassigned = $this->FreePBX->Ucp->getSetting($user['username'], 'Voicemail', 'assigned');
$vmassigned = !empty($vmassigned) ? $vmassigned : array();
foreach ($user['assigned'] as $assigned) {
$fpbxusers[] = array("ext" => $assigned, "data" => $cul[$assigned], "selected" => in_array($assigned, $vmassigned));
}
$html['description'] = '<a href="#" class="info">' . _("Allowed Voicemail") . ':<span>' . _("These are the assigned and active extensions which will show up for this user to control and edit in UCP") . '</span></a>';
$html['content'] = load_view(dirname(__FILE__) . "/views/ucp_config.php", array("fpbxusers" => $fpbxusers));
return $html;
}