The grammar to use in recognizing and validating input.
Inheritance: TropoBase
        protected void Page_Load(object sender, EventArgs e)
        {
            // Create a new instance of the Tropo object.
            Tropo tropo = new Tropo();

            // Create a transcription object to use with recording.
            Transcription trancription = new Transcription();
            trancription.Uri = "mailto:[email protected]";
            trancription.EmailFormat = "omit";

            // Set up grammar for recording.
            Choices choices = new Choices();
            choices.Value = "[10 DIGITS]";
            choices.Terminator = "#";

            // Construct a prompt to use with the recording.
            Say say = new Say();
            say.Value = "Please say your account number";

            // Use the record() method to set up a recording.
            tropo.Record(3, false, true, choices, AudioFormat.Wav, 10, 60, Method.Post, null, true, say, 5, trancription, null, "http://somehost.com/record.aspx");

            // Hangup when finished.
            tropo.Hangup();
            
            // Render the JSON for Tropo to consume.
            Response.Write(tropo.RenderJSON());
        }
Esempio n. 2
0
        private static TropoCSharp.Tropo.Choices ConvertGrammar(Grammar grammar)
        {
            string value = GetGrammarValue(grammar);

            TropoCSharp.Tropo.Choices choices = new TropoCSharp.Tropo.Choices(value);
            return(choices);
        }
        public void testAsk()
        {
            Say say = new Say("Please enter your 5 digit zip code.");
            Choices choices = new Choices("[5 DIGITS]");

            Tropo tropo = new Tropo();
            tropo.Ask(null, null, choices, null, "foo", null, say, null);
            Assert.AreEqual(this.askJson, tropo.RenderJSON());
        }
        public void testAskFromObject()
        {
            Say say = new Say("Please enter your 5 digit zip code.");
            Choices choices = new Choices("[5 DIGITS]");
            Ask ask = new Ask(choices, "foo", say);

            Tropo tropo = new Tropo();
            tropo.Ask(ask);
            Assert.AreEqual(this.askJson, tropo.RenderJSON());
        }
 public void testAskWithEvents()
 {
     Tropo tropo = new Tropo();
     string[] signals = new string[] { "endCall", "tooLong" };
     Say say = new Say("This is an Ask test with events. Please enter 1, 2 or 3.");
     Choices choices = new Choices("1,2,3");
     tropo.Ask(5, signals, false, choices, null, "test", true, say, 30);
     tropo.Hangup();
     Assert.AreEqual(this.askJsonWithEvents, tropo.RenderJSON());
 }
Esempio n. 6
0
        /// <summary>
        /// Sends a prompt to the user and optionally waits for a response. 
        /// </summary>
        /// <param name="attempts">How many times the caller can attempt input before an error is thrown.</param>
        /// <param name="bargein">Should the user be allowed to barge in before TTS is complete?</param>
        /// <param name="choices">The grammar to use in recognizing and validating input.</param>
        /// <param name="minConfidence">How confident should Tropo be in a speech recognition match?</param>
        /// <param name="name">identifies the return value of an ask, so you know the context for the returned information.</param>
        /// <param name="required">Is input required here?</param>
        /// <param name="say">This determines what is played or sent to the caller.</param>
        /// <param name="timeout">The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.</param>
        public void Ask(int? attempts, bool? bargein, Choices choices, int? minConfidence, string name, bool? required, Say say, float? timeout)
        {
            Ask ask = new Ask();
            ask.Attempts = attempts;
            ask.Bargein = bargein;
            ask.Choices = choices;
            ask.MinConfidence = minConfidence;
            ask.Name = name;
            ask.Required = required;
            ask.Voice = String.IsNullOrEmpty(this.Voice) ? null : this.Voice;
            ask.Say = say;
            ask.Timeout = timeout;

            Serialize(ask, "ask");
        }
