Created
May 30, 2016 13:36
-
-
Save Roemerb/b0fd4f0fd9d1c79da2fe6feb6221c4ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'smppclient.class.php'; | |
require_once 'gsmencoder.class.php'; | |
require_once 'sockettransport.class.php'; | |
// Construct transport and client | |
$transport = new SocketTransport(array('smpp.provider.com'),2775); | |
$transport->setRecvTimeout(10000); | |
$smpp = new SmppClient($transport); | |
// Activate binary hex-output of server interaction | |
$smpp->debug = true; | |
$transport->debug = true; | |
// Open the connection | |
$transport->open(); | |
$smpp->bindTransmitter("USERNAME","PASSWORD"); | |
// Optional connection specific overrides | |
//SmppClient::$sms_null_terminate_octetstrings = false; | |
//SmppClient::$csms_method = SmppClient::CSMS_PAYLOAD; | |
//SmppClient::$sms_registered_delivery_flag = SMPP::REG_DELIVERY_SMSC_BOTH; | |
// Prepare message | |
$message = 'H€llo world'; | |
$encodedMessage = GsmEncoder::utf8_to_gsm0338($message); | |
$from = new SmppAddress('SMPP Test',SMPP::TON_ALPHANUMERIC); | |
$to = new SmppAddress(4512345678,SMPP::TON_INTERNATIONAL,SMPP::NPI_E164); | |
// Send | |
$smpp->sendSMS($from,$to,$encodedMessage,$tags); | |
// Close connection | |
$smpp->close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment