本文整理汇总了PHP中AGI_AsteriskManager::database_deltree方法的典型用法代码示例。如果您正苦于以下问题:PHP AGI_AsteriskManager::database_deltree方法的具体用法?PHP AGI_AsteriskManager::database_deltree怎么用?PHP AGI_AsteriskManager::database_deltree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AGI_AsteriskManager
的用法示例。
在下文中一共展示了AGI_AsteriskManager::database_deltree方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
outn("Generating device & user settings in astdb..");
require_once "/var/lib/asterisk/bin/php-asmanager.php";
$sql = "SELECT * FROM users";
$userresults = $db->getAll($sql, DB_FETCHMODE_ASSOC);
if (DB::IsError($userresults)) {
$userresults = null;
}
$sql = "SELECT * FROM devices";
$devresults = $db->getAll($sql, DB_FETCHMODE_ASSOC);
if (DB::IsError($devresults)) {
$devresults = null;
}
//add details to astdb
$astman = new AGI_AsteriskManager();
if ($res = $astman->connect("127.0.0.1", $amp_conf["AMPMGRUSER"], $amp_conf["AMPMGRPASS"])) {
$astman->database_deltree("AMPUSER");
foreach ($userresults as $usr) {
extract($usr);
$astman->database_put("AMPUSER", $extension . "/password", $password);
$astman->database_put("AMPUSER", $extension . "/ringtimer", $ringtimer);
$astman->database_put("AMPUSER", $extension . "/noanswer", $noasnwer);
$astman->database_put("AMPUSER", $extension . "/recording", $recording);
$astman->database_put("AMPUSER", $extension . "/outboundcid", "\"" . $outboundcid . "\"");
$astman->database_put("AMPUSER", $extension . "/cidname", "\"" . $name . "\"");
}
$astman->database_deltree("DEVICE");
foreach ($devresults as $dev) {
extract($dev);
$astman->database_put("DEVICE", $id . "/dial", $dial);
$astman->database_put("DEVICE", $id . "/type", $devicetype);
$astman->database_put("DEVICE", $id . "/user", $user);