本文整理汇总了PHP中AGI_AsteriskManager::database_del方法的典型用法代码示例。如果您正苦于以下问题:PHP AGI_AsteriskManager::database_del方法的具体用法?PHP AGI_AsteriskManager::database_del怎么用?PHP AGI_AsteriskManager::database_del使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AGI_AsteriskManager
的用法示例。
在下文中一共展示了AGI_AsteriskManager::database_del方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Aastra_manage_userinfo_Asterisk
function Aastra_manage_userinfo_Asterisk($user, $action, $array = NULL)
{
# Translate user if needed
$user = Aastra_get_userdevice_Asterisk($user);
# Connect to AGI
$as = new AGI_AsteriskManager();
$res = $as->connect();
# Process action
switch ($action) {
# Read database
case 'get':
# No answer
$return = array();
# Cell Phone
$get = $as->database_get('AMPUSER', $user . '/info/cell');
if ($get) {
$return['cell'] = $get;
}
# Home phone
$get = $as->database_get('AMPUSER', $user . '/info/home');
if ($get) {
$return['home'] = $get;
}
# Other phone
$get = $as->database_get('AMPUSER', $user . '/info/other');
if ($get) {
$return['other'] = $get;
}
break;
# Set values
# Set values
case 'set':
# Cell phone
if ($array['cell']) {
$res = $as->database_put('AMPUSER', $user . '/info/cell', $array['cell']);
} else {
$res = $as->database_del('AMPUSER', $user . '/info/cell');
}
# Home phone
if ($array['home']) {
$res = $as->database_put('AMPUSER', $user . '/info/home', $array['home']);
} else {
$res = $as->database_del('AMPUSER', $user . '/info/home');
}
# Cell phone
if ($array['other']) {
$res = $as->database_put('AMPUSER', $user . '/info/other', $array['other']);
} else {
$res = $as->database_del('AMPUSER', $user . '/info/other');
}
# Return
$return = $array;
break;
}
# Disconnect properly
$as->disconnect();
# Return
return $return;
}
示例2: setrobstatus
function setrobstatus($account, $incomingvalue, $mode)
{
require_once 'common/php-asmanager.php';
$amp_conf = parse_amportal_conf("/etc/amportal.conf");
$hosts = split(',', $amp_conf['MANAGERHOSTS']);
foreach ($hosts as $host) {
$astman = new AGI_AsteriskManager();
if ($res = $astman->connect($host, $amp_conf["AMPMGRUSER"], $amp_conf["AMPMGRPASS"])) {
if ($mode == "write") {
if ($incomingvalue == "Never") {
$astman->database_del("ROBCHECK", $account);
}
if ($incomingvalue == "Always") {
$astman->database_put("ROBCHECK", $account, "ENABLED");
}
$robstatus = null;
}
if ($mode == "read") {
$existrobstatus = $astman->database_get("ROBCHECK", $account);
if ($existrobstatus) {
$robstatus = "Always";
} else {
$robstatus = "Never";
}
}
$astman->disconnect();
} else {
echo "<h3>Cannot connect to Asterisk Manager {$host} with " . $amp_conf["AMPMGRUSER"] . "/" . $amp_conf["AMPMGRPASS"] . "</h3>This module requires access to the Asterisk Manager. Please ensure Asterisk is running and access to the manager is available.</div>";
exit;
}
}
return $robstatus;
}