Erfassen Sie Ihre Fortschritte
Trailhead-Startseite
Trailhead-Startseite

Check the Package and Enable Cross-Domain Access

Launch Your New Trailhead Playground and Install the CTI Adapter

Time to open your new Trailhead Playground and install the CTI Adapter. Scroll to the bottom of this page, select your new Trailhead Playground and click Launch. If you see a tab in your org labeled Install a Package, great! Follow the steps below.

If not, click App Launcher to launch the App Launcher, then find and open Trailhead Starter and follow the steps. If you don't see the Trailhead Starter app, copy this AppExchange link and check out Install a Package a App to Complete a Trailhead Challenge on Trailhead Help.

  1. Click the Install a Package tab.
  2. Paste 04t4p0000027jl8AAA into the field.
  3. Click Install.
  4. Select Install for Admins Only, then click Install.

When the app is finished installing, you see a confirmation page and get an email to the address associated with your playground.

In a typical business scenario, you install for specific profiles to control who can use the CTI Adapter. You may also install in a Sandbox first, to ensure the adapter is configured and tested appropriately.

Great work! You installed the Amazon Connect CTI Adapter in your Trailhead Playground. But you're not quite ready to test SSO and place calls. Let's keep going!

Find Your Playground Domain

Record your 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 Page

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 your playground, go to 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

Your call center needs to reference the Visualforce page. Set that up.

  1. Go back to Setup and enter call in Quick Find, 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.

Stay on your call center page. You need to set up permissions next.

Manage Call Center Users and Access

Add yourself as a call center user so you have the appropriate permissions to access the call center.

  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.
    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 CCP in Service Console, you need to activate it 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 give Service Console a phone!

  1. Click App Launcher to launch the App Launcher, then find and open 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 SSO!
  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.
  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 attribute 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.
  2. On the left-hand pane, click Application integration. Amazon Connect Instance screen with Application integration link highlighted with a red box and arrow.
  3. In the main pane, click Add origin. Application integration 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.

That was a lot—you set up your new call center, ensured it can be accessed via Service Console, and that AWS recognizes it. It's time to set up SSO!