Esempio n. 7
0
        private static void ConvertRecord(global::VoiceModel.Record model, ref Tropo tmodel)
        {
            TropoCSharp.Tropo.Choices choices = new TropoCSharp.Tropo.Choices()
            {
                Terminator = "#"
            };

            TropoCSharp.Tropo.Record record = new TropoCSharp.Tropo.Record()
            {
                Url     = model.nextUri,
                Say     = ConvertPromptList(model.prompts, ""),
                Choices = choices,
                Name    = "CallersMessage"
            };
            tmodel.Record(record);
        }
Esempio n. 8
0
        /// <summary>
        /// Overload method for Ask that allows events to be set via allowSignals.
        /// </summary>
        /// <param name="attempts">How many times the caller can attempt input before an error is thrown.</param>
        /// <param name="allowSignals">Allows for the assignment of an interruptable signal for this Tropo function</param>
        /// <param name="bargein">Should the user be allowed to barge in before TTS is complete?</param>
        /// <param name="interdigitTimeout">Defines how long to wait - in seconds - between key presses to determine the user has stopped entering input.</param>
        /// <param name="choices">The grammar to use in recognizing and validating input</param>
        /// <param name="minConfidence">How confident should Tropo be in a speech reco match?</param>
        /// <param name="name">Identifies the return value of an Ask, so you know the context for the returned information.</param>
        /// <param name="recognizer">Tells Tropo what language to listen for</param>
        /// <param name="required">Is input required here?</param>
        /// <param name="say">This determines what is played or sent to the caller.</param>
        /// <param name="timeout">The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.</param>
        public void Ask(int? attempts, Array allowSignals, bool? bargein, int? interdigitTimeout, Choices choices, int? minConfidence, string name, string recognizer, bool? required, Say say, float? timeout)
        {
            Ask ask = new Ask();
            ask.Attempts = attempts;
            ask.allowSignals = allowSignals;
            ask.Bargein = bargein;
            ask.Choices = choices;
            ask.InterdigitTimeout = interdigitTimeout;
            ask.MinConfidence = minConfidence;
            ask.Name = name;
            ask.Recognizer = recognizer;
            ask.Required = required;
            ask.Voice = String.IsNullOrEmpty(this.Voice) ? null : this.Voice;
            ask.Say = say;
            ask.Timeout = timeout;

            Serialize(ask, "ask");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // Create a new instance of the Tropo object
            Tropo tropo = new Tropo();
            
            // Set the grammar to use when collecting input.
            Choices choices = new Choices("[5 DIGITS]");
            
            // Create an event handler for when the input collection is finished. Tropo will POST Result object JSON.
            On on = new On(Event.Continue, "http://my-web-application-url/post", new Say("Please hold."));

            // Call the ask method of the Tropo object and pass in values. 
            tropo.Ask(3, false, choices, null, "zip", true, new Say("Please enter your 5 digit zip code"), 5);
            tropo.On(on);

            // Render the JSON for Tropo to consume.
            Response.Write(tropo.RenderJSON());
        }
Esempio n. 10
0
        public void testAskWithOptions()
        {
            Say say = new Say("Please enter your 5 digit zip code.");
            Choices choices = new Choices("[5 DIGITS]");
            Ask ask = new Ask();
            ask.choices = choices;
            ask.name = "foo";
            ask.say = say;
            ask.timeout = 30;
            ask.required = true;
            ask.minConfidence = 30;
            ask.attempts = 1;
            ask.bargein = false;

            Tropo tropo = new Tropo();
            tropo.ask(ask);
            Assert.AreEqual(this.askJsonWithOptions, TropoJSON.render(tropo));
        }
        public void testAskWithOptions()
        {
            Say say = new Say("Please enter your 5 digit zip code.");
            Choices choices = new Choices("[5 DIGITS]");
            Ask ask = new Ask();
            ask.Choices = choices;
            ask.Name = "foo";
            ask.Say = say;
            ask.Timeout = 30;
            ask.Required = true;
            ask.MinConfidence = 30;
            ask.Attempts = 1;
            ask.Bargein = false;

            Tropo tropo = new Tropo();
            tropo.Ask(ask);
            Assert.AreEqual(this.askJsonWithOptions, tropo.RenderJSON());
        }
