Integration with Asterisk

Last update: 02.05.2024

You can add integration with Asterisk along with the path administrator account — section "Settings" — subsection "Integration" — button "Add integration" — Telephony — Asterisk.

f7ac0b234621796fcc8cab3b2bcfa058.png

Integration with Asterisk works through the ARI interface, so before connecting the integration, you need to set up some settings in Asterisk itself. To do this, you might need to involve your Asterisk specialist, who is responsible for its operation and is familiar with the settings.

Important points

a) By default, connection is made via https. If you do not have it configured, you will get an authorization error when connecting. To bypass this, in the IP-address field specify the address with http, for example: http://188.188.188.188.

b) After filling in all the fields in the integration connection form, a request for the list of internal operator numbers in Asterisk is executed: https://docs.asterisk.org/Asterisk_16_Documentation/API_Documentation/Asterisk_REST_Interface/Endpoints_REST_API/ If the list of operators does not appear after filling in all the fields, make sure that you have access from outside.


The essence of the integration is to set up events transfer based on calls from Asterisk to Deskie. These events will be displayed in the agent account, and cases based on corresponding calls will be created.

Setting up Asterisk settings

1. To interact with Deskie, you need to create a separate user in ARI: https://docs.asterisk.org/Configuration/Interfaces/Asterisk-REST-Interface-ARI/Getting-Started-with-ARI/

The login and password of the created user must be specified in the integration connection form in Deskie (the third step in the screenshot at the beginning of the article).

2. In your Dialplan settings, add a macro that contains the following parameters and the Deskie Webhook URL.

exten => s,1,Set(DATE_NOW=${STRFTIME(${EPOCH},,%d.%m.%Y-%H:%M:%S)}) same => n,set(OMNI_RESULT=${CURL([deskie_webhook_url],datetime=${DATE_NOW}&from_user=${ARG1}&to_user=${ARG2}&unique_id=${ARG3}&status=${ARG4})})

Don't forget to replace [deskie_webhook_url] with the URL from the second step of the integration connection form (see the second paragraph in the screenshot at the beginning of the article).

3. In Dialplan, at the endpoints where the events listed below occur, you need to call a macro through the Macro function or through the parameters for the Queue and Dial functions.

Call events, that have to be transferred to Deskie

The event name must be passed in the macro in the status parameter.

1. Incoming call without an answer:

a) "start of an incoming call" — a call start to Asterisk without transferring the call to a specific operator/queue number;

b) "incoming call to personal number" or "call to queue QUEUENAME" — a call to a specific operator number or to a specific queue. If the call goes to a specific operator, the internal number of the operator is expected in the "to_user" parameter; if the call goes to the queue, then the numbers of all operators contained in the queue are expected in "to_user";

c) "incoming call is ended" — the call is ended.

2. Incoming call with an answer:

a) "start of an incoming call" — a call start to Asterisk without transferring the call to a specific operator/queue number;

b) "incoming call to personal number" or "call to queue QUEUENAME" — a call to a specific operator number or to a specific queue. If the call goes to a specific operator, the internal number of the operator is expected in the "to_user" parameter; if the call goes to the queue, then the numbers of all operators contained in the queue are expected in "to_user";

c) "incoming call answered" — the operator answered the call. If the call went to the queue, the "to_user" parameter expects the extension number of the operator who answered the call;

d) "incoming call is ended" - the call is completed. This event also expects a "call_duration" parameter, in which the duration of the call should be passed.

3. Outgoing call without an answer:

a) "outgoing call start" — the beginning of an outgoing call;

b) "outgoing call ended" — outgoing call ended.

4. Outgoing call with answer:

a) "outgoing call start" — the beginning of an outgoing call;

b) "answering an outgoing call" — the subscriber answered the call;

c) "outgoing call ended" — outgoing call ended. This event also expects a "call_duration" parameter, in which the duration of the call should be passed.

5. Call recording:

a) "call record" — a curl request should be executed here, which will transfer the conversation recording file.

Request example:

curl -vvvvvvvv --location --request POST 'https://company.omnidesk.ru/webhooks/asterisk/cc75532f' -F status=record -F unique_id=1640854015.26 -F record=@/var/spool/asterisk/monitor/2021/12/30/q-50-+375291701899-20211230-114656-1640854015.26.mp3

Integration options

To learn more about the main points of how the integration works, take a look at the following scenarios:

Incoming call from a known user

1. Incoming call notification is displayed in the upper right corner. If there is already a user in Deskie with the same phone number, the notification will display their data:

c8ffd6ef4e564b3172e9266ea8bb7bc7.png

You can choose which user data to display in the notification. To do this, activate the "Incoming call" form for the required fields (administrator account — section "Data fields" — editing the field):

804a2d60c11cd3aa2b48ebe82093761e.png

By default, we display the fields "Full name", "Email address" and "Company".

2. When an agent receives a call via softphone, we automatically open the user profile:

e34760cb8a30a3f14ff35ee0098ad286.png

