Ejemplo n.º 1
0
 public static function reload()
 {
     $eslMan = new EslManager();
     $eslCon = $eslMan->getESL();
     try {
         $responsestr = $eslCon->sendRecv('api reload mod_callcenter')->getBody();
     } catch (ESLException $e) {
         if (strpos($e->getMessage(), 'Not connected')) {
             throw new callcenterException('<div class="error">Unable to connect to the switch console.  This usually means that mod_event_socket is not running, or that the password that you entered during the setup process has changed. The error message was:<br>' . $e->getMessage() . '</div>');
         } else {
             throw $e;
         }
     }
     $responses = explode('', $responsestr);
     Kohana::log('debug', print_r($responses, true));
     if (substr(trim($responses[count($responses) - 1]), 0, 4) == '-ERR') {
         $this->_throwError($responsestr);
     }
     return $responsestr;
 }