Esempio n. 12
0
        /// <summary>
        /// Plays a prompt (audio file or text to speech) and optionally waits for a response from the caller that is recorded.
        /// If collected, responses may be in the form of DTMF or speech recognition using a simple grammar format defined below.
        /// The record funtion is really an alias of the prompt function, but one which forces the record option to true regardless of how it is (or is not) initially set.
        /// At the conclusion of the recording, the audio file may be automatically sent to an external server via FTP or an HTTP POST/Multipart Form.
        /// If specified, the audio file may also be transcribed and the text returned to you via an email address or HTTP POST/Multipart Form.
        /// </summary>
        /// <param name="attempts">How many times the caller can attempt input before an error is thrown.</param>
        /// <param name="bargein">Should the user be allowed to barge in before TTS is complete?</param>
        /// <param name="beep">When set to true, callers will hear a tone indicating the recording has begun.</param>
        /// <param name="choices">The grammar to use in recognizing and validating input.</param>
        /// <param name="format">This specifies the format for the audio recording.</param>
        /// <param name="maxSilence">The maximum amount of time, in seconds, to wait for silence after a user stops speaking.</param>
        /// <param name="maxTime">The maximum amount of time, in seconds, the user is allotted for input.</param>
        /// <param name="method">This defines how you want to send the audio file.</param>
        /// <param name="password">This identifies the FTP account password.</param>
        /// <param name="required">Determines whether Tropo should move on to the next action.</param>
        /// <param name="say">This determines what is played or sent to the caller.</param>
        /// <param name="timeout">The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.</param>
        /// <param name="username">This identifies the FTP account username.</param>
        /// <param name="url">This is the destination URL to send the recording.</param>
        public void Record(int?attempts, bool?bargein, bool?beep, Choices choices, string format, float?maxSilence, float?maxTime, string method, string password, bool?required, Say say, float?timeout, string username, string url)
        {
            Record record = new Record();

            record.Attempts   = attempts;
            record.Bargein    = bargein;
            record.Beep       = beep;
            record.Choices    = choices;
            record.Format     = format;
            record.MaxSilence = maxSilence;
            record.MaxTime    = maxTime;
            record.Method     = method;
            record.Password   = password;
            record.Required   = required;
            record.Say        = say;
            record.Timeout    = timeout;
            record.Url        = url;
            record.Username   = username;

            Serialize(record, "record");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // Create a new instance of the Tropo object.
            Tropo tropo = new Tropo();

            // Create an array of signals - used to interupt the Ask.
            string[] signals = new string[] {"endCall", "tooLong"};

            // A prompt to use with the Ask.
            Say say = new Say("This is an Ask test with events. Please enter 1, 2 or 3.");

            // Choices for the Ask.
            Choices choices = new Choices("1,2,3");

            // Set up the dialog.
            tropo.Ask(5, signals, false, choices, null, "test", true, say, 30);
            tropo.Hangup();

            // Render the dialog JSON for Tropo to consume.
            Response.Write(tropo.RenderJSON());
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // Create a new instance of the Tropo object.
            Tropo tropo = new Tropo();

            // Say an introductory message to the caller.
            tropo.Say("Welcome to the claim test application.");

            // Create new choices to use with Ask.
            Choices choices = new Choices("[5 DIGITS]");

            // Create new ask with desired prompt that will be sent to user.
            tropo.Ask(3, false, choices, null, "claim_id", true, new Say("Please enter your 5 digits claim ID."), 5);

            // Create On handlers for Tropo event.
            tropo.On(Event.Continue, "Answer.aspx", null);  // Fires when the user provides valid input.
            tropo.On(Event.Error, "Error.aspx", null);      // Fires when an error occurs.
            tropo.On(Event.Incomplete, "Error.aspx", null); // Fires when the user does not enter correct input.

            // Render JSON for Tropo to consume.
            Response.Write(tropo.RenderJSON());
        }