Next, there are two options:

a) create a call based case (via the link above the main area);

b) fixate the call within one of the previous cases of the "Telephony" channel, if the user calls again with another issue.

Let's take a closer look at each of the options.

a) With this option, an agent opens the page for creating a call based case with the "User" field already filled in. From this page, an agent can:

  • capture the subject and essence of the call by filling in the appropriate fields and clicking on the "Create" button. This information will help in the future to quickly understand what the conversation was about, without having to listen to the record;

  • add or change the user's data by clicking on the link "edit";

  • return to the user profile (via the link "go to user profile" in the header of the main area) in order to still select one of the previous cases to link with the current call.

d4423c7470aea905d4021bb2f4672e26.png

After the agent fills in the fields "Subject", "Essence of the call" and clicks on the "Create" button, the page of the created case will open:

c789a74ac38d08fdd24f204645e55daf.png

While the agent continues to communicate with the user, the message displays "Call in Progress" and there is no record of the conversation. After the conversation is over, the page is refreshed and a record of the conversation is attached to the message.

Important point: if an agent, while on the page for creating a call based case, does not fill out anything and closes the page or goes to another section, at the end of the conversation we will still create a new case. It will be created with the standard subject “Incoming call from [phone number]” and the status "open", whereas the first response will be an empty message with a player to listen to the record of the conversation.

7587d1b9b1419672f8f95322be26b33e.png

b) If an agent selects one of the user's previous cases to link it to the current call, then after going to the page of the case, the agent can:

  • fixate the call within the current case by clicking on the appropriate link;

  • go back to the user profile to select another case or create a new one.

344461170a5651abd5f4ae5d3ddbb03d.png

When you click on the "Fixate the call within the current case" link, a special field appears to indicate the nature of the call. After saving changes to the case, a new message appears with a call record.

Incoming call from an unknown user

3. Incoming call notification is displayed in the upper right corner. If there is no user with the same phone number in Deskie yet, it will be stated in the notification:

c91788fd2071e46d28868eaa0cb52955.png

4. When an agent receives a call via a softphone, two options appear in the notification: "Find a user from the database for the profile linking" and "Create a call based case".

0f425162580c29f5cab759bb10e230be.png

Let's take a closer look at each of them.

a) The link "Find a user for profile linking" redirects the agent to the search page and automatically sets the "users" filter so that only users are in the search results.

An agent can find the right user by any data: name, email address, company name, text in a note, values ​​in custom fields, etc.

After the agent has found the desired profile and associated the calling user with it, the phone number that this user calls from is automatically added to their data.

b1522aa475dcb8d05903f0cf7430d76e.gif

Further actions of the agent are identical to those described in the first example when the user was known at the time of the call.

b) If, after answering the call, the agent selects "Create a call based case", they will be redirected to the page for case creation. In this scenario, we automatically create a new user by phone number. There is an opportunity to add or change information about the user by clicking on the "edit" link in the information block.

bbe6d6007a8767502fdd05465952b362.png

In a situation where the call ends before the agent creates a case, we create it automatically, picking up the subject and essence of the call if the agent filled them out.

Outgoing call to a user via softphone

In this case, we will also pull the information about the outgoing call to Deskie, and the agent will be able to perform the necessary actions by analogy with incoming calls:

  • create a new user if such a number is not yet in the Deskie database;

  • create a new call based case;

  • link the call to an existing case.

77635d85ef0345b4b0c77fd149273ea8.gif

5. If, when making a call via softphone, an agent does not open Deskie and does not create a case (or fixate the call within one of the previous cases), when the call ends, Deskie automatically creates a case with the status “closed” and the assignee.

Capturing missed calls from the user

6. If the user's call goes unanswered, we create a case with a standard subject "Missed call from [phone number]" and a red handset icon to make it easier for agents to identify missed calls in the all cases list:

6f608dd13c3282a9f33858eccf25c459.png

You can also activate the "Phone" column in the list of cases so that you can immediately see the user's phone number.

7. Missed calls from one user are grouped to exclude the situation where a persistent user will create dozens of calls and clog the list with them:

d4842022bebf235af2ca3326a248724a.png

However, the grouping of missed calls within one case occurs only if between these calls there was no completed call between the user and the agent. If there was a conversation, we will create a separate case for the next missed call.

8. When an outgoing call from an agent appears in the missed call case (the customer needs to answer and there should be a record of the conversation), then the color of the handset changes to the standard green one.

Statuses logic

9. If the agent has accepted the user's call, at the end of the conversation, the status of the case will be set to "pending".

10. Cases created based on missed calls are set to "open" status.

11. If the agent calls the user back, but the user does not pick up the phone, the status "open" will remain.

12. When the list contains a call based case from a user, the following options are available to change the status of such a case:

a) The user calls again, the agent receives the call and creates a new call based case

We automatically change the status of a missed call case to "closed", meaning that the user and the agent resolve all issues within the framework of the new case created by the agent.

