Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

The GSM service is designed to control the monitoring system via SMS, to organize SMS dispatches and to send SMS notifications when logic schemes are activated.

GSM control is possible if there is a "gsm" permission in the profile of the user performing the request.

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

  • getelement - get the parameters of the GSM modem element, additional fields are:
    • 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;


  • Response example on a query getelement for GSM modem element
    <element id="1010" module="16" clas="devhwr" type="GSM modem" state="normal" name="GSM Modem TELE2" value="51" imei="861785001227689" pin="0000" sms_centre="89537300611" allowed="+79206355186" status="found, ready" verbosity="7" > 
        <balance phone="*105#" text="" t="0" /> 
        <operators current="TELE2" status="registered" signal="-81" > 
            <operator id="0" status="current" name="TELE2" /> 
            <operator id="1" status="available" name="MegaFon RUS" /> 
            <operator id="2" status="available" name="Beeline" /> 
            <operator id="3" status="available" name="RUS DTC" /> 
            <operator id="4" status="available" name="MTS-RUS" /> 
        </operators> 
        <smslist period="100days">
    	    <sms id="0" state="send" to_phone="000100" message="test1" t="1398585756" />
    		<sms id="1" state="send" to_phone="000100" message="test2" t="1398585761" />
    		<sms id="2" state="send" to_phone="000100" message="test3" t="1398585817" />
    		<sms id="3" state="send" to_phone="000100" message="test4" t="1398585824" />
    	</smslist>
    </element>

    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;

      • 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.
      • signal - signal strength in the network in dB;
    • 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 - list of SMS, for sending the SMS there's a request send_sms_message;
      • period - the period ('100seconds', '100minutes', '100hours', '100days');
    • sms - SMS in the queue:
      • id - identifier of SMS in the queue;
      • state - SMS status:
        • 'wait' - added to the queue, waiting for sending;
        • 'send' - sent;
        • 'error' - could not be sent.
      • to_phone - phone number of the SMS's recipient;
      • message - SMS text;
      • t - the time when added to the queue in UTS.
  • updateelement - set GSM modem parameters, additional fields are:
    • id - identifier of the GSM modem element;
    • name - the name of the modem;
    • pin - SIM's PIN code;
    • sms_centre - 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;
    • 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.





  • No labels