Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following values ​​of the querytype field are used for management:

...

getgsm - get the parameters of the GSM modem

...

:

  • id - identifier of the GSM modem element;
  • period - optional, if available, issues a list of SMS for the specified period, possible values are:
  • '100seconds' - the last 100 seconds;
  • '100minutes' - the last 100 minutes;
  • '100hours' - the last 100 hours;
  • '100days' - the last 100 days;k - user session ID.


Code Block
languagexml
titleResponse example on a query

...

getgsm
<gsm imei="

...

123456" 

...

state="normal

...

"

...

 pin="

...

1111" 

...

status="

...

registered, 

...

home network" signal="54%" operator="Aqua3" allowed="+65214567788 +32154897744" smsc="59537322611" >
	<sms_list>
		<sms id="2545109407" to="+65214567788" text="test message 1" status="

...

failed" 

...

date="

...

1563176384" />

...

		<sms id="

...

3784153937" 

...

to="

...

+98521141100" 

...

text="

...

test message

...

 A" status="pending" date="1563176803" />
		<sms id="

...

1598774555" 

...

to="

...

+98521563322" 

...

text="

...

test message

...

 

...

3" 

...

status="

...

sent" 

...

date="

...

1563177201" />
	</

...

sms_list>
</

...

gsm>

Description of the xml nodes:

  • element - the properties of the GSM modem element:

  • id - identifier;

  • module - module identifier;

  • clas - class of the device;

  • type - device type;

  • state - state:

    • 'normal' - the modem is ready to send SMS;

    • 'alarm' - there's an internal error.

  • name - the name of the device;

  • value - modem signal strength in %;

  • imei - international identifier of mobile equipment;

  • pin - SIM PIN code;

  • sms_centre - SMS center number;

  • gsm - SGM modem settings and status;
    • imei - IMEI unique code;
    • state - state of modem (alarm, normal, not connected);
    • pinSIM's PIN code;
    • allowed - list of numbers from which SMS - commands are allowed, division of numbers through a space ' ';
    • status - current state of the modem:

      • 'initialization' - modem initialization;
      • 'found, initialization' - modem found, continued initialization;
      • 'turn on time out' - timeout for the modem to turn on;
      • 'found, ready' - the modem is ready to work;
      • 'found, not ready' - the modem is not ready or defective;
      • 'SIM-card not inserted' - SIM card installation error;
      • 'PIN code required' - PIN code required;
      • 'PIN code invalid' - the PIN is incorrect;
      • 'PIN code length incorrect' - the length of the PIN code is incorrect;
      • 'PIN code must be digit' - the PIN must consist only of digits;
      • 'PUK code required' - PIN blocked, PUK code required;
      • 'SMS Center number incorrect' - the SMS center number is incorrect;
      • 'error sending SMS' - SMS sending error;
      • 'command maximum repeated' - the maximum number of attempts to send an AT command;
      • 'reset modem' - restart of the modem;
      • 'number of resets is exceeded' - the maximum number of attempts to restart;
      • 'modem turn off' - power to the modem is disabled;
    • verbosity - the level of debugging information (more in the description "updateelement");
    • balance - the balance information node, issued only when the balance number is set, after updating the balance with the command with the fields querytype = "updateelement" and ctrl="updatebalance" for the GSM Modem element; attributes are:
      • phone - balance service number;
      • text - the text of the response to the balance request;
      • t - the time when the balance information is received in the UTS;
    • operators - the list of network operators, is issued only after updating the list of operators with the command with fields querytype="updateelement" and ctrl="updateoperators" for the GSM Modem element, attributes are:
    • current - the name of the current statement;
    • status - the status of the current operator in the network ; possible values are:
    • 'registered' - registered in the network;
    • 'not registered, searching' - searching the network;
    • 'not registered, not searching' - networks not found;
    • 'not registered' - not registered on the network;
    • 'registered roaming' - registered in roaming;
    • 'registration denied' - registration is prohibited.separator - space (example: +72224443434, +72224443435);
    • smsc - the number of the SMS center, this field is empty if the number is determined automatically;
    • status - network registration status string;
    • signal - signal strength in the network in dBstring;
    • operator - available operator:
    • id - the identifier of the operator;
    • status - operator status:
    • 'unknown': unknown;
    • 'available': registration is allowed;
    • 'current': current operator;
    • 'forbidden': registration is prohibited.
    • name - operator 's text name.
      smslist
  • sms_list - list of SMS, for sending the SMS there's a request send_sms_message;
    • period - the period ('100seconds', '100minutes', '100hours', '100days');
    queue of sent SMS;
    • sms - SMS in the queue:
      • id - identifier of SMS in the queue;
      • state status - SMS status:
        • 'wait' pending - added to the queue, waiting for sending;
        • 'send' - failed - could not be sent;
        • 'error' - could not be send - sent.
      • to_phone - phone number of the SMS's recipient;
      • message text - SMS text;
      • t date - the time when added to the queue in UTS.
    updateelement


setgsm - set GSM modem parameters, additional fields are:

  • id - identifier of the GSM modem element;
  • name - the name of the modem;
  • k - user session ID;
  • pin - SIM's PIN code;
  • sms_centre

    smsc - the number of the SMS center

    . It is read when determining the presence of the SIM-card and is stored only on the SIM-card

    , leave this field blank for automatic determination;

  • allowed - list of numbers from which SMS commands are allowed, separator - space (example: +72224443434, +72224443435);
  • balance - the number used for request of the balance and the state of the account;
  • operator - manual installation of the operator of cellular communication;
  • verbosity - the level of debugging information (by default 2nd level). The possible values ​​are:
    • level 0: Emergency - the system is not operational: the maximum number of retries of AT commands, the modem initialization error, the SIM card is not inserted, the maximum number of retries of automatic modem re-uninstitution, the allocation error of dynamic memory;
    • Level 1: Alert - urgent intervention is required: PIN code is required, error when sending SMS;
    • level 2: Critical - critical events: failure to send AT commands, incoming SMS processing error, modem reinitialization, SMS queue is full, the list of available operators is full, successful sending of SMS;
    • level 3: Error - error messages;
    • level 4: Warning - various warnings: text and error number of the AT command, SMS text conversion error;
    • Level 5: Notice - various important notifications: the version of the firmware of the modem;
    • level 6: Informational - information messages: change of SMS center number, registration status in the network, successful processing of incoming SMS;
    • Level 7: Debug - Detailed debugging messages, including exchange of AT commands.
  • ctrl - modem control, possible values:
    • "reset" - reset the modem;
    • "clearsmslist" - clear the SMS queue;
    • "updatebalance" - update the balance; asynchronous, in one minute the balance text is displayed in the log and stored in the text attribute of the balance node;
    • "updateoperators" - update the list of operators;
  • send_sms_message - send SMS via GSM modem, parameters:
  • to_phone - the phone number of the recipient;
  • message - SMS text.


send_sms_message - send SMS via GSM modem, message add to SMS queue, parameters:

  • k - user session ID;
  • to_phone - the phone number of the recipient;
  • message - SMS text.


clearsms - clear the SMS queue, parameters:

  • k - user session ID.


sendussd - send USSD request for check the balance state, not supported in LTE mode, parameters:

  • k - user session ID;
  • to_phone - the balance service number.


Code Block
languagexml
titleResponse example on a USSD request
<ussd text="Account balance 55.6$. Some kind of advertisement here" />
<ussd text="Error parsing ussd answer" />
<ussd text="Request not supported in LTE mode" />