public function SendSMS() { $client = new SoapClient($this->wsdl_link); $result = $client->sendSms(array('userName' => $this->username, 'password' => $this->password, 'SenderNumber' => $this->from, 'MobileNumber' => $this->to, 'SmsText' => array($this->msg), 'sendType' => 1, 'smsMode' => 1)); //http://www.tgfsms.ir/sendSmsViaURL2.aspx?userName=hossein_mahzoon&password=123456&smsText=myText&reciverNumber=09351523606&senderNumber=10007132302309 if ($result) { $this->InsertToDB($this->from, $this->msg, $this->to); $this->Hook('wp_sms_send', $result); } return $result; }
private function sendSmsSoap() { ini_set('soap.wsdl_cache_enabled', 0); $data = $this->prepareData(true); $soapUrl = $this->getEndPointSoap(); $service = new \SoapClient($soapUrl); $session = $service->loginSms($data['reference'], $data['key'], "fr"); $result = $service->sendSms($session, $data['designation'], $data['senderid'], $data['gsm'], $data['message'], $data['date'], $data['life'], $data['myid']); return $result; }
} $phone_pattern = '/(\\b(380){1}[0-9]{9}){1}/'; $req['phone'] = $_POST['phone']; if (preg_match($phone_pattern, $req['phone'])) { $phone = $req['phone']; $key = getkey(); if (writekey($phone, $key, $pdo)) { //SEND SMS CODE FOR PHONE NUMBER $conn = new SoapClient('https://gate.smsclub.mobi/soap/soapGateway.wsdl'); $login = $sms_user; $password = $sms_pass; $alphaName = 'Taxi Joker'; $text = 'Ваш код для реєстрації: ' . $key . ' , дійсний протягом 1 години.'; // SINGLE MESSAGE $destAddr = $phone; try { $smscIds = $conn->sendSms($login, $password, $alphaName, $destAddr, $text); $res['response'] = '1'; } catch (SoapFault $exception) { $res['response'] = '0'; $res['exception'] = $exception; $res['credits']['user'] = $sms_user; $res['credits']['pass'] = $sms_pass; } } else { $res['response'] = '0'; } } else { $res['response'] = '0'; } echo json_encode($res);