Ссылка скопирована
Search

Enabling UIS telephony via API

Content:


Setting up in a new personal account UIS

Enabling the tariff

Important! To use API telephony in MedLock, you must enable any tariff from the category«Виртуальная АТС». For more information, see the UIS page.
You will also need an additional option to connect telephony in your personal UIS account«Инструменты интеграции». It is necessary for the integration to work correctly.

Important! In order for call transcription to work in Medlock, connect the Speech Analytics module in the UIS
  1. Open the section with pricing plans and options.
Подключить инструменты интеграции

2. Activate the option«Инструменты интеграции».

Активировать инструменты интеграций

Configuring the user and their rights

  1. Open «Настройки»the → section«Сотрудники и отделы».
Настройки - Сотрудники и разделы в UIS

2. Click «Добавить сотрудника», fill out the form and click «Добавить». An extended employee card will open.

Создание нового сотрудника в UIS

3. Give the employee the rights. In the extended card«Роль», select the preset role in the field«Администратор». The UIS recommends assigning this role to the employee whose key is used for integration.

4. If you have created your own role and selected it instead of the role«Администратор», configure the access rights:

  • Open «Администратор»the → «Безопасность»→ section«Права доступа».
  • Find the column with the desired role.
  • Select all the items in the section «HTTP-уведомления»and group«Виртуальная АТС», including the nested items.

5. Grant the employee access to the API. Expand the section «Дополнительные настройки»and select the API types: Data API and Call API.

Дополнительные настройки сотрудника в UIS

Активировать ключ API в UIS

6. Select the option «Использовать ключ API»— the system will generate a unique key. The switch «Ключ API активен»should be green.

Создать ключ API в UIS

7. In the field«Время жизни», select «Всегда»the key to be valid indefinitely. If you select «До»and specify a date, the key will stop working after it. Telephony in the MedLock will be disabled until you generate a new key.

8. Click «Копировать»next to the key and save it. You will need it when connecting the module in the MedLock. Then save the employee's settings.

Копировать ключ API в UIS
Important! The key is displayed only once and is hidden after saving the settings or reloading the page. Save the key and remember which employee it was created for.
Important! If you are using the module«Сквозная аналитика», you can get the key from its settings.

Setting up Security

The security settings are available to the user with the role«Администратор».

  1. Open «Администратор»the → «Безопасность»→ section«Настройки безопасности».
Открыть настройки безопасности в UIS

2. Go to the tab «API»and click «+ Добавить».

Перейти во вкладку API в UIS

3. «IP/маска»Enter 0.0.0.0/0 in the field«Описание». You do not need to fill in the field.

4. Save the address by clicking on the floppy disk icon next to the fields.

Добавить IP адрес МедЛока в белый список
Important! The changes will take effect within one hour.
Important! If the IP address of the MedLock is not added to the list of allowed UIS in the personal account«Телефония», an error will be displayed when connecting the module.
Ошибка на первом шаге если не указан IP
Important! You need to create and configure SIP lines in your personal UIS account. For more information, see the SIP numbers article.

Connecting the module «Телефония»in the MedLock

Connect and configure the module «Телефония»in the MedLock.

For more information, see the Module Connection article«Телефония».

Configuring HTTP notifications in the UIS

After connecting the module in the MedLock, you need to set up notifications in the personal account of the UIS so that calls are displayed in the system.

  1. Go to the personal account of the UIS.

2. Open «Интеграции»the → section«HTTP-уведомления».

Открыть уведомления в UIS

3. Click «+ Добавить HTTP-уведомление».

Создать уведомление в UIS

Filling out the HTTP Notification form

Create six types of notifications. Their names, terms, and texts are listed in the section «Создание HTTP-уведомлений»below.