b) The user calls again, the agent receives the call and adds it to the missed call case

When the agent completes such a call, the status of the case will be set to “pending”, since the agent has discussed everything that is needed with the user (see paragraph 14).

c) The agent dials the user directly through the softphone, the user receives the call, and the agent creates a new call based case

In this case, we also automatically change the status of the missed call case to "closed", meaning that the user and the agent resolve all issues within the framework of the new case created by the agent.

d) The agent dials the user directly via the softphone, the user receives the call, and the agent adds the call to the missed call case

At the end of the call, the case will receive the status "pending".

13. If, when making a call via a softphone, an agent does not open Deskie and does not create a case (or attaches the call to one of the previous cases), after the call ends, Deskie automatically creates a case with the status "closed" and the assignee.

How it is reflected in Reports

14. "Overall workload" subsection

New cases in total: the number of new cases on incoming and outgoing calls created in the selected period.

New user cases: the number of new cases on incoming calls created in the selected period.

Reopened cases: the number of cases of incoming and outgoing calls created earlier but reopened in the selected period.

Cases being handled: the number of cases of incoming and outgoing calls, in which agents performed some actions (added responses or notes, changed parameters) in the selected period.

Cases with a response: the number of cases of incoming and outgoing calls, in which there is a record of a conversation between a user and an agent in the selected period.

Closed cases: the number of cases of incoming and outgoing calls closed in the selected period, in which there is a record of conversation between the user and the agent.

15. "Peak load" subsection

New and reopened cases: the sum of new cases created in the selected period and reopened cases on incoming and outgoing calls in the selected period.

Cases being handled: the number of cases on incoming and outgoing calls, in which agents performed some actions (added answers or notes, changed parameters) in the selected period.

16. "Case channels" subsection

New and reopened cases: the sum of new cases created in the selected period and reopened cases on incoming and outgoing calls in the selected period.

Cases being handled: the number of cases on incoming and outgoing calls, in which agents performed some actions (added answers or notes, changed parameters) in the selected period.

Closed cases: the number of cases of incoming and outgoing calls closed in the selected period, in which there is a record of conversation between the user and the agent.

17. "Time metrics" subsection

First response time: cases through the "Calls" channel are not counted in this indicator.

Response time: cases through the "Calls" channel are not counted in this indicator.

Response writing time: cases through the Calls channel are not counted in this indicator.

Number of responses for resolution: when calculating this indicator, messages in cases of incoming and outgoing calls that contain a record of a conversation between a user and an agent during the selected period are taken into account.

Resolution time: the calculation of this indicator takes into account cases of incoming and outgoing calls closed in the selected period, in which the times of creation and closing are different. If the creation and closing times are completely the same, cases are not taken into account, so that the speed does not turn out to be zero.

18. "SLA compliance" subsection

First Response SLA violated: cases through the Calls channel are not counted in this indicator.

Response SLA violated: cases from the "Calls" channel are not counted in this indicator.

Resolution SLA violated: cases of incoming and outgoing calls closed in the selected period, in which creation and closing times are different, are taken into account when calculating this indicator. If the creation and closing times are completely the same, cases are not taken into account, so that the rate does not turn out to be zero.

19. "Leaderboard" subsection

New cases in total: the number of new cases on incoming and outgoing calls created in the selected period.

New user cases: the number of new cases on incoming calls created in the selected period.

Reopened cases: the number of cases of incoming and outgoing calls created earlier but reopened in the selected period.

Cases being handled: the number of cases of incoming and outgoing calls, in which agents performed some actions (added responses or notes, changed parameters) in the selected period.

Cases with a response: the number of cases of incoming and outgoing calls, in which there is a record of a conversation between a user and an agent in the selected period.

First response time: cases through the "Calls" channel are not counted in this indicator.

First Response SLA violated: cases through the Calls channel are not counted in this indicator.

Response time: cases through the "Calls" channel are not counted in this indicator.

Response SLA violated: cases from the "Calls" channel are not counted in this indicator.

Response writing time: cases through the Calls channel are not counted in this indicator.

Total number of responses: the number of messages in cases of incoming and outgoing calls that have a record of a conversation between a user and an agent during the selected period.

Number of responses for resolution: when calculating this indicator, messages in cases of incoming and outgoing calls that contain a record of a conversation between a user and an agent during the selected period are taken into account.

Closed cases: the number of cases of incoming and outgoing calls closed in the selected period, in which there is a record of conversation between the user and the agent.

Resolution time: the calculation of this indicator takes into account cases of incoming and outgoing calls closed in the selected period, in which the times of creation and closing are different. If the creation and closing times are completely the same, cases are not taken into account, so that the speed does not turn out to be zero.

Resolution SLA violated: cases of incoming and outgoing calls closed in the selected period, in which creation and closing times are different, are taken into account when calculating this indicator. If the creation and closing times are completely the same, cases are not taken into account, so that the rate does not turn out to be zero.

Was this article helpful?