
Sending SMS via Openvox VoxStack Gateway
The article is likely to be of interest only to owners of GSM OpenVox gateways of the VoxStack line, real and potential. It is known that inside these gateways is a full-fledged Asterisk. Which has additional commands in AMI and CLI for sending SMS.

[Photo from the topic with a good description of the functionality of these GSM gateways]
Next, I want to introduce you to two small developments on node.js, which allowed me to make sending SMS via VoxStack more convenient.
Openvox-sms
npm openvox-sms is a small wrapper for AMI commands to send SMS from an application to node.js. It adds the function of splitting long texts into smaller ones to send a composite SMS.
In the asterisk CLI of the gateway, there are two commands for sending SMS:
> gsm send sync sms span number text timeout
> gsm send sync csms span number text flag smscount smssequence timeout
The first command to send a simple sms (specify the span module, destination number, text itself, and optionally timeout).
The second is to send a part (concatenated sms) from a long one (additionally, for each part, specify the number of total smscount parts, and the current part number smssequence). You need to send as many teams as you have SMS parts. If you send commands with the correct parameters, then on the mobile phone these parts will be collected in one SMS.
Openvox-sms accurately wraps the interaction with the asterisk, and then SMS can be sent without bothering with a longer or shorter SMS.
A little more about the commands is in the documentation for the gateway .
Learn more about using npm openvox-sms: github.com/antirek/openvox-sms .
Openvox-sms-worker
Of course, using the openvox-sms wrapper is convenient, but you won’t be able to use all applications that need to send SMS, add connection settings and check how they send SMS. (Moreover, the option is not ruled out that the time will come and you will probably have to replace the gsm gateway with some online SMS sending service).
In this case, it is more convenient to use the RabbitMQ queue to send SMS, which will be served by a worker who works directly with the OpenVox VoxStack gsm gateway.
This worker configured once, and all applications will send messages to the general queue. Now you can look at the logs of working with the gsm gateway in one place, check the sending of SMS.
Learn more about openvox-sms-worker settings: github.com/antirek/openvox-sms-worker .
Suggestions, constructive ideas?

[Photo from the topic with a good description of the functionality of these GSM gateways]
Next, I want to introduce you to two small developments on node.js, which allowed me to make sending SMS via VoxStack more convenient.
Openvox-sms
npm openvox-sms is a small wrapper for AMI commands to send SMS from an application to node.js. It adds the function of splitting long texts into smaller ones to send a composite SMS.
In the asterisk CLI of the gateway, there are two commands for sending SMS:
> gsm send sync sms span number text timeout
> gsm send sync csms span number text flag smscount smssequence timeout
The first command to send a simple sms (specify the span module, destination number, text itself, and optionally timeout).
The second is to send a part (concatenated sms) from a long one (additionally, for each part, specify the number of total smscount parts, and the current part number smssequence). You need to send as many teams as you have SMS parts. If you send commands with the correct parameters, then on the mobile phone these parts will be collected in one SMS.
Openvox-sms accurately wraps the interaction with the asterisk, and then SMS can be sent without bothering with a longer or shorter SMS.
var osms = require('openvox-sms');
var sms = new osms({host: '192.168.1.5'});
sms.on('connect', function () {
sms.sendSMS({
span: 1,
number: '8913ХХХХХХХ',
text: 'My long-long-long text about London'
}, function (err, response) {
sms.close(function () {
});
});
});
A little more about the commands is in the documentation for the gateway .
Learn more about using npm openvox-sms: github.com/antirek/openvox-sms .
Openvox-sms-worker
Of course, using the openvox-sms wrapper is convenient, but you won’t be able to use all applications that need to send SMS, add connection settings and check how they send SMS. (Moreover, the option is not ruled out that the time will come and you will probably have to replace the gsm gateway with some online SMS sending service).
In this case, it is more convenient to use the RabbitMQ queue to send SMS, which will be served by a worker who works directly with the OpenVox VoxStack gsm gateway.
This worker configured once, and all applications will send messages to the general queue. Now you can look at the logs of working with the gsm gateway in one place, check the sending of SMS.
Learn more about openvox-sms-worker settings: github.com/antirek/openvox-sms-worker .
Suggestions, constructive ideas?