示例#1
0
 /**
  * Provider Action - "http://SERVER/internal/Provider"   
  * gets params from Internal Model in GET and Sends to Provider
  * 
  */
 public function providerAction()
 {
     $params = Application_Model_General::getParamsArray($this->getRequest()->getParams());
     if (isset($params['SLEEP'])) {
         sleep((int) $params['SLEEP']);
     }
     if (isset($params['REQID'])) {
         $params['REQUEST_ID'] = $params['REQID'];
     }
     $reqModel = new Application_Model_Request($params);
     $reqModel->ExecuteFromInternal();
 }
示例#2
0
 /**
  * internal Action - "http://SERVER/Provider/internal"
  * 
  * Gets params from GET and puts them in a new Request Model Object .
  * then calls executeRequest() to send the message to internal. 
  * 
  * @package		ApplicationController      
  * @subpackage	ProviderController
  */
 public function internalAction()
 {
     $params = Application_Model_General::getParamsArray($this->getRequest()->getParams());
     if (isset($params['SLEEP'])) {
         sleep((int) $params['SLEEP']);
     }
     if (isset($params['NUMBER'])) {
         $params['PHONE_NUMBER'] = $params['NUMBER'];
     }
     //		error_log(print_R($params, 1));
     $reqModel = new Application_Model_Request($params);
     $manual = isset($params['MANUAL']) && $params['MANUAL'];
     $reqModel->ExecuteRequest($manual);
 }
示例#3
0
文件: Cron.php 项目: carriercomm/NPG
 /**
  * send publish to specific provider
  * 
  * @param array $request 
  * @return void
  */
 public function executePublish($request)
 {
     $params = Application_Model_General::getParamsArray($request);
     // let's check if it's port (means we have execute response before)
     $execute_exists = Application_Model_General::getTransactions($request['request_id'], 'Execute_response', 'null');
     if (empty($execute_exists) || !is_array($execute_exists) || !count($execute_exists)) {
         $publish_type = "Rtrn";
     } else {
         $publish_type = "Port";
     }
     $params['PROCESS_TYPE'] = "PORT";
     $params['MSG_TYPE'] = "Publish";
     $params['FROM'] = Application_Model_General::getSettings('InternalProvider');
     $params['DONOR'] = $params['FROM_PROVIDER'];
     //$row['DONOR'] = $provider;
     $params['PUBLISH_TYPE'] = $publish_type;
     $params["RETRY_DATE"] = Application_Model_General::getDateTimeIso();
     $params["RETRY_NO"] = $this->get_retry_no($params);
     $params["VERSION_NO"] = Application_Model_General::getSettings("VersionNo");
     $reqModel = new Application_Model_Request($params);
     // make sure the request is ok.
     // can use $reqModel->RequestValidate() but maybe there is no need becuse i'm building it
     // TODO.oc666: why we execute from internal?
     $reqModel->ExecuteFromInternal();
     //what with the ack in the DB - status 1 for each?
 }