This is a tutorial series that's cumulative in nature. To start from the beginning, start here.
During an automated voice conversation, there are times in the flow when you might want to transfer the call to one of your supported messaging channels. In this tutorial, you do just this.
Step 27: Get an SMS number from Twilio
To start, you need a Twilio trial phone number that you can use to send SMS messages from Conversational Cloud to the consumer (you).
See our Twilio SMS quick start guide in the Knowledge Center for instructions on this step.
Generally speaking, in this step, you:
- Create a Twilio account.
-
Get a virtual trial toll-free phone number from Twilio for sending and receiving SMS messages.
You might need to verify the number and accept “emergency calling terms and conditions” as a part of this step. Verification by Twilio can take 2-3 weeks, so there’s a considerable waiting period at this point before proceeding.
As the Twilio SMS quick start guide states, take note of the Twilio account SID, auth token, and phone number; you’ll need these later on.
Twilio trial numbers are good for 30 days. Once the number expires, you can request a new one. All calls and SMS messages include a note indicating that the number is a trial number.
-
Configure the request URL for the number. The URL varies by region.
Step 28: Activate SMS in Conversational Cloud
In this step, you activate the SMS channel in Conversational Cloud.
- In Conversational Cloud, on the menu on the left side of the page, click Manage > Channel Setup.
-
Locate the SMS card, and click Get Started.
- Click Next.
-
Enter the Twilio account SID, auth token, and phone number. (You recorded these earlier.)
-
Click Done.
There’s one more important step here…
-
Contact your LivePerson representative and ask them to enable the SMS channel in our backend systems. We need to flip a few extra switches.
There's no need to specify a Target Skill here below in Channel Setup.
If you were to specify a target skill above, the skill would be overridden by the skill key in the JSON payload in the Transfer to Messaging interaction in the bot anyway. You configure the Transfer to Messaging interaction in the bot later on in this tutorial.
Step 29: Create a skill and assign it to yourself
- On the menu on the left side of the page, click Manage > Users & Skills.
- Select your name in the list of users.
-
Scroll down to the bottom and, for Skills, enter “human.” When prompted, select the link to create the skill.
-
Click Save.
This creates the “human” skill and assigns it to your user.
Step 30: Create the Transfer to Messaging credential
- On the menu on the left side of the page, and select Automate > Conversation Builder.
- On the dashboard page that lists all of your bots, select Bot Accounts from the menu in the upper-left corner.
- Select your organization name (number).
- Select Credentials from the menu in the upper-left corner.
- Click Add Credential in the upper-right corner.
-
Specify the following:
- Name: Enter “myC2MCredential.”
- Authentication type: Select “Transfer to Messaging.”
- Click Next.
-
Specify the following:
- Click Save.
Step 31: Configure the C2M system
In this step, you configure the LivePerson Connect To Messaging (C2M) system.
- On the left navigation menu, click Engage > Connect to Messaging.
- If this is your first time accessing the system, click Get Started in the lower-left corner.
-
Click Settings in the upper-right corner. (If you don’t see this option, try refreshing the browser window.)
Next you enable the messaging channel that you intend to use, in this case, SMS.
- Select Channels on the left.
-
Verify the SMS channel is turned on (enabled). If it isn’t, turn it on, and save the change.
Next you turn on the C2M system check that determines whether the consumer’s number is a landline or a mobile number.
-
Select Device Check on the left, and turn on the toggle. Click Save.
Next you enable the skill to which you’ll be transferring the conversation.
-
Select Routing on the left, select the “human” skill, and click Save.
Next you create an API handoff. This is the group of configuration settings to use when the Voicebot calls the API that checks the device’s eligibility to receive messages. You leave the Settings area to do this.
- Select API Handoffs from the menu in the upper-left corner.
-
Click New Handoff.
-
Specify the following:
- Title: Enter “transferToMessaging.”
- LookBack Period: Leave as is.
- Select and Set Channel Priority: Ensure SMS is first in the list and is turned on.
- Click Next.
-
Do the following:
- Send From: Ensure your Twilio phone number is selected.
- Message Preview: Enter the first message to send to the consumer on behalf of the agent. Enter, “Hi there! I’m the agent picking up your conversation with Anna, our pharmacy bot. To continue conversing via message, please reply to this message.”
-
Click Next, and then click Save.
-
Record the handoff ID, as you’ll need this later.
Step 32: Configure the bot
- Return the Pharmacy Bot in Conversation Builder.
- Create a new dialog named “Transfer to Messaging.”
-
In the dialog starter, click + Pattern, and enter the following patterns:
agent
help
-
Click Save.
-
Beneath the dialog starter, add a Transfer to Messaging integration interaction.
- For Credential, select the “myC2MCredential.” And save the interaction.
- Under Post body, click + Add JSON. Use the template that’s available to make things quicker here.
-
In the left panel, copy the JSON for the SMS channel, and paste it into the middle panel.
-
Update the JSON as follows:
- Replace the value for “consumerPhoneNumber” with your own mobile phone number. (Ordinarily, you’d use a variable here, but for this tutorial, you want the SMS messages to be sent to your own mobile phone.)
- Replace the value for “handoffId” with the ID of the API handoff that you created in the C2M system.
- Replace the skill with the name of the skill you created, in this case, “human”.
- Replace the value for “ivrNumber” with the phone number that you assigned to the Voice bot, prepended with “ + “. (The IVR number is the number from which the call was transferred.)
- Delete the rest of the JSON, keeping just the closing brace.
The JSON should look like this:
{ "consumerPhoneNumber": "+18601234567", "handoffId": "H123456789", "skill": "human", "ivrNumber": "+18601234567" }
For example:
ivrNumber
isn't required. OnlyconsumerPhoneNumber
,handoffId
, andskill
are required. But specifying theivrNumber
means that Voice bot's phone number is shown as the number from which the call was transferred. This is nice to show, so specify that too.Now let’s create the dialogs that will handle the success and failure flows.
- Create a new dialog named “Token Failure.”
-
In the Token Failure dialog, delete the dialog starter. Add a Speech statement that says, “Oops! Something went wrong when sending the SMS message. Try again at a later time.” Name the interaction “Ack token failure” (Acknowledge token failure). And set the statement’s next action to redirect the flow to the “Anything else” dialog.
- Create a new dialog named “Eligibility Failure.”
-
In the Eligibility Failure dialog, delete the dialog starter. Add a Speech statement that says, “I’m sorry. The device tied to your phone number isn’t capable of receiving a message.” Name the interaction “Ack eligibility failure.” And set the statement’s next action to redirect the flow to the “Anything else” dialog.
A better dialog flow would be to ask the consumer if they have an alternate number that can be used. The Eligibility Failure dialog could then perform the transfer using the alternate number. But for the purposes of this tutorial, this simple flow works fine.
- Create a new dialog named “Invite Success.”
-
In the Invite Success dialog, delete the dialog starter. Add a Speech statement that says, “We’ve just sent you a message. We’ll close this voice call now and continue over messaging. Good-bye!” Name the interaction “Ack invite success.” And set the statement’s next action to “Close Conversation.”
- Create a new dialog named “Invite Failure.”
-
In the Invite Failure dialog, delete the dialog starter. Add a Speech statement that says, “I’m sorry. We can’t send you a message at this time. Try again later.” Name the interaction “Ack invite failure.” And set the statement’s next action to redirect the flow to the “Anything else” dialog.
-
Return to the Transfer to Messaging dialog. In the Transfer to Messaging interaction, update the four rules so that each redirects the flow appropriately to one of the four dialogs that you just created. Save the interaction.
Step 33: Test the experience
- Start a conversation with the voice bot.
- Trigger the dialog flow that transfers the conversation to messaging.
- Once you receive the initial SMS message on your phone, reply to the message as the consumer.
- In Conversational Cloud, accept the conversation, and respond as the agent.
What's next?
Continue on to the next tutorial in the series.