Esempio n. 15
0
        /// <summary>
        /// Overload method for Ask that allows an array of events to be used.
        /// </summary>
        /// <param name="attempts">How many times the caller can attempt input before an error is thrown.</param>
        /// <param name="bargein">Should the user be allowed to barge in before TTS is complete?</param>
        /// <param name="choices">The grammar to use in recognizing and validating input</param>
        /// <param name="minConfidence">How confident should Tropo be in a speech reco match?</param>
        /// <param name="name">Identifies the return value of an Ask, so you know the context for the returned information.</param>
        /// <param name="required">Is input required here?</param>
        /// <param name="say">This determines what is played or sent to the caller.</param>
        /// <param name="timeout">The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.</param>
        /// <param name="events">??</param>
        public void Ask(int? attempts, bool? bargein, Choices choices, int? minConfidence, string name, bool? required, Say say, float? timeout, Array events)
        {
            Ask ask = new Ask();
            ask.Attempts = attempts;
            ask.Bargein = bargein;
            ask.Choices = choices;
            ask.MinConfidence = minConfidence;
            ask.Name = name;
            ask.Required = required;
            ask.Voice = String.IsNullOrEmpty(this.Voice) ? null : this.Voice;
            ask.Say = say;
            ask.Timeout = timeout;

            Serialize(ask, "ask");

            // TODO: How is the events array supposed to be added to the Tropo object?
        }
        public void testNewRecordObjectWithOptionsInDifferentOrder()
        {
            Say say = new Say("Please say your account number");
            Choices choices = new Choices("[5 DIGITS]", null, "#");
            Record record = new Record();
            record.Say = say;
            record.Method = Method.Post;
            record.Choices = choices;
            record.Format = AudioFormat.Wav;
            record.Required = true;

            Tropo tropo = new Tropo();
            tropo.Record(record);
            Assert.AreEqual(this.recordJson, tropo.RenderJSON());
        }
        public void testRecordTranscription()
        {
            Say say = new Say("Please say your account number");
            Choices choices = new Choices("[5 DIGITS]", null, "#");
            Transcription transcription = new Transcription();

            transcription.Uri = "http://example.com/";
            transcription.Id = "foo";
            transcription.EmailFormat = "encoded";

            Tropo tropo = new Tropo();
            tropo.Record(1, false, true, choices, AudioFormat.Wav, 5, 30, Method.Post, "foo", true, say, 5, transcription, "bar", "http://example.com/");
            Assert.AreEqual(this.recordJsonWithTranscription, tropo.RenderJSON());
        }
Esempio n. 18
0
 public Ask(Choices choices, string name, Say say)
 {
     this.choices = choices;
     this.name = name;
     this.say = say;
 }
        public void testNewRecord()
        {
            Say say = new Say("Please say your account number");
            Choices choices = new Choices("[5 DIGITS]", null, "#");

            Tropo tropo = new Tropo();
            tropo.Record(null, null, null, choices, AudioFormat.Wav, null, null, Method.Post, null, null, say, null, null, null);
        }
