示例#1
0
文件: mongocdr.php 项目: swk/bluebox
 public function service($key = NULL)
 {
     $this->auto_render = FALSE;
     if ($this->input->post()) {
         $mongo = new MongoCdr();
         $mongo->connect();
         $xml = $this->input->post('cdr');
         Kohana::log('info', $xml);
         $mongo->addXMLCDR($xml);
     } else {
         $error = "NO CDR RECORD FOUND IN POST HEADER";
         echo $error;
         Kohana::log('error', $error);
     }
 }
示例#2
0
文件: index.php 项目: swk/bluebox
<?php

//check external IPs
if (sizeof($_POST) == 0) {
    die('No direct access');
}
include 'MongoCdr.php';
$mongo = new MongoCdr();
$mongo->connect();
$xml = $_POST['cdr'];
$mongo->addXMLCDR($xml);
$fp = fopen('/tmp/lame.txt', 'w+');
fwrite($fp, $xml);
fclose($fp);
while (false) {
    $mongo->addXMLCDR(file_get_contents('/home/mphill/cdr.txt'));
}
示例#3
0
文件: list.php 项目: swk/bluebox
<?php

include 'MongoCdr.php';
$mongo = new MongoCdr();
$page = $_REQUEST['page'];
// get the requested page
$limit = $_REQUEST['rows'];
// get how many rows we want to have into the grid
$sidx = $_REQUEST['sidx'];
// get index row - i.e. user click to sort
$sord = $_REQUEST['sord'];
// get the direction
$sord = $sord == 'asc' ? 1 : -1;
if (!$sidx) {
    $sidx = 1;
}
//$connection->dropDB('sip_mphill_com');
//192_168_50_229.1160
$db = $mongo->selectDB('cdr');
$collection = $db->selectCollection('record');
$domain = 'sip_mphill_com';
//search = array('domain' => $domain )
$count = $collection->find()->count();
//
if ($count > 0) {
    $total_pages = @ceil($count / $limit);
} else {
    $total_pages = 0;
}
if ($page > $total_pages) {
    $page = $total_pages;