Custom Phone Integrations

On This Page

Available in Version 5.0 and up

A custom phone integration is only possible if your phone provider has an API that allows you to see who is on the phone in real time.

While Kubaru doesn’t have any native phone system integrations, we do provide you with needed inputs so that you can custom-build your own. This allows you to pause agents from receiving assignments while on the phone. You can additionally set a call wrap-up period so that they continue to be paused for a specified number of minutes after ending a call. Additionally, you can choose which routers will pause members while they are on a call.

Follow these steps to enable a custom phone integration:

  1. Navigate to the Settings tab of the Kubaru Console.
  2. Check Show Custom Phone Integration Options.
  3. Now navigate to each router for which you would like to enable the pause behavior and click Edit.
  4. Check Pause When On Phone and set a wrap-up period to prevent users from receiving assignments for a brief period after a phone call is ended. By leaving the latter part blank, agents will become available immediately after ending a phone call.

While this sets the stage for your custom integration, you still need to build the integration for these settings to ultimately take effect. See below for details.

Custom-Developing the Integration

The bulk of building the integration comes down to getting the call data into Salesforce. We cannot provide any specifics on this part, as how this is done will vary from provider to provider. And while this is only possible if your provider has an API that allows you to see who is on the phone in real time, many providers offer this ability. For example, here is Aircall’s API documentation.

Once you’ve identified your API method and have established a protocol to call out to the phone application, you will need to use that protocol along with a recurring Apex method, such as schedulable or batch apex. It is suggested that your method be run as often as possible so Salesforce can mirror the data as close to in real time as possible.

Once you have a method to continue to query this data, you will need to land it in the nwcs_ldl__OnPhone__c (checkbox) field on the Kubaru package’s nwcs_ldl__User__c object, which reflects whether the user is on the phone (true) or not (false). While this is a custom object, it makes reference to the standard user in its nwcs_ldl__User__c field (user lookup). Also note that the Name field of each record has the same value as the Name field of the standard user record.

Here is some example Apex code that demonstrates what to do with the data you receive from the phone system’s API. In this example, let’s suppose we’ve obtained a set of email addresses of users who are on the phone. Please note that we cannot guarantee this exact code will work in your Salesforce environment.

Apex
// call out to phone system API, get emails of users who are on the phone and add their email addresses to Set<String> usersOnPhoneEmails

List<nwcs_ldl__User__c> users = [SELECT Id, nwcs_ldl__OnPhone__c, nwcs_ldl__User__r.Email FROM nwcs_ldl__User__c WHERE nwcs_ldl__OnPhone__c = true OR nwcs_ldl__User__r.Email IN :usersOnPhoneEmails];

List<nwcs_ldl__User__c> updatedUsers = new List<nwcs_ldl__User__c>();

for (nwcs_ldl__User__c u : users)
{
    if (usersOnPhoneEmails.contains(u.nwcs_ldl__User__r.Email))
    {
        if (!u.nwcs_ldl__OnPhone__c)
        {
            u.nwcs_ldl__OnPhone__c = true;
            updatedUsers.add(u);
        }
    }
    else if (u.nwcs_ldl__OnPhone__c)
    {
        u.nwcs_ldl__OnPhone__c = false;
        updatedUsers.add(u);
    }
}

if (!updatedUsers.isEmpty())
    update updatedUsers;
Was this article helpful?

On This Page