本文整理汇总了PHP中AGI_AsteriskManager::ExtensionState方法的典型用法代码示例。如果您正苦于以下问题:PHP AGI_AsteriskManager::ExtensionState方法的具体用法?PHP AGI_AsteriskManager::ExtensionState怎么用?PHP AGI_AsteriskManager::ExtensionState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AGI_AsteriskManager
的用法示例。
在下文中一共展示了AGI_AsteriskManager::ExtensionState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
}
$data['extensions'] = $extensions;
echo json_encode($data);
// $smarty->assign('data', $data);
// $smarty->display('operator-json3d.tpl');
}
if ($_REQUEST['query'] == 'extstate') {
$database = $ami->database_show('AMPUSER');
// преобразуем масиив базы данных asterisk в массив для удобного отображения средствами smartly
$i = 0;
foreach ($database as $key => $value) {
$keys = split("/", $key);
if (count($keys) < 2) {
continue;
}
$tmp3 = $ami->ExtensionState($keys[2], $dialplan_context, $i * 1023);
$connections[$keys[2]]["Status"] = $tmp3['Status'];
}
if (file_exists('/etc/asterisk/operator.conf')) {
$config = parse_ini_file('/etc/asterisk/operator.conf', true);
}
if ($config) {
foreach ($config as $key => $value) {
$tmp3 = $ami->ExtensionState($key, $dialplan_context, $i * 1023);
$from_file[$key]['Status'] = $tmp3['Status'];
}
} else {
$from_file[] = '';
}
$connections = $connections + $from_file;
/*?><pre>connections:<?print_r($connections);?></pre><?*/
示例2: explode
$notifications = $argv[1];
$notify = explode(',', $notifications);
$extension = $argv[2];
$vars['__EXTENSION'] = $extension;
if ($argc == 4) {
$vars['NAME_RECORDING'] = $argv[3];
}
# Connect to the AGI
$asm = new AGI_AsteriskManager();
$asm->connect();
# Get language
$language = Aastra_get_language();
# Notify each phone
for ($i = 0; $i < sizeof($notify); $i++) {
$vars['__REALCALLERIDNUM'] = $notify[$i];
$state = $asm->ExtensionState($notify[$i], 'default');
if ($state['Status'] != 0) {
$vars['NOTIFY_VM'] = 'true';
}
while (list($key, $val) = each($vars)) {
$vars_arr[] = "{$key}={$val}";
}
if (Aastra_compare_version_Asterisk('1.6')) {
$vars = implode(',', $vars_arr);
} else {
$vars = implode('|', $vars_arr);
}
$res = $asm->Originate2('Local/' . $notify[$i] . '@presence-notify', 9999, 'default', 1, null, null, null, sprintf(Aastra_get_label('%s is back <%s>', $language), $extension, $extension), $vars);
flush();
sleep(30);
// give them a break inbetween calls, so they don't get flood of them all at once ;)
示例3: foreach
}
} else {
$extensions = $buttons;
}
$data['extensions'] = $extensions;
echo json_encode($data);
// $smarty->assign('data', $data);
// $smarty->display('operator-json3d.tpl');
}
if ($_REQUEST['query'] == 'extstate') {
$database = $ami->database_show('AMPUSER');
// преобразуем масиив базы данных asterisk в массив для удобного отображения средствами smartly
$i = 0;
foreach ($database as $key => $value) {
$keys = split("/", $key);
$tmp3 = $ami->ExtensionState($keys[2], "from-internal", $i * 1023);
$connections[$keys[2]]["Status"] = $tmp3['Status'];
}
if (file_exists('/etc/asterisk/operator.conf')) {
$config = parse_ini_file('/etc/asterisk/operator.conf', true);
}
if ($config) {
foreach ($config as $key => $value) {
$tmp3 = $ami->ExtensionState($key, "from-internal", $i * 1023);
$from_file[$key]['Status'] = $tmp3['Status'];
}
} else {
$from_file[] = '';
}
$connections = $connections + $from_file;
/*?><pre>connections:<?print_r($connections);?></pre><?*/