Beispiel #1
0
 protected function send()
 {
     $sc = $this->soap->open($this->soapPath);
     $this->vars['method'] = $this->method;
     $method = ucfirst($this->method);
     validator::loadDictionaries(array(ucfirst($this->method)));
     validator::validateInput($this->vars);
     $cleanData = validator::getCleanData();
     $errors = validator::getErrors();
     if (empty($errors)) {
         if ($this->live == true) {
             $result = $sc->__call($method, array($this->params));
             if (!empty($this->vars['body'])) {
                 debug::output('***************LIVE SENDING START***************');
                 debug::output($this->vars['body']);
                 debug::output('***************LIVE SENDING END***************');
             }
             $resultMethod = $method . 'Result';
             //Dynamic method name dependent on the class name
             $this->response = $result->{$resultMethod};
             sleep(10);
             //give the api time to report the message status
             debug::output("\n");
             debug::output('***************LIVE CHECK DELIVERY START***************');
             $smsstatus = new smsstatus($this->vars);
             $this->fault = $smsstatus->database();
             debug::output('***************LIVE CHECK DELIVERY END***************');
         } else {
             //else dev
             //log for DEV
             //print_r($this->params);
             //$this->logdb->updateLogOutboundSMS($this->params);
             if (!empty($this->vars['body'])) {
                 debug::output('***************LIVE SENDING START***************');
                 debug::output($this->vars['body']);
                 debug::output('***************LIVE SENDING END***************');
             }
         }
         //else dev
     } else {
         debug::output("There were errors in the data to be sent");
         $logdb->logValidationErrors($this->vars, $errors);
     }
 }
Beispiel #2
0
<?php

chdir('../../sms/');
define("SITE", "");
include_once 'init.inc.php';
$lock = 'nolock';
config::set('process_name', "Inbox - Get SMS Status");
include_once 'start.inc.php';
$input['clientMessageReference'] = $argv[2];
try {
    $smsstatus = new smsstatus($input);
    $smsstatus->database();
} catch (emailException $e) {
    debug::output($e->getMessage());
} catch (Exception $e) {
    debug::output($e->getMessage());
    //$status->status(CRITICAL);
}
include 'end.inc.php';