コード例 #1
0
 public function __construct($request, $response) 
 {/*{{{*/
     $confLogPath = PhoneConferenceClient::getInstance()->getConfLogPath();
     $this->logFileName = $confLogPath."huaweiconfcallback-".XDateTime::now()->toStringByFormat('Ymd').".log";
     $ioFaculty = new IOFaculty();
     $this->ioLogRecorder = new IOLogRecorder($this->logFileName, $ioFaculty->run(IOFaculty::TYPE_XML));
 }/*}}}*/
コード例 #2
0
 public function ajaxSetConcurrentCount($request, $response)
 {
     if (!$this->curOperator->isOperatorAdmin()) {
         throw new TelConfException('抱歉,此座席无权限查看!');
     }
     foreach ($request->concurrentCount as $id => $concurrentCount) {
         PhoneConferenceClient::getInstance()->updateProviderConcurrentCount($id, $concurrentCount);
     }
 }
コード例 #3
0
 public function __construct($request, $response) 
 {/*{{{*/
     $confLogPath = PhoneConferenceClient::getInstance()->getConfLogPath();
     $this->logFileName = $confLogPath."confcallback-".XDateTime::now()->toStringByFormat('Ymd').".log";
     $this->ioLogRecorder = new IOLogRecorder($this->logFileName);
     if ($request instanceof Request)
     {
         $arr = $request->getAllRequest();
         $this->ioLogRecorder->addLog(XDateTime::now()->toString()." ".$this->ioLogRecorder->format2SimpleLog($arr));
     }
 }/*}}}*/
コード例 #4
0
    public function __construct($request, $response) 
    {/*{{{*/
        $ioFaculty = new IOFaculty();
        $this->IOConverter = $ioFaculty->run(IOFaculty::TYPE_XML); 
        $response->confLogPath = PhoneConferenceClient::getInstance()->getConfLogPath();

        $items = '';
        if ($request instanceof Request && CallCenterApiFaculty::SPTYPE_CLOUD != $request->callbacktype)
        {
            $arr = $request->getAllRequest();
            $items = $this->getLogStr($arr);
        }
        else
        {
            $items =  file_get_contents("php://input");
            $items = preg_replace("/<S.* \/>/","",$items);
            $items = $this->getLogStr(XString::xmlToArray($items));
        }
        $this->logTxt .= XDateTime::now()->toString().$items."\n";
        $this->setCallBack($request->callbacktype, $response);
    }/*}}}*/
コード例 #5
0
 public function forceEndConf($request, $response)
 {/*{{{*/
     $confId = trim($request->confId);
     if("" != $confId)
     {
         PhoneConferenceClient::getInstance()->endConfInDb($confId, XDateTime::now());
     }
     return parent::DIRECT_OUTPUT;
 }/*}}}*/
コード例 #6
0
 public function ajaxendconf($request, $response)
 {/*{{{*/
     if(false == in_array($this->curUser->name, PhoneConference::$endConfAdminUsers))
     {
         throw new BizException('你没有操作权限');
     }
     $message = '关闭会议室命令发送成功,请过会刷新页面等待回调通知';
     $conf = DAL::get()->find('phoneconference', $request->confid);
     try
     {
         PhoneConferenceClient::getInstance()->dismissConsultConf($conf);
     }
     catch(TelConfException $ex)
     {
         $message = $ex->getMessage();
     }
     echo $message;
     return parent::DIRECT_OUTPUT;
 }/*}}}*/
コード例 #7
0
 /**
  * sendMailFile 发送日志邮件 
  * 
  * @param mixed $type 
  * @param mixed $theDate
  * @access private
  * @return void
  */
 private function sendMailFile($type, $theDate)
 {
     /*{{{*/
     $filePath = PhoneConferenceClient::getInstance()->getConfLogPath();
     $fileType = $type . '-' . $theDate;
     $fileName = $fileType . '.log';
     $fileLongPath = $filePath . $fileName;
     //全路径日志文件
     DBC::requireTrue(file_exists($fileLongPath), '文件不存在,不发送邮件');
     $goalDir = $this->writeLogDir($filePath);
     $this->getBatchLog($fileLongPath, $filePath, $goalDir . $fileType);
     $attachmentName = $type . $theDate . '-' . date("YmdHis");
     $tarFile = $goalDir . $attachmentName . '.zip';
     exec('zip -r9 ' . $tarFile . ' ' . $goalDir . '.');
     $file = fopen($tarFile, "r");
     DBC::requireTrue($file, '打开文件错误');
     $attachment = array("fileName" => $attachmentName . '.zip', "fileType" => "application/tar", "data" => fread($file, filesize($tarFile)));
     fclose($file);
     $emails = array('*****@*****.**');
     $title = $this->curUser->name . "|获取电话系统日志:{$attachmentName}";
     EmailClient::getInstance()->batchSendMail($emails, $title, '见附件' . rand(1, 1000), 'text/plain', $attachment);
     exec('rm ' . $tarFile);
 }
コード例 #8
0
 public function endconf($request, $response)
 {
     /*{{{*/
     $conf = DAL::get()->find('phoneconference', $request->confid);
     PhoneConferenceClient::getInstance()->dismissConsultConf($conf);
     return parent::DIRECT_OUTPUT;
 }
コード例 #9
0
 public function closeConf($request, $response)
 {
     /*{{{*/
     $teleconf = DAL::get()->find('phoneconference', $request->teleconfId);
     PhoneConferenceClient::getInstance()->dismissConsultConf($teleconf);
     sleep(1);
     $response->setRedirect('/doctor/callpanel?username=' . $request->username);
 }