The notification creation form consists of the following blocks:

  • HTTP notification name" - enter the name from the instructions.
  • Event Type" — select an event from the drop-down list. The events are grouped by services: «Звонки», «ОМНИ», «Аналитика рекламы».
  • «Условия» — fill it out only if the conditions are specified in the instructions.
  • «Настройка HTTP» — select the POST method, specify the URL copied when connecting the module in the MedLock, and paste the notification text.
Создание HTTP уведомления

After filling out the form, click «Сохранить».

Setting up in the old personal account UIS

Enabling the tariff

Important! To use API telephony in MedLock, you must enable any tariff from the category«Виртуальная АТС».

You will also need an additional option to connect telephony in your personal UIS account«Базовые отраслевые решения». It is necessary for the integration to work correctly.

  1. Click on the username in the upper-right corner and select «Аккаунт».
Открыть аккаунт в старом ЛК UIS

2. On the page that opens, click «Тарифы и опции»and activate the option«Базовые отраслевые решения».

Подключить дополнительный тариф

Configuring the user and their rights

  1. Click on the username in the upper-right corner and select «Управление пользователями».
Создайте пользователя

2. Click «Добавить пользователя».

Добавить пользователя в старом ЛК UIS

3. Grant the user access rights to the Data API and Call API.

Использовать Data Api

3. Enable the API key.

4. Generate and save the API key. You will need it when connecting the module in the MedLock.

Создайте ключ API

Setting up Security

The security settings are available to the user with the role«Администратор».

  1. Click on the username in the upper-right corner and select «Аккаунт».
Открыть аккаунт в старом ЛК UIS

2. Open the page «Правила и настройки безопасности»and go to the tab«API».

Открыть правила и настройки безопасности

3. Click «+ Добавить»and add IP address 0.0.0.0/0 to the allowed list.

Добавить IP МедЛока в белый список в старом личном кабинете UIS

4. Save the changes by clicking on the floppy disk icon on the right.

Important! The changes will take effect within one hour.
Important! If the IP address of the MedLock is not added to the list of allowed UIS in the personal account«Телефония», an error will be displayed when connecting the module.
Ошибка на первом шаге если не указан IP

Connecting the module «Телефония»in the MedLock

Connect and configure the module «Телефония»in the MedLock.

For more information, see the How to Connect the Module article«Телефония».

Configuring HTTP notifications in the UIS

After connecting the module in the MedLock, you need to set up notifications in the personal account of the UIS so that calls are displayed in the system.

  1. Go to the personal account of the UIS.
  2. Open the section«Уведомления».
  3. Select a subsection «HTTP-уведомления».
  4. Click«+ Добавить HTTP-уведомление».
Добавить новое уведомление в старом лк UIS
Important! You need to create and configure SIP lines in your personal UIS account. For more information, see the SIP numbers article.

Filling out the HTTP Notification form

Create six types of notifications. Their names, terms, and texts are listed in the section «Создание HTTP-уведомлений»below.

After filling out the form, click «Сохранить».

Создание уведомления в старом интерфейсе

Creating HTTP Notifications

Notification No. 1. The beginning of a conversation

  • The name is «Начало разговора».
  • The event type is «Начало разговора».
  • Setting up an HTTP POST.
  • URL — paste the URL that you copied when connecting the module in the MedLock.

Notification text:

{
"notification_name": "call_answered",
"notification_timestamp": {{notification_timestamp}},
"call_session_id":{{call_session_id}},
"employee_phone_number": {{employee_phone_number}},
"direction": {{direction}},
"virtual_phone_number": {{virtual_phone_number}} ,
"contact_phone_number": {{contact_phone_number}},
"external_id": {{external_id}}
}

Notification No. 2. Call Termination

  • The name is «Завершение звонка».
  • The event type is «Завершение звонка».
  • Setting up an HTTP POST.
  • URL — paste the URL that you copied when connecting the module in the MedLock.

Notification text:

