[ENG] 17.8. [DKSF 70/71.6 IU] Controlling GSM Modem

The interface of URL-encoded commands in a device can be used for the integration with web applications without using an SNMP protocol. Controlling a built-in GSM modem is available through the interface of URL-encoded commands.

Sending SMS

http://192.168.0.100/sendsms.cgi?utf8

URL is called by the method POST. Data POST is the SMS text in the encoding UTF-8. More detailed information about sending random SMS notifications can be read in the section «[ENG] 11.11. [DKSF 70/71.6 IU] How to Send Random SMS?».

Returned Values

Successful execution of a command:

smssend_result('ok');

Error in a text of a request:

smssend_result('error');

GSM modem is busy:

smssend_result('busy');

Requesting a Balance of a SIM Card

http://192.168.0.100/ussdstart.cgi?requestcode

where:

requestcode – a100x, which means *100#. In the code of the USSD request, «*» is replaced by «a», «#» is replaced by «x» (Latin characters).

Returned Values

Successful execution of a command:

ussdsend_result('ok');

Getting a Response to a Balance Request of a SIM Card

http://192.168.0.100/ussdread.cgi

Evoke 20 seconds after requesting the balance of a SIM card.

Returned Values

Successful execution of a command:

ussdsend_result("response_of_gsm_operator");

Authorization

To add a login and password to the structure of a URL-encoded command, it is possible to use the next scheme:

  • http://<username>:<password>@<host>:<port>/<URL‐path>?<parameters>

where:

<username>:<password> – are credentials for authorization in a device web interface;

<host>  is an IP address of a device;

<port>  is a port of an HTTP server;

<URL‐path>?<parameters>  is a URL-encoded command