我使用这个SMPP 库。这是我的代码:
$transport = new SocketTransport(array($smpphost),$smppport,false,'printDebug'); // hostname/ip (ie. localhost) and port (ie. 2775)
$transport->setRecvTimeout(10000);
$transport->setSendTimeout(10000);
$smpp = new SmppClient($transport,'printDebug');
// Activate debug of server interaction
$smpp->debug = true; // binary hex-output
$transport->debug = true; // also get TSocket debug
// Open the connection
$transport->open();
$smpp->bindTransmitter($systemid,$password);
// Prepare message
$message = 'H€llo world';
$encodedMessage = GsmEncoder::utf8_to_gsm0338($message);
$from = new SmppAddress(GsmEncoder::utf8_to_gsm0338('SMPP Tést'),SMPP::TON_ALPHANUMERIC);
$to = new SmppAddress($too,SMPP::TON_INTERNATIONAL,SMPP::NPI_E164);
// Send
$smpp->sendSMS($from,$to,$encodedMessage);
// Close connection
$smpp->close();
和错误,我得到:
致命错误:在 /home/roman/www/jobeet/php-smpp-master/smppclient.class.php 中的第 621 行 SmppException: Bind Failed in /home/roman/www/ 中未捕获的异常“SmppException”和消息“Bind Failed” jobeet/php-smpp-master/smppclient.class.php 在第 621 行调用堆栈:0.0007 345736 1. {main}() /home/roman/www/jobeet/index.php:0
我的代码中可能有错误还是只是 SMPP 服务器问题?