drewlabs/envoyer-smpp-v3

SMPP driver for drewlabs envoyer client

v0.2.0 2023-06-12 09:41 UTC

This package is auto-updated.

Last update: 2024-05-03 13:59:00 UTC


README

The library is an implementation of drewlabs/envoyer driver or client interface that interact with Short Message Service server for sending sms through SMPP v3.4 protocol.

In addition to the client, this lib also contains an encoder for converting UTF-8 text to the GSM 03.38 encoding.

Note This lib requires the sockets PHP-extension, and is not supported on Windows

Usage

use Drewlabs\Envoyer\Drivers\Smpp\Adapter;
use Drewlabs\Envoyer\Drivers\Smpp\ClientSecretKeyServer;
use Drewlabs\Envoyer\Message;

$config = require __DIR__.'/config/drivers.php';

// Create
$adapter = new Adapter(new ClientSecretKeyServer($config['host'], intval($config['port']), $config['user'], $config['password']));
$message = Message::new()->from('22990667812')->to('22890667723')->content('Hi!');

// Send the SMPP request
$result = $adapter->sendRequest($message);