creattico/yeastar-socket-sms

SMS class for yeastar device: allow you to send sms via socket API

v1.0.6 2023-01-17 17:38 UTC

This package is auto-updated.

Last update: 2024-04-17 20:39:47 UTC


README

This library is distributed for free use.

Install with composer

composer require creattico/yeastar-socket-sms

How to use

Initialize the class, passing in all parameters

$s = new SocketApi([
	'host' => 'domain.ext',
	'port' => 1000,
	'gateway_port' => 2, // the trunk port+1
	'account' => 'username',
	'password' => 'password',
	'to' => '00111234567890', // the recipient number preceded by 4 digit country code
	'message' => "The message content",
	'debug' => true // optional: if you want to enable the debug
]);

Send sms

$s->sendSms();

Close the socket

$s->closeSocket();

Debug

Setting the debug param to true, you can access to the log property array

print_r($s->log); // print log message array