Skip to content

Instantly share code, notes, and snippets.

@karson
Forked from leandroo/receive.php
Created March 27, 2023 14:40
Show Gist options
  • Select an option

  • Save karson/e058921969cb124f18c9e4455d2e8d6e to your computer and use it in GitHub Desktop.

Select an option

Save karson/e058921969cb124f18c9e4455d2e8d6e to your computer and use it in GitHub Desktop.

Revisions

  1. @leandroo leandroo created this gist May 31, 2020.
    23 changes: 23 additions & 0 deletions receive.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    <?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();