Esempio n. 20
0
        /// <summary>
        /// Transfers an already answered call to another destination / phone number.
        /// Call may be transferred to another phone number or SIP address, which is set through the "to" parameter and is in URL format.
        /// </summary>
        /// <param name="answerOnMedia">If this is set to true, the call will be considered "answered" and audio will begin playing as soon as media is received from the far end.</param>
        /// <param name="choices">The grammar to use in recognizing and validating input.</param>
        /// <param name="from">An Endpoint object representing who the call is from.</param>
        /// <param name="on">An On object.</param>
        /// <param name="ringRepeat">The number of rings to allow on the outbound call attempt.</param>
        /// <param name="timeout">The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.</param>
        /// <param name="to">The new destination for the incoming call as a URL.</param>
        public void transfer(bool? answerOnMedia, Choices choices, Endpoint from, On on, int? ringRepeat, float? timeout, ArrayList to)
        {
            Transfer transfer = new Transfer();
            transfer.answerOnMedia = answerOnMedia;
            transfer.choices = choices;
            transfer.from = from;
            transfer.on = on;
            transfer.ringRepeat = ringRepeat;
            transfer.timeout = timeout;
            transfer.to = to;

            serialize(transfer, "transfer");
        }
Esempio n. 21
0
 public Ask(Choices choices, string name, IEnumerable<Say> say)
 {
     Choices = choices;
     Name = name;
     Say = say;
 }
Esempio n. 22
0
        /// <summary>
        /// Sends a prompt to the user and optionally waits for a response. 
        /// </summary>
        /// <param name="attempts">How many times the caller can attempt input before an error is thrown.</param>
        /// <param name="bargein">Should the user be allowed to barge in before TTS is complete?</param>
        /// <param name="choices">The grammar to use in recognizing and validating input.</param>
        /// <param name="minConfidence">How confident should Tropo be in a speech recognition match?</param>
        /// <param name="name">identifies the return value of an ask, so you know the context for the returned information.</param>
        /// <param name="required">Is input required here?</param>
        /// <param name="say">This determines what is played or sent to the caller.</param>
        /// <param name="timeout">The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.</param>
        public void ask(int? attempts, bool? bargein, Choices choices, int? minConfidence, string name, bool? required, Say say, float? timeout)
        {
            Ask ask = new Ask();
            ask.attempts = attempts;
            ask.bargein = bargein;
            ask.choices = choices;
            ask.minConfidence = minConfidence;
            ask.name = name;
            ask.required = required;

            if(!String.IsNullOrEmpty(this.Voice))
            {
                say.voice = this.Voice;
            }

            ask.say = say;
            ask.timeout = timeout;

            serialize(ask, "ask");
        }
Esempio n. 23
0
        /// <summary>
        /// Overload for Transfer that allows events to be set via allowSignals.
        /// </summary>
        /// <param name="answerOnMedia"></param>
        /// <param name="allowSignals">Allows for the assignment of an interruptable signal for this Tropo function</param>
        /// <param name="choices"></param>
        /// <param name="from"></param>
        /// <param name="on"></param>
        /// <param name="timeout"></param>
        /// <param name="to"></param>
        public void Transfer(bool? answerOnMedia, Array allowSignals, Choices choices, string from, On on, float? timeout, IEnumerable<String> to)
        {
            Transfer transfer = new Transfer();
            transfer.AnswerOnMedia = answerOnMedia;
            transfer.allowSignals = allowSignals;
            transfer.Choices = choices;
            transfer.From = from;
            transfer.On = on;
            transfer.Timeout = timeout;
            transfer.To = to;

            Serialize(transfer, "transfer");
        }
Esempio n. 24
0
        /// <summary>
        /// Overload method for Ask that allows an array of events to be used.
        /// </summary>
        /// <param name="attempts">How many times the caller can attempt input before an error is thrown.</param>
        /// <param name="bargein">Should the user be allowed to barge in before TTS is complete?</param>
        /// <param name="choices">The grammar to use in recognizing and validating input</param>
        /// <param name="minConfidence">How confident should Tropo be in a speech reco match?</param>
        /// <param name="name">Identifies the return value of an Ask, so you know the context for the returned information.</param>
        /// <param name="required">Is input required here?</param>
        /// <param name="say">This determines what is played or sent to the caller.</param>
        /// <param name="timeout">The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.</param>
        /// <param name="events">??</param>
        public void ask(int? attempts, bool? bargein, Choices choices, int? minConfidence, string name, bool? required, Say say, float? timeout, Array events)
        {
            Ask ask = new Ask();
            ask.attempts = attempts;
            ask.bargein = bargein;
            ask.choices = choices;
            ask.minConfidence = minConfidence;
            ask.name = name;
            ask.required = required;

            if (!String.IsNullOrEmpty(this.Voice))
            {
                say.voice = this.Voice;
            }

            ask.say = say;
            ask.timeout = timeout;

            serialize(ask, "ask");

            // TODO: How is the events array supposed to be added to the Tropo object?
        }
