public function index() { $html = ''; $this->template->content = new View('sofia/details'); $interfaces = SofiaManager::getSIPInterfaces(); if ($interfaces) { foreach ($interfaces as $sipinterface_id => $interface) { $html .= $this->showRegistrations(SofiaManager::getRegistrations($interface)); } } $this->view->modelContents = $html; }
public function _showStatus($null, $plugins, $location_id) { if (empty($plugins['sip']['username']) or empty($location_id)) { return 'Unknown'; } try { $username = $plugins['sip']['username']; $domain = locations::getLocationDomain($location_id); return SofiaManager::isDeviceActive($username, $domain); } catch (Exception $e) { kohana::log('error', 'Unable to determine the status of ' . $username . ': ' . $e->getMessage()); } return 'Unknown'; }