Hc_tc_phones_push
Команда обновления конфигурации телефона.
Аналог команды в CoCon:
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://server:9999/commands/tc_phone_push
Код HTTP-ответа:
- reason = ok - успешно;
- reason = other - ошибка.
XSD-схема, валидирующая входные и выходные данные:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <!-- Types --> <xs:complexType name="phonesStatusType"> <xs:attribute name="phone" type="xs:string" use="required"/> <xs:attribute name="reason" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="requestType"> <xs:attribute name="domain" type="xs:string" use="required"/> <xs:attribute name="master" type="xs:string" use="optional"/> </xs:complexType> <xs:complexType name="responseType"> <xs:sequence> <xs:element name="meeting" type="phonesStatusType" minOccurs="1" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <!-- in --> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="request" type="requestType"/> </xs:all> </xs:complexType> </xs:element> <!-- out --> <xs:element name="out"> <xs:complexType> <xs:all> <xs:element name="response" type="responseType"/> </xs:all> </xs:complexType> </xs:element> </xs:schema>
Примеры:
Запрос на обновление конфигурации телефонов всех мастеров в домене:
http://192.168.1.21:9999/commands/tc_phone_push
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_tc_phones_push.xsd"> <request domain="biysk.local"/> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_tc_phones_push.xsd"> <response> <phone phone="240101" reason="ok"/> <phone phone="240244" reason="ok"/> <phone phone="240475" reason="ok"/> </response> </out>
Запрос на обновление конфигурации телефона мастера 240101 в домене:
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_tc_phone_push.xsd"> <request domain="biysk.local" master="240101"/> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_tc_phones_push.xsd"> <response> <phone phone="240101" reason="ok"/> </response> </out>
Hc_tc_phones_status_list
Команда просмотра статуса телефона.
Аналог команды в CoCon:
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://server:9999/commands/tc_phone_status_list
Код HTTP-ответа:
- 200 - успешно;
- 404 - ошибка.
XSD-схема, валидирующая входные и выходные данные:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <!-- Types --> <xs:complexType name="phonesStatusType"> <xs:attribute name="phone" type="xs:string" use="required"/> <xs:attribute name="alias" type="xs:string" use="required"/> <xs:attribute name="api" type="xs:string" use="required"/> <xs:attribute name="uac" type="xs:string" use="required"/> <xs:attribute name="ip" type="xs:string" use="optional"/> <xs:attribute name="status" type="xs:string" use="optional"/> </xs:complexType> <xs:complexType name="requestType"> <xs:attribute name="domain" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="responseType"> <xs:sequence> <xs:element name="meeting" type="phonesStatusType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <!-- in --> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="request" type="requestType"/> </xs:all> </xs:complexType> </xs:element> <!-- out --> <xs:element name="out"> <xs:complexType> <xs:all> <xs:element name="response" type="responseType"/> </xs:all> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос статусов телефонов мастеров из домена: http://192.168.1.21:9999/commands/tc_phone_status
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_tc_phone_status_list.xsd"> <request domain="biysk.local"/> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_tc_phones_status_list.xsd"> <response> <phone phone="240101" alias="fbbaa0f2252e4139" api="tc_yealink_api" uac="Yealink SIP-T28P 2.73.14.3" ip="192.168.2.6" status="configured"/> <phone phone="240244" alias="fbba9fd42d8fffb5" api="tc_yealink_api" uac="Yealink SIP-T28P 2.73.14.3" ip="192.168.2.6" status="configured"/> <phone phone="240475" alias="fbbaa155aa3145fb" api="tc_undefined_api" uac="RG-1402G/1.8.1 SN/VI0C000069 sofia-sip/1.12.10" ip="192.168.2.6" status="configured"/> </response> </out>