{
"notification_name": "call_finished",
"lost_reason": {{lost_reason}},
"finish_reason": {{finish_reason}},
"is_lost": {{is_lost}},
"call_status": {{call_status}},
"call_session_id": {{call_session_id}},
"notification_timestamp": {{notification_timestamp}},
"employee_phone_number": {{employee_phone_number}},
"direction": {{direction}},
"virtual_phone_number": {{virtual_phone_number}},
"contact_phone_number": {{contact_phone_number}},
"external_id": {{external_id}}
}

Notification No. 3. End of conversation

  • The name is «Окончание разговора».
  • The event type is «Окончание разговора».
  • Setting up an HTTP POST.
  • URL — paste the URL that you copied when connecting the module in the MedLock.

Notification text:

{
"notification_name": "conversation_ended",
"call_session_id": {{call_session_id}},
"notification_timestamp": {{notification_timestamp}},
"employee_phone_number": {{employee_phone_number}},
"direction": {{direction}},
"virtual_phone_number": {{virtual_phone_number}},
"contact_phone_number": {{contact_phone_number}},
"external_id": {{external_id}}
}

Notification No. 4. Termination of leverage

  • The name is «Завершение плеча».
  • The event type is «Завершение плеча».
  • Setting up an HTTP POST.
  • URL — paste the URL that you copied when connecting the module in the MedLock.

Conditions:

  1. Turn on the conditions.
  2. In the field«Параметр», select «Направление плеча».
  3. Specify the condition «Точно соответствует».
  4. Choose«Исходящее».
Настройка условий

Notification text:

{
"notification_name": "leg_ended",
"call_session_id": {{call_session_id}},
"notification_timestamp":{{notification_timestamp}},
"external_id": {{external_id}},
"employee_phone_number": {{employee_phone_number}},
"leg_id": {{leg_id}},
"direction": {{direction}},
"virtual_phone_number": {{virtual_phone_number}},
"contact_phone_number": {{contact_phone_number}}
}

Notification No. 5. Outgoing shoulder

  • The name is «Исходящее плечо».
  • The event type is «Исходящее плечо».
  • Setting up an HTTP POST.
  • URL — paste the URL that you copied when connecting the module in the MedLock.

Notification text:

{
"notification_name": "outbound_leg",
"call_session_id": {{call_session_id}},
"notification_timestamp":{{notification_timestamp}},
"external_id": {{external_id}},
"employee_phone_number": {{employee_phone_number}},
"leg_id": {{leg_id}},
"direction": {{direction}},
"virtual_phone_number": {{virtual_phone_number}},
"contact_phone_number": {{contact_phone_number}}
}


Notification No. 6. Incoming Leverage

  • The name is «Входящее плечо».
  • The event type is «Входящее плечо».
  • Setting up an HTTP POST.
  • URL — paste the URL that you copied when connecting the module in the MedLock.

Notification text:

{
"notification_name": "inbound_leg",
"call_session_id": {{call_session_id}},
"notification_timestamp":{{notification_timestamp}},
"external_id": {{external_id}},
"employee_phone_number": {{employee_phone_number}},
"leg_id": {{leg_id}},
"direction": {{direction}},
"virtual_phone_number": {{virtual_phone_number}},
"contact_phone_number": {{contact_phone_number}}
}


Setting up softphones

If the telephony is being connected for the first time

In the softphone settings, specify the username, password, and URL of the UIS operator.

If the telephony was previously connected via Asterisk

In the softphone settings, replace the username, password, and URL with the data specified in the personal account of the UIS.

For more information about setting up a softphone, see the article How to set up a SIP phone/softphone for the module«Телефония».

Checking the settings

Important! The notification URL cannot be viewed again after copying. If you haven't saved it, generate a new URL in the module settings «Телефония»in the MedLock and update it in all six HTTP notifications in the UIS. For more information, see the article How to connect the Telephony module.
reload_url

Itog

After setting up notifications, we recommend making a test call.

A call card should be displayed in the MedLock with the option to accept or reject the call.

The completed actions with the call will be displayed in the call history in the MedLock.