Esempio n. 25
0
        /// <summary>
        /// Overload for Record that allows events to be set via allowSignals.
        /// </summary>
        /// <param name="attempts"></param>
        /// <param name="allowSignals">Allows for the assignment of an interruptable signal for this Tropo function</param>
        /// <param name="bargein"></param>
        /// <param name="beep"></param>
        /// <param name="choices"></param>
        /// <param name="format"></param>
        /// <param name="maxSilence"></param>
        /// <param name="maxTime"></param>
        /// <param name="method"></param>
        /// <param name="password"></param>
        /// <param name="required"></param>
        /// <param name="say"></param>
        /// <param name="timeout"></param>
        /// <param name="transcription"></param>
        /// <param name="username"></param>
        /// <param name="url"></param>
        public void Record(int? attempts, Array allowSignals, bool? bargein, bool? beep, Choices choices, string format, float? maxSilence, float? maxTime, string method, string password, bool? required, Say say, float? timeout, Transcription transcription, string username, string url)
        {
            Record record = new Record();
            record.Attempts = attempts;
            record.allowSignals = allowSignals;
            record.Bargein = bargein;
            record.Beep = beep;
            record.Choices = choices;
            record.Format = format;
            record.MaxSilence = maxSilence;
            record.MaxTime = maxTime;
            record.Method = method;
            record.Password = password;
            record.Required = required;
            record.Say = say;
            record.Timeout = timeout;
            record.Transcription = transcription;
            record.Url = url;
            record.Username = username;

            Serialize(record, "record");
        }
Esempio n. 26
0
 public Ask(Choices choices, string name, Say say)
 {
     Choices = choices;
     Name = name;
     Say = say;
 }
Esempio n. 27
0
        /// <summary>
        /// Overload for Record that allows a Transcription object to be passed.
        /// </summary>
        /// <param name="attempts">How many times the caller can attempt input before an error is thrown.</param>
        /// <param name="bargein">Should the user be allowed to barge in before TTS is complete?</param>
        /// <param name="beep">When set to true, callers will hear a tone indicating the recording has begun.</param>
        /// <param name="choices">The grammar to use in recognizing and validating input.</param>
        /// <param name="format">This specifies the format for the audio recording.</param>
        /// <param name="maxSilence">The maximum amount of time, in seconds, to wait for silence after a user stops speaking.</param>
        /// <param name="maxTime">The maximum amount of time, in seconds, the user is allotted for input.</param>
        /// <param name="method">This defines how you want to send the audio file.</param>
        /// <param name="password">This identifies the FTP account password.</param>
        /// <param name="required">Determines whether Tropo should move on to the next action.</param>
        /// <param name="say">This determines what is played or sent to the caller.</param>
        /// <param name="timeout">The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.</param>
        /// <param name="transcription">This allows you to submit a recording to be transcribed and specifies where to send the transcription.</param>
        /// <param name="username">This identifies the FTP account username.</param>
        /// <param name="url">This is the destination URL to send the recording.</param>
        public void record(int? attempts, bool? bargein, bool? beep, Choices choices, string format, float? maxSilence, float? maxTime, string method, string password, bool? required, Say say, float? timeout, Transcription transcription, string username, string url)
        {
            Record record = new Record();
            record.attempts = attempts;
            record.bargein = bargein;
            record.beep = beep;
            record.choices = choices;
            record.format = format;
            record.maxSilence = maxSilence;
            record.maxTime = maxTime;
            record.method = method;
            record.password = password;
            record.required = required;
            record.say = say;
            record.timeout = timeout;
            record.transcription = transcription;
            record.url = url;
            record.username = username;

            serialize(record, "record");
        }
