Ignore:
Timestamp:
Nov 14, 2014 6:01:48 AM (11 years ago)
Author:
dungnv
Message:
 
Location:
pro-violet-viettel/sourcecode/application/modules/services/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php

    r470 r499  
    1616        }
    1717       
     18        public function index ()
     19        {
     20                error_reporting(E_ALL);
     21                $this->load->model('Services_model');
     22                //$this->Services_model->cardPaidProcess($aryParams);
     23                echo $this->Services_model->processMORequest('01662860000', strtoupper('Sbg vip 1'));
     24               
     25        }
     26       
    1827        public function testmo() {
    1928                $url = 'http://10.58.38.162/violetservice/soanbai/mo?wsdl';
     
    5968        }
    6069       
    61         public function send($msg)
     70        public function send($msg, $receiverID)
    6271        {
    6372                $url = $this->config->item('mt_service_url');
     
    6675                $operator = 'InsertMT';
    6776                $operation = 'http://tempuri.org/InsertMT';
    68                        
     77               
     78                $aryMatch = array();
     79                if (preg_match('/^(0)([0-9]{9,10})$/', $receiverID, $aryMatch) == 1) {
     80                        $receiverID = '84'. $aryMatch[2];
     81                }
     82               
    6983                $aryParams = array(
    7084                                'User' => $username,
     
    7387                                'UserID' => '841662860000',
    7488                                'RequestID' => '4',
    75                                 'ReceiverID' => '84988568786',
     89                                'ReceiverID' => $receiverID,
    7690                                'ServiceID' => '8062',
    7791                                'CommandCode' => 'SBG',
     
    93107                }
    94108       
     109                var_dump($result);
     110               
    95111                echo "<br/>";
    96112                echo "<h2>Request</h2>";
     
    104120        {
    105121                $url = $this->config->item('topup_service_url');
    106                 $operator = 'TopupService';
    107                 $operation = 'http://soanbaigiang.smas.vn/ITopupService/TopUp';
     122                $operation = 'http://tempuri.org/ITopupService/TopUp';;
    108123               
    109124                $username = 'sbg';
     
    162177                                'user' => $username,
    163178                                'pass' => $password,
    164                                 'MSISDN' => '1689925260',
     179                                'MSISDN' => '01662860000',
    165180                                'Charging' => '100',
    166181                                'Contents' => 'Namta-Active'
     
    180195                }
    181196               
     197                var_dump($result);
     198               
    182199                echo "<br/>";
    183200                echo "<h2>Request</h2>";
  • pro-violet-viettel/sourcecode/application/modules/services/controllers/viettel.php

    r483 r499  
    3535                function messageReceiver(){
    3636                        $aryArgs = func_get_args();
    37                         list($username, $password, $requestID, $userID, $receiverID, $serviceID, $commandCode, $contentType ,$info, $receiveTime) = $aryArgs;
     37                        list($username, $password, $requestID, $userID, $receiverID, $serviceID, $commandCode, $info, $receiveTime) = $aryArgs;
    3838                       
    3939                        $msgType = '0'; //text message
     
    4848                        if ($username != $mo_username) return '0|0|Username is not corrected!';
    4949                        if ($password != $mo_password) return '0|0|Password is not corrected!';
    50                         if (!$requestID) return '0|0|requestID is required!';
    51                         if ((int)$requestID != 4) return '0|0|requestID is not corrected!';
     50                        if (!$requestID) return '0|0|requestID is required!';                   
    5251                        if (!$userID) return '0|0|UserID is required!';
    5352                        if (!$serviceID) return '0|0|serviceID is required!';
    5453                        if ($serviceID != '8062') return '0|0|serviceID is not corrected!';
    55                        
    56                         $status = 0;
    57                         $sentNumber = $userID;                                                                 
    58                         $username = !$receiverID ? $sentNumber : $receiverID;
    59                        
    60                         $CI->load->model('frontend/user_model', 'userModel');
    61                         $password = $CI->userModel->create_random_password();           
    62                        
    63                         $result = $CI->userModel->register ($sentNumber, $receiverID, $serviceID, $commandCode, $info, $receiveTime, $status);
     54
     55                        $CI->load->model('Services_model');
     56                        $CI->load->model('frontend/User_model', 'objUserModel');
     57                        $result = $CI->Services_model->processMORequest($userID, strtoupper($info));
     58                        $CI->objUserModel->insertSmslog($receiverID, $serviceID, $commandCode, $info, $receiveTime);
    6459                                       
    6560                        $aryResult = explode ('|', $result);
    66                        
    6761                        return $aryResult[0].'|'.$msgType.'|'.$aryResult[1];
    6862                }
    6963               
    7064                $this->_server->addFunction('messageReceiver');
     65               
    7166                try {
    7267                        ob_start();
Note: See TracChangeset for help on using the changeset viewer.