Versions Compared

Key

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

Служба GSM предназначена для управления системой мониторинга посредством SMS, организации SMS рассылок и отправки SMS уведомлений при срабатывании логических схем.

Управление GSM возможно при наличии разрешения "gsm" в профиле пользователя, выполняющего запрос.

Для управления используются следующие значения поля querytype:

getelement  - получить параметры элемента GSM modem, дополнительные поля:

...

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;



  • Code Block
    languagexml
    titleПример ответа на запрос getelement для элемента GSM модем
    <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 

        pin - SIM PIN

        -код SIM-карты

        code;

      • sms_

        centre 

        centre -

        номер

        SMS

        -центра

        center number;

      • allowed - список номеров, с которых разрешен прием SMS-команд, разделение номеров через пробел

        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-картыSIM card installation error;
        • 'PIN code required' - требуется PIN -кодcode required;
        • 'PIN code invalid' - the PIN -код неверныйis incorrect;
        • 'PIN code length incorrect' - длина PIN-кода неправильнаяthe length of the PIN code is incorrect;
        • 'PIN code must be digit' - PIN-код должен состоять только из цифрthe PIN must consist only of digits;
        • 'PUK code required' - PIN -код заблокированblocked, требуется ввести PUK -кодcode required;
        • 'SMS Center number incorrect' - номер SMS-центра некорректныйthe SMS center number is incorrect;
        • 'error sending SMS' - ошибка отправки SMS sending error;
        • 'command maximum repeated' - максимальное количество попыток отправки AT-команды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 - уровень отладочной информации (подробнее в описании updateelementthe 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" для элемента GSM Modem; атрибуты 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 - список операторов сети, выдается только после обновления списка операторов командой с полями 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, для отправки 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 - идентификатор SMS в очереди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 - телефонный номер получателя SMSphone number of the SMS's recipient;
      • message - текст SMS text;
      • t - время добавления в очередь в UTSthe 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 pin - PIN-код SIM-картыSIM's PIN code;
    • sms_centre - номер SMS-центра, считывается при определении наличия SIM-карты и сохраняется только на SIM-карте;
    • allowed - список номеров, с которых разрешен прием SMS-команд, разделитель - пробел;
    • balance - номер, по которому запрашивается баланс, состояние счета;
    • operator - ручная установка оператора сотовой связи;.
    • verbosity - уровень отладочной информации (по-умолчанию 2 уровень). Возможные значения:
      • уровень 0: Emergency - система не работоспособна: максимальное количество повторов АТ команд, ошибка инициализации модема, SIM-карта не вставлена, максимальное количество повторов автоматической переинециализации модема, ошибка выделения динамической памяти;
      • уровень 1: Alert - необходимо срочное вмешательство: требуется ввести PIN-код, ошибка при отправке SMS;
      • уровень 2: Critical - критические события: ошибка отправки АТ-команды, ошибка обработки входящего SMS, переинициализация модема, очередь SMS переполнена, список доступных операторов переполнен, успешная отправка SMS;
      • уровень 3: Error - сообщения об ошибках;
      • уровень 4: Warning - всевозможные предупреждения: текст и номер ошибки AT-команды, ошибка конвертации текста SMS;
      • уровень 5: Notice - различные важные уведомления: версия прошивки модема;
      • уровень 6: Informational - информационные сообщения: изменение номера SMS-центра, состояние регистрации в сети, успешная обработка входящего SMS;
      • уровень 7: Debug - детальные отладочные сообщения, включая обмен AT-командами.
    • ctrl - управление модемом, возможные значения:
    • "reset" - сбросить модем;
    • "clearsmslist" - очистить очередь SMS;
    • "updatebalance" - обновить баланс; асинхронный, текст баланса в течение одной минуты выводится в журнал и сохраняется в атрибуте text узла balance;
    • "updateoperators" - обновить список операторов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.