Erfassen Sie Ihre Fortschritte
Trailhead-Startseite
Trailhead-Startseite

Configure a Salesforce Call Center

Configuring the Amazon Connect CTI Adapter

In this step, you switch between AWS and your Trailhead Playground, so keep both environments open and active in different tabs in your browser.

It's time to connect your call center to your Amazon Connect instance!

Find Your Playground Domain

You start in your Trailhead Playground. First, record your playground domain so you can add it to the AWS access list later.

  1. In your playground, go to Setup.
  2. Copy the URL in your browser. Trailhead Playground Setup page with URL highlighted by a red box and arrow
  3. Save your domain in a place where you can retrieve it later in this step.
    1. When you save your domain, it should start with the https:// and end at .com. So the domain you save should look like this: https://yourdomain-dev-ed.lightning.force.com

Find Your Lightning Adapter Domain

The package you installed in the previous step created a call center in Salesforce. Record the call center domain for the AWS access list.

  1. In Setup, enter visual in the Quick Find box, then click Visualforce Pages. Visualforce Pages in Setup
  2. In the Name column, click the AC_LightningAdapter link.
  3. Click the Preview button. A new browser tab will open with the URL of the Lightning Adapter page. It’s in this format: https://yourdomain-dev-ed--amazonconnect.visualforce.com/apex/AC_LightningAdapter. Copy the preview link URL and save it.

Configure Your Call Center

  1. Now go back to Setup and enter call in the Quick Find box, then click Call Centers.
  2. Click Continue, then click into your new call center, AC Lightning Adapter.
  3. Click Edit.
  4. In the CTI Adapter URL field, replace the current value with the Lightning Adapter URL you gathered above. AC Lightning Adapter Call Center page in Setup with CTI Adapter URL field highlighted with a red box
  5. Click Save.

Manage Call Center Users

Since you’ll be placing a call in this project, you need to add yourself as a call center user.

  1. In the AC Lightning Adapter Call Center setup page, click Manage Call Center Users.
  2. Then, click Add More Users.
  3. Set search criteria to find your own Salesforce user. Try:
    1. First Name | equals | the first name associated with your Trailhead account.
    2. Click Find. Call Center Search for New Users screen with First Name equals First Name highlighted with a red box.
  4. Check the box next to your user name, then click Add to Call Center.

Now, assign Amazon Connect permission sets to call center users.

  1. In Setup, enter permission in the Quick Find box, click Permission Sets.
  2. Click AC_Agent in the Permission Set Label column.
  3. Click Manage Assignments, then click Add Assignments.
  4. Check the box by your name and any other users you wish, then click Assign.
  5. Click Done.

Great, your user is all set up! Now, it's time to activate the phone in Service Console.

Activate Console Phone

To use the Contact Control Panel (CCP), you need to activate the console phone as a utility.

  1. In Setup, enter app manager in the Quick Find box, then click App Manager.
  2. Next to Service Console, click the disclosure triangle, and click Edit. The disclosure triangle clicked for Service Console and the Edit option highlighted by a red oval
  3. In the Edit App screen, click Utility Items in the upper navigation bar.
  4. Then, click Add Utility Item.
  5. From the list of components, click Open CTI Softphone.
  6. Click Save, then click Back.

Add Amazon Connect CTI to Service Console

There are just a few more things to do to integrate your call center!

  1. Click App Launcher to launch the App Launcher, then find and click Service Console. Since the phone utility has already been added, it will try to access Amazon Connect before your setup is complete.
    1. Make sure you allow pop-ups.
    2. If you see an error message in a new window, that's OK. Close it. You're well on your way to integration!
  2. In Service Console, click the disclosure triangle next to the current object, then scroll to the bottom of the dropdown menu and click Edit. The navigation dropdown open in Service Console
  3. Click Add More Items button on the Edit Service Console App Navigation Items screen.
  4. Select AC CTI Adapters and click Add 1 Nav Item. AC CTI Adapters selected in Add Items screen
  5. Click Save.
  6. Back in the console, select the AC CTI Adapters from navigation menu.
  7. If Recently Viewed is selected, click on the drop-down and select All.
  8. Click on ACLightningAdapter. You make a change to this record to reference your Amazon Connect instance. ACLightningAdapter record details
    1. Now, you may not find ACLightningAdapter after all. That's OK. If this is the case, you can set it up manually. If you need to create the record, click the disclosure triangle and then click New. AC CTI Adapters selected in Service Console navigation, All selected in list view, the disclosure triangle clicked, and New highlighted with a red box and arrow
  9. Make sure your record has the following attributes.
    1. CTI Adapter Name: ACLightningAdapter
    2. Amazon Connect Instance Alias: your instance alias
      • If you need to retrieve your Amazon Connect Instance alias, toggle back over to your AWS console and log in with your admin credentials. Enter amazon connect in the Find Services search bar and click Amazon Connect, and find your instance alias in the first column of your instances list.
    3. Call Center Definition Name: ACLightningAdapter
    4. Check the box next to Softphone Popout Enabled and Presence Sync Enabled.
  10. Leave the rest as default and click Save.

Check The Scripts

Before you move on, check that you have all the right scripts. In ACLightningAdapter, scroll to the Scripts section. You should have four script records:

  • Default Voice Contact onConnecting—this script record supports screen pop when a customer dials in to your call center.
  • Default Queue Callback Contact onConnecting—this script record supports screen pop when a queued callback is received.
  • Default Chat Contact onConnecting—this script record supports chat. You don't use this in your project, but it interacts with your CTI adapter and should be added.
  • Default Salesforce UI onClickToDial—this script record supports click-to-dial.

If you have all four script records, go ahead and skip to the next section. If these script records don't exist, add them. 

