How do I setup an external transfer (to a phone number outside of SmartAssist/Kore.ai) from an automation?

Let us see how we can achieve the below use case in SmartAssist.

Use Case:

I have a automation that prompts the user for some info, I’d like to have the option for the user to be transferred to an external number if they don’t have that information or based on a certain trigger.

We can achieve this use-case on the condition that the user is in a voice flow.

Solution:

Let us say we have a voice experience flow like below, with IVR menu in which we have set up a condition that if the user pressed number 2, then it has go to an external number.

We use an automation node to connect to a specific dialog, where we have configured the transfer condition.

image

(If you are using an automation already to present data with some information, the same bot can be used to have the required dialog. )

In the bot dialog, we should have a message node prompt specific for Audiocodes or IVR channel with the following code:


var phoneNumber = env.PHONE_NUMBER; // Change phone number in environment variable//

var transferTarget = "tel:" + phoneNumber;
var message = {
    "activities": [{
            "type": "message",
            "text": "Kindly hold the line",
            "timestamp": new Date().toISOString(),
            "id": new Date().getTime()
        }, {
            "type": "event",
            "name": "transfer",
            "activityParams": {
                "handoverReason": "userRequest",
                "transferTarget": transferTarget
            },
            "timestamp": new Date().toISOString(),
            "id": new Date().getTime() + 200
        }
    ]
};

print(JSON.stringify(message));

Ensure that the bot environment variable - PHONE_NUMBER is set to the external number.

1 Like