creattico / yeastar-socket-sms
SMS class for yeastar device: allow you to send sms via socket API
Installs: 175
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/creattico/yeastar-socket-sms
Requires
- php: >=7.2
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