This article guides you through configuring a custom OpenCTI Dekstop adapter for Pega Call built with Constellation '24.2. Performing these steps implements a custom OpenCTI Desktop link in your application.
- Create a custom OpenCTI Desktop adapter:
-
In the navigation pane of the Visual Studio Code application, select Terminal > New Terminal.
-
On the Terminal tab, enter
npm i @pega/custom-dx-components
. -
Enter
npx @pega/custom-dx-components init
. -
For the Project name, enter CustomCTI.
-
For the Organization name, enter your organization name.
-
Enter the following command:
cd <folder name of the project>
. -
Enter
npm run create
. -
For the Type of component, enter
Field
. -
For the subtype of component, enter
Text
. -
For the component name, enter the name of the CTI link.
-
For the component label for display, enter the display label name of the CTI link.
-
For the component version, enter the version of the CTI link.
-
For the library name, enter
Pega
. -
For the description, enter the description of the CTI link.
-
Create a new typescript file.
-
In the <CTI link name>.ts file, create a class structure with business logic.
You can base your business logic based on the OpenCTICustomDX.txt file that you can find in the following article: OpenCTICustomDX text file.
The existing function declaration should not be modified to prevent UI and custom adapter connection issues. -
Create a new typescript file for adding the types.
-
In the <CTI link name>.types.ts file, specify the business logic of the custom CTI link.
Base your business logic based on the OpenCTICustomCX.txt file. You can access the file in the following topic: OpenCTICustomDX text file.
The existing function declaration should not be modified to prevent UI and custom adapter connection issues. -
Rename the index.tsx file to index.ts.
-
Remove all content from index.ts file and enter the following code:
export { default } from ‘./<folder name of the project’;
-
Modify the config.json file as per your business requirements.
-
Resolve all lint and prettier issues.
The following figure shows an example of the final structure for a Nice custom CTI link:CustomCTI folder
-
-
Build the component to validate errors:
-
In the Visual Studio Code application, on the Terminal tab, enter npm run buildComponent.
-
Select the component for building.
-
For Select component to build, select <folder name of the project>.
-
For Generate development build, select Yes.
-
If the build is successful, the system generates the bundle as in the following example:
Successfull build
-
-
Authenticate the OpenCTI Dekstop component to publish the custom CTI link that you created in your application:
-
In the Visual Studio Code application, on the Terminal tab, enter npm run authenticate.
-
For the Pega server URL, enter your application's Pega server URL.
-
For the authentication service alias, enter
pega
. -
On the Pega authentication window, log in with your credentials.
If the authentication is successful, the system generates the following message on the Pega authentication window:Authentication message
-
-
Publish the OpenCTI Desktop component to Pega Infinity server:
-
In the Visual Studio Code application, on the Terminal tab, enter
npm run publish
. -
For the component to publish, select the <CTI link folder name> folder.
-
For the ruleset name, select an open ruleset of your application to which you want to publish the new CTI link.
-
For the ruleset version, select the ruleset version of your application to which you want to publish the new CTI link.
-
For generate development build, select Yes.
-