Skip to main content

POST события и методы начала звонка и вызова из CRM

Эти методы будут вызывать хендлера (URL вашей системы CRM/ERP и т.д. с обработчиком), который вам нужно создать в своей системе. Тогда при возникновении определённых событий в телефонии по этому хендлеру будет передаваться массив данных в вашу систему. Эти хендлеры вы должны будете сохранить в меню "ИНТЕГРАЦИИ" вашей vPBX https://cld.alovoice.uz/ 

  • В начале входящего или исходящего звонка инициированных телефонией
  • После окончании звонка

POST Событие: НачалоИнициация звонкавызова из вашей системы (CRM/ERP и т.п.)

${handler_url}

В ответ handler должн вернуть

id - integer (max:12) или string (max:32)

зарегистрированного звонка в СРМ

Response (plaintext)

1

Bodyraw (json)
{
    "inner_phone": <integer>,
    "number": "+X.",
    "line": <integer|string>,
    "type": ("inc"|"out"|"int"),
    "start_time": <unix_timestamp>,
}
Example Request (curl)
curl --location -g '${handler_url}' \
--data '{
    "inner_phone": <integer>,
    "number": "+X.",
    "line": <integer|string>,
    "type": ("inc"|"out"|"int"),
    "start_time": <unix_timestamp>,
}'
Example Response

No response body
This request doesn't return any response body

POST Событие: Конец звонка

${handler_url}

Фиксируется окончание звонка по id переданным в начале звонка

Response (plaintext)

true

Коды статуса звонка

200 Успешный звонок.
304 Пропущенный звонок.
603 Отклонено.
603-S Вызов отменен.
403 Запрещено.
404 Неверный номер.
486 Занято.
484 Данное направление не доступно.
503 Данное направление не доступно.
480 Временно не доступен.
402 Недостаточно средств на счету.
423 Заблокировано
OTHER Не определен.

Body raw (json)
{
    "call_id": <integer|string>,
    "finish_time":  <unix_timestamp>,
    "duration":  <integer>,
    "status_code": ( 200 | 304 | 603 | 404 ),
    "record": "https://cld.alovoice.uz/....."
}
Example Request (curl)
curl --location -g '${handler_url}' \
--data '{
    "call_id": <integer|string>,
    "finish_time":  <unix_timestamp>,
    "duration":  <integer>,
    "status_code": ( 200 | 304 | 603 | 404 ),
    "record": "https://cld.alovoice.uz/....."
}'
Example Response

No response body
This request doesn't return any response body

POST Метод: Начало звонка из СРМ

https://cld.alovoice.uz/outcall/YOUR TOKEN

Адрес для инициации исходящего звонока, требуется token

Response

Plain Text

true|false


Body raw (json)

{
    "call_id": "e5e456se456s56w456",
    "inner_phone": 2424,
    "number":"+998994412860",
    "user_id":  22
}
Example Request (curl)


curl --location 'https://cld.alovoice.uz/outcall/YOUR TOKEN' \
--data '{
    "call_id": "e5e456se456s56w456",
    "inner_phone": 2424,
    "number":"+998994412860",
    "user_id":  22
}
'


Example Response

No response body
This request doesn't return any response body

POST Метод: Установка хендлера для событий


https://cld.alovoice.uz/sethandler/YOUR_TOKEN

Headers

token                    YOURTOKEN


Body raw (json)
{
    "url": "Place here your address of the handler in your CRM portal",
    "event":  "startcall" // or "endcall"
}
Example Request (curl)
curl --location 'https://cld.alovoice.uz/sethandler/YOUR_TOKEN' \
--header 'token: YOURTOKEN' \
--data '{
    "url": "Place here your address of the handler in your CRM portal",
    "event":  "startcall" // or "endcall"
}
'


Example Response

No response body
This request doesn't return any response body