Ejemplo n.º 1
0
 public function recordings()
 {
     $this->subview = new View('callrecord/recordings');
     $this->subview->tab = 'main';
     $this->subview->section = 'xmlcdr';
     $details = '';
     $base = $this->getBaseModelObject();
     if ($base instanceof Xmlcdr) {
         if (file_exists(CallRecord::getFile($base->uuid))) {
             $details .= 'A-leg recording: ' . $this->playLink($base->uuid) . '<br>';
         }
         if (file_exists(CallRecord::getFile($base->bleg_uuid))) {
             $details .= 'B-leg recording: ' . $this->playLink($base->bleg_uuid) . '<br>';
         }
         // In case blue.box finds nothing:
         if ($details == '') {
             $details = 'No recordings found!';
         }
     }
     $this->subview->details = $details;
     if (!$this->addSubView()) {
         return FALSE;
     }
     return TRUE;
 }
Ejemplo n.º 2
0
 public function get($uuid)
 {
     $this->auto_render = FALSE;
     $file = CallRecord::getFile($uuid);
     if (!file_exists($file)) {
         Kohana::log('error', 'Can\'t access file: ' . $file);
         return;
     }
     $this->getFile($file);
 }
Ejemplo n.º 3
0
    public function listen( $uuid) {
        $this->auto_render = FALSE;

        $file = CallRecord::getFile($uuid);
        if(!file_exists($file)) {
            Kohana::log('error', 'Can\'t access file: '  . $file);
            return;
        }

        header("Content-type: audio/wav");
        header('Content-Length: ' . filesize($file));
        readfile($file);
        die();
    }