当前位置: 首页>>代码示例>>PHP>>正文


PHP FreePBX::Cdr方法代码示例

本文整理汇总了PHP中FreePBX::Cdr方法的典型用法代码示例。如果您正苦于以下问题:PHP FreePBX::Cdr方法的具体用法?PHP FreePBX::Cdr怎么用?PHP FreePBX::Cdr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FreePBX的用法示例。


在下文中一共展示了FreePBX::Cdr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: str_replace

    $dstchannel = str_replace('AND dst', '', $dst);
    $dst = "{$dst_type} ({$dst_remaining} OR dstchannel {$dstchannel})";
}
// Build the "WHERE" part of the query
$where = "WHERE {$date_range} {$cnum} {$outbound_cnum} {$cnam} {$dst_cnam} {$did} {$dst} {$userfield} {$accountcode} {$disposition} {$duration}";
if (isset($_POST['need_csv']) && $_POST['need_csv'] == 'true') {
    $query = "(SELECT calldate, clid, did, src, dst, dcontext, channel, dstchannel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, userfield, cnum, cnam, outbound_cnum, outbound_cnam, dst_cnam FROM {$db_name}.{$db_table_name} {$where} {$order} {$sort} LIMIT {$result_limit})";
    $resultcsv = $dbcdr->getAll($query, DB_FETCHMODE_ASSOC);
    cdr_export_csv($resultcsv);
}
if (empty($resultcdr) && isset($_POST['need_html']) && $_POST['need_html'] == 'true') {
    $query = "SELECT `calldate`, `clid`, `did`, `src`, `dst`, `dcontext`, `channel`, `dstchannel`, `lastapp`, `lastdata`, `duration`, `billsec`, `disposition`, `amaflags`, `accountcode`, `uniqueid`, `userfield`, unix_timestamp(calldate) as `call_timestamp`, `recordingfile`, `cnum`, `cnam`, `outbound_cnum`, `outbound_cnam`, `dst_cnam`  FROM {$db_name}.{$db_table_name} {$where} {$order} {$sort} LIMIT {$result_limit}";
    $resultscdr = $dbcdr->getAll($query, DB_FETCHMODE_ASSOC);
    $resultscdr = is_array($resultscdr) ? $resultscdr : array();
    foreach ($resultscdr as &$call) {
        $file = FreePBX::Cdr()->processPath($call['recordingfile']);
        if (empty($file)) {
            //hide files that dont exist
            $call['recordingfile'] = '';
        }
    }
}
if (isset($resultscdr)) {
    $tot_calls_raw = sizeof($resultscdr);
} else {
    $tot_calls_raw = 0;
}
if ($tot_calls_raw) {
    // This is a bit of a hack, if we generated CEL data above, then these are simply the records all related to that CEL
    // event stream.
    //
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:31,代码来源:page.cdr.php


注:本文中的FreePBX::Cdr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。