Esempio n. 1
0
 /**
  *
  * @param Logic_WebService_Orange_DeliverNotification $parameters
  * @access public
  * @return Logic_WebService_Orange_DeliverNotificationResponse
  */
 public function DeliverNotification(Logic_WebService_Orange_DeliverNotification $parameters)
 {
     $sms_status = new SmsStorageStatus();
     $sms_status_id = $sms_status->findIdBySmsId($parameters->sms->transactionId);
     if ($sms_status_id !== false) {
         try {
             $sms_status->updateStatus($sms_status_id, $parameters->sms->transactionId, $parameters->sms->status, $parameters->sms->errorCode, $parameters->sms->content);
         } catch (Exception $e) {
             throw new SoapFault('606', 'Błąd przy zapisywaniu notyfikacji');
         }
         return new Logic_WebService_Orange_DeliverNotificationResponse(true);
     } else {
         return new Logic_WebService_Orange_DeliverNotificationResponse(false);
     }
 }
Esempio n. 2
0
 public function checkstatusAction()
 {
     $request = $this->getRequest();
     $id = $this->_helper->IdConvert->hexToStr($request->getParam('id'));
     $data = array();
     if (!empty($id)) {
         try {
             $model = new SmsStorageStatus();
             $lastStatus = $model->getSmsBySmsStorage($id, true);
             if (isset($lastStatus[0])) {
                 if ($lastStatus[0]['status_dict'] < 4 || $lastStatus[0]['status_dict'] == 8 || $lastStatus[0]['status_dict'] == 9) {
                     $http = new Zend_Controller_Request_Http();
                     $ip = $http->getServer('SERVER_ADDR');
                     $serviceModel = new WsServiceSms();
                     $service = $serviceModel->getService($lastStatus[0]['ws_service_sms_id']);
                     $sms = new Logic_Sms($service, $ip);
                     if ($lastStatus[0]['ws_package_sms_id'] === NULL) {
                         $sms->info($lastStatus[0]['smsid']);
                     } else {
                         $sms->packageinfo($lastStatus[0]['smsid']);
                     }
                 }
             }
             $data = $model->getSmsBySmsStorage($id);
             $paginator = new Base_Paginator(new Base_Paginator_Adapter_Array($data, array('RowClass' => 'Row_SmsStorageStatus')));
             $this->view->paginator = $paginator;
             if ($lastStatus[0]['ws_package_sms_id'] === NULL) {
                 $this->view->headers = array('smsid', 'status_dict', 'messagePriority', 'idProt', 'conectorId', 'encoding', 'smsType', 'validTo', 'delivNotifRequest', 'sendDate', 'lastStatusChange', 'created_at');
             } else {
                 $this->view->headers = array('smsid', 'status_dict', 'numberOfMessages', 'numberOfMessagesLeftToSent', 'created_at');
             }
         } catch (Logic_Service_Exception $ex) {
             $this->_helper->redirector('index');
             $this->_helper->messenger('error', 'Nie udało się pobrać statusu');
             return;
         }
     } else {
         $this->_helper->messenger('error', 'Brak ID!');
         $this->_helper->redirector('index');
         return;
     }
 }
Esempio n. 3
0
 /**
  * 
  * @param type $packageDataId
  * @param Logic_Sms_Response $response
  */
 protected function _saveStorageStatusMany(array $smsStorageIds, $packageDataId, Logic_Sms_Response $response)
 {
     $model = new SmsStorageStatus();
     $constantData = array('ws_package_data_id' => $packageDataId, 'sms_status' => $response->status);
     $model->insertStatusMany($smsStorageIds, $constantData);
 }