- DarkLight
Progressive and Predictive Calls
- DarkLight
Progressive or Predictive Reservations are auto accepted as soon as the reservation reaches the Agent. There are two ways to auto accept:
Using a Plug-in
Using Functions
Campaign Manager recommends using Functions model to auto accept the call.
Auto Accept Using Plug-In
function AutoAcceptForNonPreview(reservation) {
console.log("Auto Accept the Non Preview Task");
flex.Actions.invokeAction("AcceptTask", {
sid: reservation.sid,
});
}
Auto Accept Using Functions
For Non-Tethered, the function is used to auto accept the calls for Progressive and Predictive Dialing. Campaign Manager recommends to deploy the functions as services using the Twilio Flex Serverless CLI.
Perform the following steps:
Install Visual Studio Code or Cygwin Terminal to run the Twilio Flex commands.
Download AcqueonFunctions from the shared folder.
Open Cygwin Terminal in the Administrator Mode.
Point to the directory where the Functions Folder is located. For example, if the functions folder is located at D:\ AcqueonFunctions, then change the directory using the following command:
PS D:\Twilio-Plugins> cd .\AcqueonFunctions\
Go to the AcqueonFunctions folder.
Set the Twilio Account SID and Twilio Auth Token using the following commands:
export TWILIO_ACCOUNT_SID=YourTwilioAccountSID export TWILIO_AUTH_TOKEN=YourTwilioAuthToken
Open the .env file in the Functions folder and change the required values. This is the mandatory step to follow. Use the following command:
ACCOUNT_SID=Your Twilio Account SID AUTH_TOKEN=Your Twilio Auth Token
Install the node modules using the following command:
npm install
Deploy the functions using the following command:
twilio serverless:deploy
If deploying to an existing function, use the following command:
twilio serverless:deploy --override-existing-project
After completing the deployment, the function URL is created.
Go to Twilio Console > Functions and Assets > Services to verify the deployed service.
Click AcqueonFunctions to view more information and function logs.
Copy the Function URL.
Go to TaskRouter > Workspaces > Workflows.
Select the Workflow.
Go to the Assignment Callback section.
Configure the Function URL as given below. The deployment of functions as services is completed successfully.