Default Voice Contact onConnecting

  1. In the Scripts section, click New.
  2. Add the following values.
    1. CTI Script Name: Default Voice Contact onConnecting
    2. Source: Amazon Connect Voice Contact
    3. Event: onConnecting
    4. Active: check the box
    5. Script: add the following
try {
  // Retrieve the 'acsf-screenpop-record’ contact attribute data
  let record = ac.Utils.Contact.getAttributeValue(contact, 'acsf-screenpop-record');
  if (record) {
    // If the attribute data was found, pop it and return
    await ac.Utils.Salesforce.screenPopObject(record);
    return;
  }
  // Retrieve the 'acsf-screenpop-search' contact attribute data
  let search = ac.Utils.Contact.getAttributeValue(contact, 'acsf-screenpop-search');
  if (search) {
    // If the attribute data was found, pop it and return
    await ac.Utils.Salesforce.searchAndScreenPop(search, '', 'inbound');
    return;
  }
  // If screen pop data was not found in contact attribure data, pop on phone number
  // Get the customer phone number from the contact
  let phoneNumber = ac.Utils.Contact.getCustomerPhoneNumber(contact);
  // Format the phone number in local format
  let formattedPhone = ac.Utils.Common.formatPhoneNumber(phoneNumber, 'US');
  // Search for the formatted phone number and pop per softphone layout
  await ac.Utils.Salesforce.searchAndScreenPop(formattedPhone, null, null, 'inbound', false);
}
catch (err) {
  // Log the error if one is thrown
  ac.Utils.Log.error(err);
}

When the script is ready, click Save.

Default Queue Callback Contact onConnecting

  1. Head back to the ACLightningAdapter record.
  2. In the Scripts section, click New.
  3. Add the following values.
    1. CTI Script Name: Default Queue Callback Contact onConnecting
    2. Source: Amazon Connect Queue Callback Contact
    3. Event: onIncoming
    4. Active: check the box
    5. Script: add the following
try {
  let record = ac.Utils.Contact.getAttributeValue(contact, "acsf-screenpop-record");
  if (record) {
    await ac.Utils.Salesforce.screenPopObject(record);
    return;
  }
  let search = ac.Utils.Contact.getAttributeValue(contact, "acsf-screenpop-search");
  if (search) {
    await ac.Utils.Salesforce.searchAndScreenPop(search, null, null, "inbound", false);
    return;
  }
  let phoneNumber = ac.Utils.Contact.getCustomerPhoneNumber(contact);
  let formattedPhone = ac.Utils.Common.formatPhoneNumber(phoneNumber, "US");
  await ac.Utils.Salesforce.searchAndScreenPop(formattedPhone, null, null, "inbound", false);
}
catch (err) {
  ac.Utils.Log.error(err);
}

When the script is ready, click Save.

Default Chat Contact onConnecting

  1. Head back to the ACLightningAdapter record.
  2. In the Scripts section, click New.
  3. Add the following values.
    1. CTI Script Name: Default Chat Contact onConnecting
    2. Source: Amazon Connect Chat Contact
    3. Event: onConnecting
    4. Active: check the box
    5. Script: add the following
try {
  // Retrieve the 'acsf-screenpop-record' contact attribute data
  let record = ac.Utils.Contact.getAttributeValue(contact, 'acsf-screenpop-record');
  if (record) {
    //If the attribute data was found, pop it and return
    await ac.Utils.Salesforce.screenPopObject(record);
    return;
  }
  // Retrieve the 'acsf-screenpop-search' contact attribute data
  let search = ac.Utils.Contact.getAttributeValue(contact, 'acsf-screenpop-search');
  if (search) {
    // If the attribute data was found, pop it and return
    await ac.Utils.Salesforce.searchAndScreenPop(search, '', 'inbound');
    return;
  }
}
catch (err) {
  // Log the error if one is thrown
  ac.Utils.Log.error(err);
}

When the script is ready, click Save.

Default Salesforce UI onClickToDial

  1. Head back to the ACLightningAdapter record.
  2. In the Scripts section, click New.
  3. Add the following values.
    1. CTI Script Name: Default Salesforce UI onClickToDial
    2. Source: Salesforce UI
    3. Event: onClickToDial
    4. Active: check the box
    5. Script: add the following
try {
  // Set the country code
  let countryCode = 'US';
  // Format the contact phone number in E164 format
  let e164Number = ac.Utils.Common.formatPhoneNumberE164(payload.number, countryCode);
  // Dial the E164 formatted phone number
  await ac.Utils.Agent.dialNumber(e164Number);
}
  catch (err) {
  // Log the error if one is thrown
  ac.Utils.Log.error(err);
}

When the script is ready, click Save.

Ensure Cross-Domain Access

Now it's time to switch over to AWS. Ensuring cross-domain access is a security precaution where you put your Salesforce org on the Amazon Connect instance access list. Find more information in Amazon Connect Streams documentation. Switch back over to the AWS Console and log in with the email address you used for your AWS credentials if you haven't already.

  1. Navigate to Amazon Connect and click your Instance Alias. Amazon Connect with an instance alias highlighted by a red box and arrow
  2. On the left-hand pane, click Application integration.
  3. In the main pane, click Add origin. Amazon Connect instance, Application integration section, with Add origin link highlighted by a red box and arrow
  4. Enter your playground domain so that it looks like this https://yourdomain-dev-ed.lightning.force.com
  5. Click Add.

Now, add your call center adapter domain. 

  1. Click Add origin again.
  2. Enter your call center domain, then remove everything after .visual.force.com so that it looks like this https://yourdomain-dev-ed--amazonconnect.visualforce.com
  3. Click Add.

Everything is now connected properly and your Salesforce and Amazon Connect instances can work together. The next step is where the real fun begins: testing the integration!

Resources