[ENG] 16.5. [DKSF 54.3 IU] Controlling a GSM Modem

To add a login and password to the URL structure, there is a need to use the next scheme:

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

where:

<user_name>:<password> - are credentials for authorisaton in a web interface of a device;

<host> - is an IP address of a device;

<port> - is a port of an HTTP server;

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

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

Sending SMS

http://192.168.0.100/sendsms.cgi?utf8

URL is invoked by the POST method. The POST data is an SMS text in the encoding UTF-8. More detailed information about sending random SMS notifications can be read in the section «[ENG] 9.11. [DKSF 54.2 IU] How to Send Random SMS?».

Returned Values

Successful execution of a command:

smssend_result('ok');

An 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 is a100x, which means *100#. In a code of a USSD request, «*» is replaced by «a», «#» s replaced by «x» (Latin characters).

Returned Values

Succesful execution of a command:

ussdsend_result('ok');

Receiving a Response for Requesting a Balance of a SIM Card

http://192.168.0.100/ussdread.cgi

Invoke 20 seconds after requesting a balance of a SIM card.

Returned Values

Suucessul execution of a command:

ussdsend_result("response_from_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