Skip to content

Instantly share code, notes, and snippets.

@karson
Forked from leandroo/receive.php
Created March 27, 2023 14:40
Show Gist options
  • Save karson/e058921969cb124f18c9e4455d2e8d6e to your computer and use it in GitHub Desktop.
Save karson/e058921969cb124f18c9e4455d2e8d6e to your computer and use it in GitHub Desktop.
<?php
require_once 'vendor/autoload.php';
// Construct transport and client
$transport = new SocketTransport(array('127.0.0.1'),2775);
$transport->setRecvTimeout(60000); // for this example wait up to 60 seconds for data
$smpp = new SmppClient($transport);
// Activate binary hex-output of server interaction
$smpp->debug = true;
$transport->debug = true;
// Open the connection
$transport->open();
$smpp->bindReceiver("user","pass");
// Read SMS and output
$sms = $smpp->readSMS();
echo "SMS:\n";
var_dump($sms);
// Close connection
$smpp->close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment