{"id":18038,"date":"2018-02-02T11:00:43","date_gmt":"2018-02-02T11:00:43","guid":{"rendered":"http:\/\/developer.kore.ai\/v7-3\/?post_type=docs&#038;p=13204"},"modified":"2021-03-26T09:18:40","modified_gmt":"2021-03-26T09:18:40","slug":"adding-the-twilio-voice-channel","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v7-3\/docs\/bots\/channel-enablement\/adding-the-twilio-voice-channel\/","title":{"rendered":"Adding the Twilio Voice Channel"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>To add Twilio Voice as a channel to your Kore.ai bot, you will need to get a Twilio phone number and setup webhook integration to communicate with the bot. Adding the Twilio Voice channel to your Kore.ai Bot allows end users for your bot to interact with your bot using their <em>Twilio Voice<\/em> accounts. To add the Twilio Voice channel to your Bot, you will need to:<\/p>\n<ol>\n<li><b>Get a Twilio Number- <\/b>To enable Twilio Voice channel, you will need to create a Twilio phone number to be associated with this bot.<\/li>\n<li><b>Setup Integration- <\/b>To setup integration, you will need to create a TwiML App and get Webhook URL details from Configurations tab of Twilio Voice channel page to enter in the \u2018Request URL\u2019 for Voice to activate channel.<\/li>\n<li><b>Associate TwiML App with Twilio Phone Number<\/b>&#8211; To associate TwiML App with Twilio Phone Number, you will need to configure your preferred active Twilio number with TwiML App.<\/li>\n<li><b>Optional Configuration for Setting-up Agent Transfe<\/b>r- To use Agent Transfer functionality you will need to setup the Kore.ai Agent Transfer SDK.<\/li>\n<li><b>Enable Channel- <\/b>Once you setup integration and complete configuration, you will need to enable channel.<\/li>\n<\/ol>\n<div class=\"alert alert-info\">\n<p><b>Note:<\/b> Twilio Voice should ideally be enabled for bots that are specifically built to work on voice based channels. Please review the following constraints before enabling Twilio Voice as a channel for this bot:<\/p>\n<ol>\n<li>Enterprise Bots that require user\u2019s authorization to communicate with the bot are not supported on Twilio Voice.<\/li>\n<li>Tasks that require user\u2019s authorization to communicate with external systems should ideally be not included.<\/li>\n<li>Webhook Nodes work asynchronously and are currently are not supported on Twilio Voice.<\/li>\n<li>Use only dialog tasks for best user experience on Twilio Voice channel.<\/li>\n<li>Ensure that the bot responses you are going to configure for Twilio Voice are brief, plain text messages only.<\/li>\n<li>Bot receives user\u2019s voice response from Twilio Voice only after few moments of silence at user\u2019s end and this could appear as a lag to end user.<\/li>\n<\/ol>\n<\/div>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h5><strong>Pre-requisites to add the Twilio Voice Channel<\/strong><\/h5>\n<ol>\n<li><a href=\"https:\/\/www.twilio.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Login to your Twilio Voice account<\/a> to create a new Twilio number to be associated with your bot.<\/li>\n<li>To get a Twilio Number:\n<ol>\n<li>Navigate to <b>Products and Services<\/b> menu and select <b>Phone Numbers<\/b>.<\/li>\n<li>Create a new Twilio phone number to be associated with this bot. If you already have a Twilio phone number that you want to associate with this bot, then you can proceed to the next steps.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/15\/Getting-Started.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-13219\" src=\"\/wp-content\/uploads\/sites\/15\/Getting-Started.png\" alt=\"\" width=\"500\" height=\"225\" \/><\/a>Please note that the image may change depending on your Twilio account type.<\/li>\n<\/ol>\n<\/li>\n<li>To setup integration,\n<ol>\n<li>navigate to the <b>Tools<\/b> section of <b>Phone Numbers<\/b> menu.<\/li>\n<li>Select <b>TwiML Apps<\/b> to create a new TwiML App.<\/li>\n<li>Provide a name for the app and copy the Webhook URL provided in the Configurations tab of Twilio Voice Channel page and enter in the <b>Request URL<\/b> for Voice.<\/li>\n<li>Click on <b>Save<\/b> to complete the app creation.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/15\/Create-TwiML-App.png2_.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-13220\" src=\"\/wp-content\/uploads\/sites\/15\/Create-TwiML-App.png2_.png\" alt=\"\" width=\"500\" height=\"231\" \/><\/a><\/li>\n<\/ol>\n<\/li>\n<li>To associate TwiML App with Twilio Phone Number:\n<ol>\n<li>Navigate to <b>Manage Numbers<\/b> menu under Phone Numbers<b>. <\/b><\/li>\n<li>From <b>Active Numbers<\/b> section, select the number you would like to associate the TwiML App.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/15\/manage-numbers.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-13221\" src=\"\/wp-content\/uploads\/sites\/15\/manage-numbers.png\" alt=\"\" width=\"500\" height=\"287\" \/><\/a><\/li>\n<li>Under <b>Voice &amp; Fax<\/b> section, select <b>TwiML App<\/b> as the choice in <b>Configure With<\/b> field.<\/li>\n<li>A new field <b>TWIML APP<\/b> will be displayed and from this, select the app you have configured in the previous steps.<\/li>\n<li>Click on Save to complete this app association.<\/li>\n<\/ol>\n<\/li>\n<li>Optionally, you can also setup <b>Agent Transfer<\/b> functionality to transfer user\u2019s call conversation to another Twilio number. For this, you need to configure the Kore.ai Agent Transfer SDK.\n<ol>\n<li>You may download the <b>Agent Transfer SDK<\/b> from Kore.ai GitHub repository and define \u2018data.message\u2019, \u2018transferCallToAgent\u2019 and \u2018agentPhonenumber\u2019 parameters.\n<ul>\n<li><b>\u2018data.message\u2019:<\/b> Define the message to be read out to the end user when call is transferred to agent is initiated.<\/li>\n<li><b>\u2018transferCallToAgent\u2019<\/b>: Set this flag to <b>True<\/b> to enable Agent Transfer and <b>False<\/b> to disable.<\/li>\n<li><b>\u2018agentPhonenumber\u2019<\/b>: Provide your Twilio phone number to which the user call conversation is to be transferred to.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<div class=\"alert alert-info\">\n<p><strong style=\"font-size: 20px;\">To <b>Enable <\/b>Twilio Voice Channel<\/strong><\/p>\n<\/div>\n<ol>\n<li>In the <b>Bots<\/b> section of the Bot Builder, click the Bot that you want to add the Twilio Voice channel.<\/li>\n<li>On the <b>Channels<\/b> tab, click the <b>Twilio Voice<\/b> icon. The <b>Twilio Voice<\/b><b> Channel<\/b> page gets displayed.<\/li>\n<li>To complete the Channel setup, navigate to the <strong>Configurations tab<\/strong>.\n<ol>\n<li>\u00a0Enter your Twilio Number to be associated with Kore.ai bot.<\/li>\n<li>Select a <b>Language<\/b> to be used for communication with the bot by end-users.<\/li>\n<li>In the <b>Enable Channel<\/b> section, select <b>Yes<\/b>, and then click <b>Save<\/b> to complete user creation process and channel activation.<\/li>\n<\/ol>\n<\/li>\n<li id=\"properties\">From the <strong>Voice Call Properties<\/strong> tab,\u00a0 enter the following details to configure the channel level voice properties:<br \/>\n<table>\n<thead>\n<tr>\n<th>Field<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>End of Conversation Behavior<\/td>\n<td>This property can be used to define the bot behavior at the end of the conversation. The options are:<\/p>\n<ul>\n<li>Trigger End of Conversation Behavior and configure the Task, Script or Message to be initiated. <a href=\"\/v7-3\/docs\/bots\/advanced-topics\/event-based-bot-actions\/#End_of_Conversation\" target=\"_blank\" rel=\"noopener noreferrer\">See here for details<\/a>.<\/li>\n<li>Terminate the call.<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>Call Termination Handler<\/td>\n<td>Select the name of the Dialog task that you want to use as the call termination handler when the call ends in error.<\/td>\n<\/tr>\n<tr>\n<td>Timeout Prompt<\/td>\n<td>Enter the default prompt text to play when the user doesn\u2019t provide the input within the timeout period. If you do not specify a Timeout Prompt for any node, this prompt take its place.<\/td>\n<\/tr>\n<tr>\n<td>Barge-In<\/td>\n<td>Select whether you want to allow a user input while a prompt is in progress. If you select no, the user cannot provide input until IVR completes the prompt.<\/td>\n<\/tr>\n<tr>\n<td>Timeout<\/td>\n<td>Select the maximum wait time to receive user input from the drop-down list, from 1 second up to 60 seconds.<\/td>\n<\/tr>\n<tr>\n<td>No. of Retries<\/td>\n<td>Select the maximum number of retries to allow. You can select from just 1 retry up to 10 retries.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>Once you have enabled the Twilio channel, we recommend configuring the <strong>Welcome Event<\/strong> for Voice Call Settings. This would play a welcome message for users when they connect to the Bot via the Twilio channel.<br \/>\nFor this:<\/p>\n<ol>\n<li>From\u00a0<strong>Natural Language -&gt; Default Conversation -&gt; Event Handlers<\/strong> configure\u00a0<strong>Welcome Event<\/strong><\/li>\n<li>Select\u00a0<strong>Show Message<\/strong> under\u00a0<strong>Event Configuration<\/strong><\/li>\n<li>Click the <strong>Add Voice Call Settings<\/strong> button to open the Voice Call settings window<\/li>\n<li>Under the <strong>Initial Prompts<\/strong> text box, enter the message that needs to be played when the user connects to the Bot.<\/li>\n<li>For details regarding other configuration fields, refer to the <a href=\"#Dialog_Settings\">Configuring Voice Call Settings for a Node<\/a> section below.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<div class=\"alert alert-info\">\n<h2><span class=\"ez-toc-section\" id=\"Dialog_Settings\">Dialog Settings<\/span><\/h2>\n<h4>Setting Up Voice Call Properties for Dialog Nodes<\/h4>\n<p>On the Voice Call Properties panel for a node, you can enter node-specific prompts and parameters for call-flow behavior such as time-out and retries. If not enabled, you can use the <strong>enable<\/strong> button to enable the Voice Call settings for the Bot and then customize for the specific node.<\/p>\n<p>Voice Call settings apply only for the following nodes and message types:<\/p>\n<ul>\n<li>Entity Node<\/li>\n<li>Message Node<\/li>\n<li>Confirmation Node<\/li>\n<li>Standard Responses<\/li>\n<li>Welcome Message<\/li>\n<\/ul>\n<div class=\"alert alert-info\"><b>Note<\/b>: Most Voice Call settings are the same for all nodes, with a few exceptions.<\/div>\n<h5><strong>Configuring Voice Call Settings for a Node<\/strong><\/h5>\n<p>To configure Voice Call settings for a node, hover over the node in the Dialog task, and click the Settings icon. On the Properties panel, click the Voice Call icon.<\/p>\n<p><strong>Voice Call Settings Field Reference<\/strong><br \/>\nThe following sections provide detailed descriptions of each Voice Call setting, including descriptions, applicability to nodes, default values and other key information, as applicable to the Twilio channel<\/p>\n<ul>\n<li><strong>Prompts:\u00a0<\/strong>\n<ul>\n<li>You can enter prompts in one of these formats: Plain text, Scrip. If you want to define JavaScript, click the icon before the prompt text message box and select a mode. By default, it is set to Text mode.\n<ul>\n<li>You can enter more than one prompt messages of different types. You can define their order of sequence by dragging and dropping them.<\/li>\n<li>Multiple prompts are useful in scenarios where the prompt has to be played more than once, to avoid repetition, since the prompts are played in order.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Initial Prompts<\/strong><br \/>\n<em>Apply to: Entity, Confirmation, Message nodes; Standard Responses and Welcome Message<\/em><br \/>\nPrompts that are played when the Twilio first executes the node. If you do not enter a prompt for a node, the default user prompt for the node plays by default. If you do not enter a prompt for Standard Responses and Welcome Message, the default Standard Response and Welcome Message are played by default.<\/li>\n<li><strong>Timeout Prompts<\/strong><br \/>\n<i>Apply to: Entity, Confirmation; Standard Responses and Welcome Message<\/i><br \/>\nPrompts that are played on the Twilio channel when the user has not given any input within the specified time. If you do not enter a prompt for a node, the default Error Prompt of the node is played. Standard Responses and Welcomes have a default Timeout Prompt that plays if you don&#8217;t define No Match Prompts.<\/li>\n<li><strong>No Match Prompts<\/strong> &#8211; Not applicable for Twilio channel<\/li>\n<li><strong>Error Prompts<\/strong><br \/>\n<i>Apply to: Entity, Confirmation;\u00a0<\/i><br \/>\nPrompts that are played on the IVR channel when user input is an invalid Entity type. If you do not enter a prompt here, the default Error Prompt of the node is played.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Grammar<\/strong><br \/>\n<i>Applies to: Confirmation; Standard Responses and Welcome Message<\/i><br \/>\nDefine the grammar that should be used to detect the user&#8217;s utterance. You can define one or more grammars for a node.<\/p>\n<div class=\"alert alert-info\"><b>Transcription <\/b>option is enabled by default for the bot along with specifying the source of the transcription engine, defining grammar isn\u2019t mandatory.<\/div>\n<p><strong>To define the grammar<\/strong><\/p>\n<ol>\n<li>Select <strong>Speech<\/strong> as the input type. Input type DTMF is disabled for the Twilio channel.<\/li>\n<li>The Source of grammar is set to <strong>Custom.<\/strong> The link option is not available for the Twilio channel.<br \/>\nEnter a list of words or phrases to be used as &#8216;hints&#8217; in TwiML<\/li>\n<\/ol>\n<\/li>\n<li><strong>Advanced Options<\/strong><br \/>\nThese properties override the properties set in the Bot IVR Settings page.<\/p>\n<table>\n<thead>\n<tr>\n<th>Field<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Timeout<\/td>\n<td>Select the maximum wait time to receive user input from the drop-down list, from 1 second up to 60 seconds. The default value is the same as defined in the Bot IVR Settings page.<\/td>\n<\/tr>\n<tr>\n<td>No. of Retries<\/td>\n<td>Select the maximum number of retries to allow. You can select from just 1 retry up to 10 retries.<br \/>\nThe default value is the same as defined in the Bot IVR Settings page.<\/td>\n<\/tr>\n<tr>\n<td>Behavior on Exceeding Retries<br \/>\n(applies only to <span style=\"text-decoration: underline;\">entity node<\/span>)<\/td>\n<td>Define behavior when either\u00a0the timeout or number of retry attempts exceed the specified limit. Options include:<\/p>\n<ul>\n<li>Invoke CallTermination Handler<\/li>\n<li>Initiate Dialog: Select a Dialog task from the list of bot tasks.<\/li>\n<li>Jump to a specific node in the current task: Select a node from the list of nodes in the current Dialog task.<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>Barge-In<\/td>\n<td>Select whether you want to allow a user input while a prompt is in progress. If you select no, the user input is not considered until the prompt is completed. The default value is <b>No<\/b>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<\/ul>\n<\/div>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<div class=\"alert alert-info\"><\/div>\n<h1><span class=\"ez-toc-section\" id=\"Editing_the_Twilio_Voice_Channel\">Editing the Twilio Voice Channel<\/span><\/h1>\n<p>To edit the Twilio Voice channel, hover your mouse over the channel to modify, and then click the <b>Settings<\/b> icon to display the command menu as shown in the following illustration.<br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/15\/Edit-Twilio-V.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-13222\" src=\"\/wp-content\/uploads\/sites\/15\/Edit-Twilio-V.png\" alt=\"\" width=\"450\" height=\"210\" \/><\/a><br \/>\nSelect one of the following commands to modify the channel:<\/p>\n<ul>\n<li><b>Disable\/Enable<\/b> \u2013 Click <b>Disable<\/b> to temporarily disable use of the Twilio Voice for your Bot.To enable use of the Twilio Voice channel, Click <b>Enable.<\/b><\/li>\n<li><b>Delete<\/b> \u2013 Click <b>Delete<\/b>, and then click <b>OK<\/b> in the <b>Delete Confirmation<\/b> dialog to permanently delete the Bot channel configuration.<\/li>\n<\/ul>\n<div class=\"alert alert-warning\"><b>Warning:<\/b> This operation is permanent, and cannot be undone.<\/div>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/section><section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t\r\n\t\t<\/div>\r\n\t<\/div>\r\n<\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"To add Twilio Voice as a channel to your Kore.ai bot, you will need to get a Twilio phone number and setup webhook integration to communicate with the bot. Adding the Twilio Voice channel to your Kore.ai Bot allows end users for your bot to interact with your bot using their Twilio Voice accounts. To...","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-18038","post","type-post","status-publish","format-standard","hentry","category-channel-enablement"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts\/18038","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/comments?post=18038"}],"version-history":[{"count":3,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts\/18038\/revisions"}],"predecessor-version":[{"id":23995,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/posts\/18038\/revisions\/23995"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/media?parent=18038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/categories?post=18038"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-3\/wp-json\/wp\/v2\/tags?post=18038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}