How to use SMS with the beroNet GSM Gateway
The beroNet GSM Gateway has different interfaces for sending SMS, depending on the use case:
- App Interface - Used by Apps that run directly on the Gateway
- API Interface - Used by external Apps, that control the Gateway via its REST-API
- GUI - Used by the Admins that send SMS via the beroNet Gateway GUI
Both the GUI and the API use the internal App Interface, this is the common base.
Apps Interface
The GSM Gateway provides an internal directory structure to send and receive SMS. It is located in /tmp/sms/ and contains three spools in/ for received messages, out/ for messages to be sent and failout for messages that have failed to be send.
The format for messages sent / received is defined as follows:
date=01/01/1970,00:00:00+00 num=1234567890 from=mail@mail.net port=1 msg=Hello, World. This is a test.
To send a message, all parameters have to be set. Even though in most cases the field from is not neccessary, it then should be set to none. While all other parameters are one-liners, the field msg can span over several lines, depending on how the message was formated. For this reason it has to be the last field, as the body of a message is read until <EOF>.
Received messages and those which have been failed to be sent have to be processed frequently as the cleanup-routine removes one hour old messages every hour.
The naming-scheme for messages is:
- /tmp/sms/out/: name can be chosen freely; should not contain spaces or special-chars; has to end with .sms
- /tmp/sms/failout/: subfolder with freely chosen name; should not contain spaces or special-chars; has to contain a file named message and a file named message.log
- /tmp/sms/in/: incoming messages are created by ISGW, messages are named in the range of 000.sms to 999.sms.
API Interface
The REST API is explained here Using the REST-API. The new new API has several commands for:
- sending
- listing
- getting
- deleting
SMS. These commands are directly documented in the API.
To send an SMS you can use the following command:
http://IP-of-GSM-GW/app/api/api.php?apiCommand=SmsSendMessage&GsmPort=0&PhoneNumber=%2B123456&Message=Hello World!
GUI Interface
The GUI is rather self explainable, just go to GSM→SMS and use the interface to send a message.
Known Issues
- For sending SMS you will need to enter a valid SMSC under GSM→General
Related pages
If you need scheduled remote assistance, you can request our on-demand support services: https://www.beronet.com/support