本文整理汇总了PHP中astercrm::getGroupCurcdr方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::getGroupCurcdr方法的具体用法?PHP astercrm::getGroupCurcdr怎么用?PHP astercrm::getGroupCurcdr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::getGroupCurcdr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showChannelsInfo
/**
* initialize page elements
* @return objResponse object xajax response object
*/
function showChannelsInfo()
{
global $locate, $config, $db;
$aDyadicArray[] = array($locate->Translate("src"), $locate->Translate("dst"), $locate->Translate("srcchan"), $locate->Translate("dstchan"), $locate->Translate("starttime"), $locate->Translate("answertime"), $locate->Translate("disposition"));
$objResponse = new xajaxResponse();
if ($config['system']['eventtype'] == 'curcdr') {
if ($_SESSION['curuser']['usertype'] == 'admin') {
$curcdr = astercrm::getAll("curcdr");
} else {
//print_r($_SESSION['curuser']['memberExtens']);exit;
$curcdr = astercrm::getGroupCurcdr();
}
while ($curcdr->fetchInto($row)) {
$systemCDR[] = array($row["src"], $row["dst"], $row["srcchan"], $row["dstchan"], $row["starttime"], $row["answertime"], $row["disposition"]);
}
$activeCalls = " " . count($systemCDR) . " " . $locate->Translate("active calls");
$objResponse->addAssign("divActiveCalls", "innerHTML", $activeCalls);
$systemChannels = common::generateTabelHtml(array_merge($aDyadicArray, $systemCDR));
$objResponse->addAssign("channels", "innerHTML", nl2br(trim($systemChannels)));
return $objResponse;
}
$channels = split(chr(13), asterisk::getCommandData('show channels verbose'));
/*
if ($channels == null){
$objResponse->addAssign("channels", "innerHTML", "can not connect to AMI, please check config.php");
return $objResponse;
}
*/
$channels = split(chr(10), $channels[1]);
//trim the first two records and the last three records
// array_pop($channels);
array_pop($channels);
$activeCalls = array_pop($channels);
$activeChannels = array_pop($channels);
array_shift($channels);
$title = array_shift($channels);
$title = split("_", implode("_", array_filter(split(" ", $title))));
$myInfo[] = $title;
foreach ($channels as $channel) {
if (strstr($channel, " Dial")) {
$myItem = split("_", implode("_", array_filter(split(" ", $channel))));
$myInfo[] = $myItem;
}
}
$myChannels = common::generateTabelHtml($myInfo);
$objResponse->addAssign("divActiveCalls", "innerHTML", $activeCalls);
$objResponse->addAssign("channels", "innerHTML", nl2br(trim($myChannels)));
return $objResponse;
}