@ntlab/sms-gw v2.0.3
Node SMS Gateway App
Introduction
Node SMS Gateway App provides an easy way to deploy SMS Gateway which includes terminal and gateway. Each terminal and gateway can be deployed in separate host.
Node SMS Gateway App is a pure SMS gateway implementation that doesn't requires or depends to any external SMS gateway service or library.
Requirement
- Nodejs version 8.11.3 or higher. If you're using Linux box, use of NodeSource Node.js Binary Distribution is recommended.
- MySQL Server, using other database server is supported as long as Sequelize supports it.
- Supported hardwares, see https://github.com/tohenk/node-sms-terminal#hardware-support.
Installation
Installation is available using GIT.
Clone Node SMS Gateway App
$ cd ~
$ git clone https://github.com/tohenk/node-sms-gw.gitInstall npm dependencies
$ cd ~/node-sms-gw
$ npm installPreparation
MySQL must be already configured properly. Refer to MySQL documentation to do so.
Creating MySQL schema
$ cd ~/node-sms-gw
$ mysql -u root -p < docs/smsgw.sqlAdding MySQL user
$ mysql -u root -p
mysql> grant all privileges on 'smsgw'.'*' to 'user'@'%' identified by 'password';
mysql> exitReplace both
userandpasswordwith desired user and password.
Adding user and setting permission
If you're using Linux box, it is recommended to run services as separate user and give write access to required files and folders.
$ sudo adduser --system --no-create-home --disabled-login nodejs
$ cd ~/node-sms-gw
$ cp node_modules/@ntlab/sms-terminal/msgref.json .
$ sudo chown -vR nodejs config data logs sessions msgref.jsonIt is necessary to add nodejs user to dialout group to be able to use modem port.
$ sudo adduser nodejs dialoutConfiguration
Creating services
Linux
To install Node SMS Terminal as service, follow this commands. Adjust the path as needed.
$ cd ~/node-sms-gw
$ vi service/linux/systemd/node-sms-terminal.service
$ sudo cp service/linux/systemd/node-sms-terminal.service /etc/systemd/system/
$ sudo systemctl daemon-reload
$ sudo systemctl enable node-sms-terminal.serviceAnd finally, to start Node SMS Terminal issue:
$ systemctl start node-sms-terminalTo install Node SMS Gateway as service, follow this commands. Adjust the path as needed.
$ cd ~/node-sms-gw
$ vi service/linux/systemd/node-sms-gateway.service
$ sudo cp service/linux/systemd/node-sms-gateway.service /etc/systemd/system/
$ sudo systemctl daemon-reload
$ sudo systemctl enable node-sms-gateway.serviceAnd finally, to start Node SMS Gateway issue:
$ systemctl start node-sms-gatewayWindows
Windows service functionality currently handled by
node-windows. To install
node-windows follow this step:
> cd path\to\node-sms-gw
> npm install node-windows --global
> npm link node-windowsNode SMS Terminal service
Execute following commands in the Administrator Command Prompt:
> cd path\to\node-sms-gw
> node service\windows\terminal.js install
> net start nodesmsterminal.exeNode SMS Gateway service
Execute following commands in the Administrator Command Prompt:
> cd path\to\node-sms-gw
> node service\windows\gateway.js install
> net start nodesmsgateway.exe