本文整理汇总了PHP中FreePBX::Xmpp方法的典型用法代码示例。如果您正苦于以下问题:PHP FreePBX::Xmpp方法的具体用法?PHP FreePBX::Xmpp怎么用?PHP FreePBX::Xmpp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FreePBX
的用法示例。
在下文中一共展示了FreePBX::Xmpp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: presence_user_extensions
function presence_user_extensions()
{
$userman = FreePBX::Userman();
$extensions = array();
$xmpp_users = FreePBX::Xmpp()->getAllUsers();
foreach ($xmpp_users as $user_to) {
$user = $userman->getUserByID($user_to['user']);
if ($user['default_extension'] == 'none') {
$default = array();
} else {
$default = array($user['default_extension']);
}
$assigned = $userman->getAssignedDevices($user_to['user']);
if (!$assigned) {
$assigned = array();
}
$extensions[$user_to['username']] = array_unique(array_merge($default, $assigned), SORT_NUMERIC);
}
return $extensions;
}
示例2: foreach
foreach ($get_vars as $k => $v) {
$var[$k] = isset($_REQUEST[$k]) ? $_REQUEST[$k] : $v;
}
//set action to delete if delete was pressed instead of submit
if ($var['submit'] == _('Delete') && $var['action'] == 'save') {
$var['action'] = 'delete';
}
//action actions
switch ($var['action']) {
case 'save':
foreach ($var as $k => $v) {
switch ($k) {
case 'domain':
if ($v) {
FreePBX::Xmpp()->saveOption($k, $v);
}
break;
default:
break;
}
}
}
//view action
switch ($var['action']) {
case 'edit':
case 'save':
default:
$var = array_merge($var, FreePBX::Xmpp()->getAllOptions());
echo load_view(dirname(__FILE__) . '/views/xmpp.php', $var);
break;
}
示例3: error_reporting
#!/usr/bin/env php
<?php
error_reporting(0);
$bootstrap_settings['freepbx_auth'] = false;
$restrict_mods = true;
if (!@(include_once getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) {
include_once '/etc/asterisk/freepbx.conf';
}
$xmpp = FreePBX::Xmpp();
if (!empty($argv[1])) {
$params = explode(":", $argv[1], 4);
$num = count($params);
if ($num >= 3) {
$command = $params[0];
$username = $params[1];
$host = $params[2];
if ($num == 4) {
$password = $params[3];
}
switch ($command) {
case 'isuser':
echo $xmpp->isUser($username) ? 1 : 0;
break;
case 'auth':
echo $xmpp->auth($username, $password) ? 1 : 0;
break;
case 'setpass':
echo $xmpp->setPass($username, $password) ? 1 : 0;
break;
default:
echo 0;