setFollowme - данный метод устанавливает настройки переадресациии на Premedia аккаунте.
Точка подключения: https://gapi.mtt.ru:6443/v1/api
Авторизация: Basic Auth
Метод: POST
Входные параметры
Name | Type | Description |
---|---|---|
sip_id* | string | Идентификатор аккаунта |
sequence | string:range(Order,Random,Simultaneous) | Тип сортировки при обзвоне списка правил. По умолчанию Order |
caller_id | string | Отображаемый номер А-номер при переадресации Допустимый формат: ^7\d{10}$ ("7"+10цифр). |
followmeStructure | array | Mассив настроек follow_me |
* - обязательные поля
Формат настроек follow_me
Name | Type | Description |
---|---|---|
redirect_number | string | Номер для переадресации |
name | string | Наименование follow_me записи |
timeout | integer | По умолчанию 15 |
active | string:range(Y,N) | Флаг активно/неактивно |
follow_order | integer | Номер в очереди переадресации |
Пример
JSON
{ "jsonrpc":"2.0", "method":"setFollowme", "id":45630, "params":{ "sip_id":"74951348579", "caller_id":"74951348579", "sequence": "Simultaneous", "followmeStructure": [ { "redirect_number": "79163777604", "name": "79163777604", "active": "Y", "timeout":15, "follow_order": 1 }, { "redirect_number": "79636793312", "name": "79636793312", "active": "Y", "follow_order": 2 } ] } }
Успешный ответ
JSON
{ "jsonrpc":"2.0", "id":45630, "result": { "success":1 } }
Не успешный ответ
JSON
{ "jsonrpc":"2.0", "id":45630, "error": { "code":-32602, "message":"Invalid params", "data": [ { "code":"V_REGEX_DO_NOT_MATCH", "attribute":"caller_id", "message":"The caller_id property must match regular expression /^7\\d{10}$/.", "tpl":"The {attribute} property must match regular expression {pattern}.", "tplParams": { "attribute":"caller_id", "pattern":"/^7\\d{10}$/" } } ] } } { jsonrpc":"2.0", "id":45630, "error": { "code":-32603, "message":"Internal error", "data": [ { "code":"A_CAPI_SET_FOLLOWME", "attribute":"sip_id", "message":"Failed to set follow_me for account sip_id «74951346313»", "tpl":"Failed to set follow_me for account {attribute} «{value}»", "tplParams": { "attribute":"sip_id", "value":"74951346313" } } ] } }