Skip to content

Instantly share code, notes, and snippets.

@leandroo
Created May 31, 2020 15:56
Show Gist options
  • Save leandroo/4fb089c99d7fb6c0a470b9e6875ca8a9 to your computer and use it in GitHub Desktop.
Save leandroo/4fb089c99d7fb6c0a470b9e6875ca8a9 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