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); } }
<?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')); }
<?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;