Example #1
0
 public function processAction(&$controller, $params)
 {
     $this->assignEmptyParams($params, 2, array('true'));
     list($showdetail, $filters) = $params;
     $channellist_view = new View('callmanager/channellist');
     $channellist_view->summaryfields = freeswitch_callmanager_Driver::getSummaryFields();
     $channellist_view->detailfields = freeswitch_callmanager_Driver::getDetailFields();
     $callManagerObj = new callManager();
     $input = Input::instance();
     if (!$filters) {
         $filters = array();
         $filters['state'] = $input->post('state_filters');
     }
     try {
         $channellist = $this->executeAction(array());
         arr::alfilter($channellist, $filters);
         arr::alsort($channellist, $input->post('channel_order'));
         foreach (array_keys($channellist) as $curkey) {
             $channellist[$curkey]['actions'] = callmanagerHelper::getFunctionLinksForCall($channellist[$curkey], $channellist[$curkey]['uuid']);
         }
         $channellist_view->channellist = $channellist;
         $channellist_view->updated = date('r');
         $channellist_view->showdetail = $showdetail;
         $channellist_view->render(TRUE);
     } catch (ESL_Exception $e) {
         echo 'An error has occured: ' . $e->getMessage() . '<br>';
         if (strpos($e->getMessage(), 'Not connected')) {
             echo 'This indicates that Freeswitch is not running, mod_event_socket is not configured, or the system is unable to log in.';
         }
     } catch (callmanagerException $e) {
         echo 'An error has occured: ' . $e->getMessage() . '<br>';
     }
     exit;
 }
Example #2
0
 public function getAgentList()
 {
     try {
         $input = Input::instance();
         $queueId = $input->post('queueid');
         $agentlistview = new View('callcenter_supervisor/agentlist');
         $agentlistview->status_fields = self::$agent_status_fields;
         $agentlistview->showdetail = true;
         $agentlistview->updated = date('r');
         $callcenter_manager_obj = new CallCenterManager();
         $agentlistview->agentStatus = $callcenter_manager_obj->getQueueAgentStatus($queueId);
         $filters = array();
         $filters['status'] = $input->post('agentstatus_filters');
         foreach ($agentlistview->agentStatus as $agent => $agentdata) {
             $locationObj = Doctrine::getTable('Location')->findOneByDomain($agentdata['domain']);
             $agentObj = Doctrine::getTable('callcenter_agent')->findOneBycca_loginidAndcca_locationid($agentdata['loginid'], $locationObj->location_id);
             $agentlistview->agentStatus[$agent]['displayname'] = $agentObj->cca_displayname;
             $agentlistview->agentStatus[$agent]['id'] = $agentObj->cca_id;
             foreach (self::$agent_date_diffs as $fieldname => $fieldparts) {
                 $d1 = key($fieldparts) === 'now' ? 'now' : $agentdata[key($fieldparts)];
                 $d2 = current($fieldparts) === 'now' ? 'now' : $agentdata[current($fieldparts)];
                 $agentlistview->agentStatus[$agent][$fieldname] = dttm::timestampdiff($d1, $d2);
             }
             foreach (self::$agent_date_fields as $fieldname => $formated_fieldname) {
                 $agentlistview->agentStatus[$agent][$formated_fieldname] = date('r', $agentlistview->agentStatus[$agent][$fieldname]);
             }
         }
         arr::alfilter($agentlistview->agentStatus, $filters);
         arr::alsort($agentlistview->agentStatus, $input->post('agent_order'));
         $agentlistview->render(TRUE);
     } catch (Exception $e) {
         echo 'An error has occured: ' . $e->getMessage() . '<br>';
         if (strpos($e->getMessage(), 'Not connected')) {
             echo 'This indicates that Freeswitch is not running, mod_event_socket is not configured, or the system is unable to log in.';
         }
     }
     exit;
 }
Example #3
0
 public function getRunningAgentList()
 {
     $driverName = Telephony::getDriverName();
     $agentDriver = call_user_func(array($driverName . '_callcenter_agent_Driver', 'getInstance'));
     $locationobjlist = Doctrine_Query::create()->select('*')->from('Location')->execute();
     foreach ($locationobjlist as $location) {
         $locationdomainlist[] = $location->domain;
     }
     $agentlist = $agentDriver->getRunningList();
     arr::alfilter($agentlist, array('domain' => $locationdomainlist));
     return $agentlist;
 }