示例#1
0
 public function sendAction()
 {
     $params = $this->getRequest()->getParams();
     $url = 'Internal';
     $method = $params['MSG_TYPE'];
     Application_Model_General::prefixPhoneNumber($params['NUMBER']);
     $args = array('method' => Application_Model_Internal::getMethodName($method), 'msg_type' => $method, 'provider' => $params['TO'], 'number' => $params['NUMBER'], 'request_time' => time());
     if ($method == 'Request' || $method == 'Update') {
         $args['transfer_time'] = $params['porttime'];
     } else {
         if ($method == 'Execute_response') {
             $args['more']['connect_time'] = time();
         }
     }
     $success = Application_Model_General::forkProcess($url, $args, true);
     if ($success) {
         $params['success'] = 1;
         $params['message'] = 'Request sent';
     } else {
         $params['success'] = 0;
         $params['message'] = 'Request failed';
     }
     $this->_redirect(Application_Model_General::getBaseUrl() . '/monitor/request?' . http_build_query($params));
 }