onlinecity / php-smpp

PHP 5 based SMPP client library
232 stars 160 forks source link

Uncaught SmppException: Bind Failed #88

Open GeekGuste opened 4 years ago

GeekGuste commented 4 years ago

Hello, I use the smpp library to connect to a remote smpp server. Opening the connection works well but when I run a bindTransmitter I get the following error:

[19-Sep-2019 23:28:13 Europe/Paris] PHP Fatal error: Uncaught SmppException: Bind Failed in /home/tincaxxc/catchit.cap-culture.info/smpp-server/smppclient.class.php:622 Stack trace:

0 /home/tincaxxc/catchit.cap-culture.info/smpp-server/smppclient.class.php(479): SmppClient->sendCommand(2, 'myusername\x00mypassword...')

1 /home/tincaxxc/catchit.cap-culture.info/smpp-server/smppclient.class.php(134): SmppClient->_bind('myusername', 'mypassword', 2)

2 /home/tincaxxc/catchit.cap-culture.info/smpp-server/send.php(24): SmppClient->bindTransmitter('myusername', 'mypassword')

3 {main}

thrown in /home/tincaxxc/catchit.cap-culture.info/smpp-server/smppclient.class.php on line 622

This is my code

<?php require_once 'smppclient.class.php'; require_once 'gsmencoder.class.php'; require_once 'sockettransport.class.php';

$host = "provider.ip"; $port = "8282"; $username = 'myusername; $password = 'mypassword';

// Construct transport and client $transport = new SocketTransport(array($host), $port); $transport->setRecvTimeout(10000); $smpp = new SmppClient($transport);

// Activate binary hex-output of server interaction $smpp->debug = true; $transport->debug = true;

$transport->setSendTimeout(30000);

// Open the connection $transport->open(); $smpp->bindTransmitter($username,$password);