Esempio n. 28
0
        public void testNewRecordFromObject()
        {
            Say say = new Say("Please say your account number");
            Choices choices = new Choices("[5 DIGITS]", null, "#");
            Record record = new Record();
            record.choices = choices;
            record.format = AudioFormat.wav;
            record.method = Method.post;
            record.say = say;
            record.required = true;

            Tropo tropo = new Tropo();
            tropo.record(record);
            Assert.AreEqual(this.recordJson, TropoJSON.render(tropo));
        }
Esempio n. 29
0
 /// <summary>
 /// Sends a prompt to the user and optionally waits for a response. 
 /// </summary>
 /// <param name="attempts">How many times the caller can attempt input before an error is thrown.</param>
 /// <param name="bargein">Should the user be allowed to barge in before TTS is complete?</param>
 /// <param name="choices">The grammar to use in recognizing and validating input.</param>
 /// <param name="minConfidence">How confident should Tropo be in a speech recognition match?</param>
 /// <param name="name">identifies the return value of an ask, so you know the context for the returned information.</param>
 /// <param name="required">Is input required here?</param>
 /// <param name="say">This determines what is played or sent to the caller.</param>
 /// <param name="timeout">The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.</param>
 public void Ask(int? attempts, bool? bargein, Choices choices, int? minConfidence, string name, bool? required, Say say, float? timeout)
 {
     Ask(attempts, bargein, choices, minConfidence, name, required, new [] { say }, timeout);
 }
Esempio n. 30
0
 public Ask(Choices choices, string name, Say say)
 {
     Choices = choices;
     Name = name;
     Say = new [] {say};
 }
 public Ask(Choices choices, string name, Say say)
 {
     Choices = choices;
     Name    = name;
     Say     = say;
 }
Esempio n. 32
0
        /// <summary>
        /// Overload method for Ask that allows events to be set via allowSignals.
        /// </summary>
        /// <param name="attempts">How many times the caller can attempt input before an error is thrown.</param>
        /// <param name="allowSignals">Allows for the assignment of an interruptable signal for this Tropo function</param>
        /// <param name="bargein">Should the user be allowed to barge in before TTS is complete?</param>
        /// <param name="interdigitTimeout">Defines how long to wait - in seconds - between key presses to determine the user has stopped entering input.</param>
        /// <param name="choices">The grammar to use in recognizing and validating input</param>
        /// <param name="minConfidence">How confident should Tropo be in a speech reco match?</param>
        /// <param name="name">Identifies the return value of an Ask, so you know the context for the returned information.</param>
        /// <param name="recognizer">Tells Tropo what language to listen for</param>
        /// <param name="required">Is input required here?</param>
        /// <param name="say">This determines what is played or sent to the caller.</param>
        /// <param name="timeout">The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.</param>
        public void Ask(int?attempts, Array allowSignals, bool?bargein, int?interdigitTimeout, Choices choices, int?minConfidence, string name, string recognizer, bool?required, Say say, float?timeout)
        {
            Ask ask = new Ask();

            ask.Attempts          = attempts;
            ask.allowSignals      = allowSignals;
            ask.Bargein           = bargein;
            ask.Choices           = choices;
            ask.InterdigitTimeout = interdigitTimeout;
            ask.MinConfidence     = minConfidence;
            ask.Name       = name;
            ask.Recognizer = recognizer;
            ask.Required   = required;
            ask.Voice      = String.IsNullOrEmpty(this.Voice) ? null : this.Voice;
            ask.Say        = say;
            ask.Timeout    = timeout;

            Serialize(ask, "ask");
        }