clear input Action
Clears input that has been cached following barge in on a play action.
language wrappers and examples
The clear input properties are:
Property | Required/Optional | Default | Description |
---|---|---|---|
clear speech | optional | true | Clear speech input from a previous play action. |
clear digits | optional | true | Clear digit input from a previous play action. |
Remarks
A digit or speech can barge in a play action. The input that barged in will be cached and can subsequently be obtained using a get input action. The clear input
action can
clear this cached input so that only new input obtained during get input will be returned.
-
Examples:
Clear any barge in input between a play and get input action:
{ "play": { "play_list" : [ { "text_to_say" : "The office is currently closed. It will open at 10 a m." } ], "barge_in_on_speech" : true } }, { "clear_input" : {} }, { "get_input" : { "prompt" : { "play" : { "play_list" : [ { "text_to_say" : "Please say the reason for your call." } ] } }, "next_page" : { "url" : "useinputpage" } } }
If the play action is barged in with the word "next", get input plays its prompt and accepts input. The following may be returned:
"action_result" : { "action" : "get_input", "result" : { "input_type": "speech", "speech_input" : { "alternatives" : [ { "text" : "I'm calling to close my account", "confidence" : 0.83 } ], "direction" : "inbound", "final" : true } } }
-
ClearInput Class
Namespace: Aculab.Cloud.RestAPIWrapper
Assembly: Aculab.Cloud.RestAPIWrapper.dllAn action to clear speech and digit input that has been cached by barge in on a play action.
-
public class ClearInput : TelephonyAction { // Constructors public ClearInput(); // Members public bool ClearSpeech; public bool ClearDigits; }
Examples:
-
Clear any barge in input between a play and get input action:
List<TelephonyAction> actions = new List<TelephonyAction>(); var playAction = Play.SayText("The office is currently closed. It will open at 10 a m."); playAction.BargeInOnSpeech = true; actions.Add(playAction); actions.Add(new ClearInput()); var nextPage = new WebPageRequest("UseInputPage.aspx"); var getInputAction = new GetInput(nextPage, Play.SayText("Please say the reason for your call.")); actions.Add(getInputAction);
-
-
public class ClearInput : TelephonyAction { // Constructors public ClearInput(); // Members public bool ClearSpeech; public bool ClearDigits; }
Examples:
-
Clear any barge in input between a play and get input action:
List<TelephonyAction> actions = new List<TelephonyAction>(); var playAction = Play.SayText("The office is currently closed. It will open at 10 a m."); playAction.BargeInOnSpeech = true; actions.Add(playAction); actions.Add(new ClearInput()); var nextPage = new WebPageRequest("UseInputPage.aspx"); var getInputAction = new GetInput(nextPage, Play.SayText("Please say the reason for your call.")); actions.Add(getInputAction);
-
-
public class ClearInput : TelephonyAction { // Constructors public ClearInput(); // Members public bool ClearSpeech; public bool ClearDigits; }
Examples:
-
Clear any barge in input between a play and get input action:
List<TelephonyAction> actions = new List<TelephonyAction>(); var playAction = Play.SayText("The office is currently closed. It will open at 10 a m."); playAction.BargeInOnSpeech = true; actions.Add(playAction); actions.Add(new ClearInput()); var nextPage = new WebPageRequest("UseInputPage.aspx"); var getInputAction = new GetInput(nextPage, Play.SayText("Please say the reason for your call.")); actions.Add(getInputAction);
-
-
-
ClearInput Class
Namespace: Aculab.Cloud.RestAPIWrapper
Assembly: Aculab.Cloud.RestAPIWrapper.dllAn action to clear speech and digit input that has been cached by barge in on a play action.
-
Public Class ClearInput Inherits TelephonyAction ' Constructors Public Sub New () ' Members Public Property ClearSpeech As Bool Public Property ClearDigits As Bool End Class
Examples:
-
Clear any barge in input between a play and get input action:
Dim actions = New List(Of TelephonyAction) Dim playAction = Play.SayText("The office is currently closed. It will open at 10 a m.") playAction.BargeInOnSpeech = True actions.Add(playAction) actions.Add(New ClearInput()) Dim nextPage = New WebPageRequest("useinputpage.aspx") Dim getInputAction = New GetInput(nextPage, Play.SayText("Please say the reason for your call.")) actions.Add(getInputAction)
-
-
Public Class ClearInput Inherits TelephonyAction ' Constructors Public Sub New () ' Members Public Property ClearSpeech As Bool Public Property ClearDigits As Bool End Class
Examples:
-
Clear any barge in input between a play and get input action:
Dim actions = New List(Of TelephonyAction) Dim playAction = Play.SayText("The office is currently closed. It will open at 10 a m.") playAction.BargeInOnSpeech = True actions.Add(playAction) actions.Add(New ClearInput()) Dim nextPage = New WebPageRequest("useinputpage.aspx") Dim getInputAction = New GetInput(nextPage, Play.SayText("Please say the reason for your call.")) actions.Add(getInputAction)
-
-
-
class ClearInput extends TelephonyAction
Represents an clear input action.
Class synopsis:
// Constructors: public ClearInput() public ClearInput(boolean clearSpeech, boolean clearDigits) // Members: public void setClearSpeech(boolean clearSpeech) public void setClearDigits(boolean clearDigits)
Examples:
Clear any barge in input between a play and get input action:
List<TelephonyAction> actions = new ArrayList<TelephonyAction>(); Play playAction = Play.sayText("The office is currently closed. It will open at 10 a m."); playAction.setBargeInOnSpeech(true); GetInput getInputAction = new GetInput(new WebPageRequest("useinputpage")); getInputAction.setPrompt(Play.sayText("Please say the reason for your call.")); actions.add(playAction); actions.add(new ClearInput()); actions.add(getInputAction);
-
class ClearInput
Represents a clear input action.
Class synopsis:
# ClearInput object: ClearInput(clear_speech=None, clear_digits=None) # Instance methods: ClearInput.set_clear_speech(clear_speech) ClearInput.set_clear_digits(clear_digits)
Examples:
-
Clear any barge in input between a play and get input action:
# Create a list of actions that will be passed to the TelephonyResponse constructor list_of_actions = [] play_action = Play(text_to_say="The office is currently closed. It will open at 10 a m.") play_action.set_barge_in_on_speech(True) list_of_actions.append(play_action) list_of_actions.append(ClearInput()) get_input_action = GetInput(WebPage(url='use_number_page')) get_input_action.set_prompt(Play(text_to_say="Please say the reason for your call.")) list_of_actions.append(get_input_action)
-
-
The ClearInput class
Introduction
Represents the clear input action.
Class synopsis
class ClearInput extends ActionBase { /* methods */ public __construct() public self setClearSpeech(boolean $clear) public self setClearDigits(boolean $clear) }
Examples:
Clear any barge in input between a play and get input action:
$play = Play::sayText("The office is currently closed. It will open at 10 a m."); $play->setBargeInOnSpeech(true); $response->addAction($play); $response->addAction(new ClearInput()); $get_input = new GetInput("useinputpage.php"); $get_input->setPrompt(Play::sayText("Please say the reason for your call.")); $response->addAction($get_input);