[ENG] 14.6. [DKSF 53/203.1 IU] Controlling GSM Modem

The HTTP API in the device can be used to integrate with web applications without using the SNMP protocol. Via the HTTP API, control of the built-in GSM modem is available.

Sending SMS

http://192.168.0.100/sendsms.cgi?utf8

The URL is called by the POST method. POST data is an SMS text encoded in UTF-8.

To send SMS in encoding Windows 1251, you can use:

http://192.168.0.100/sendsms.cgi

Requesting a Balance of a SIM Card

http://192.168.0.100/ussdstart.cgi?requestcode

where:

requestcode – is 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 Requesting the Balance of a SIM Card

http://192.168.0.100/ussdread.cgi

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

Returned Values

Successful Execution of a Command:

ussdsend_result("response_from_gsm_оператора");

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