When the current session is a voice channel this key will either play a message or an audio file from a URL. In the case of an text channel it will send the text back to the user via instant messaging or SMS.
Inheritance: TropoBase
        protected void Page_Load(object sender, EventArgs e)
        {
            // Create a new instance of the Tropo object.
            Tropo tropo = new Tropo();

            // Set the voice to use when saying a prompt.
            tropo.Voice = Voice.UsEnglishMale;

            // A prompt to give the say to the recipient.
            Say say = new Say("Remember you have a meeting at 2 PM");

            // An ArrayList to hold the numbers to call (first call answered hears the prompt).
            List<String> to = new List<String>();
            to.Add("3055195825");
            to.Add("3054445567");

            // Create an endpoint object to denote who the call is from.
            string from = "7777777777";

            // Call the message method of the Tropo object and pass in values.
            tropo.Message(say, to, false, Channel.Voice, from, "reminder", Network.Pstn, true, 60);

            // Render the 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();

            // 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());
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Create a new instance of the Tropo object.
            Tropo tropo = new Tropo();

            // Set the voice property.
            tropo.Voice = Voice.UsEnglishMale;

            Say say = new Say("Please record your 45 second message after the beep, press pound when complete.");

            tropo.Say(say);

            Record record = new Record()
            {
                Bargein = true,
                Beep = true,
                Say = new Say(""),
                Format = "audio/mp3",
                MaxTime = 45,
                Choices = new Choices("", "dtmf", "#"),
                Url = "../UploadRecording"
            };

            tropo.Record(record);

            // Render JSON for Tropo to consume.
            Response.Write(tropo.RenderJSON());
        }
Exemplo n.º 4
0
 private static void ConvertPrompt(global::VoiceModel.Prompt prompt, string json, ref Tropo tmodel, string sayOnEvent = null)
 {
     foreach (IAudio audio in prompt.audios)
     {
         TropoCSharp.Tropo.Say s = AudioToSay(audio, json);
         tmodel.Say(s);
     }
 }
        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());
 }
Exemplo n.º 8
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");
        }
Exemplo n.º 9
0
        private static TropoCSharp.Tropo.Say ConvertPromptList(List <global::VoiceModel.Prompt> prompts, string json)
        {
            TropoCSharp.Tropo.Say say = null;
            string strPromptList      = string.Empty;

            foreach (Prompt prompt in prompts)
            {
                foreach (IAudio audio in prompt.audios)
                {
                    strPromptList += AudioToSayString(audio, json);
                }
            }
            say = new TropoCSharp.Tropo.Say(strPromptList);
            return(say);
        }
        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());
        }
Exemplo n.º 11
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));
        }
Exemplo n.º 12
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();

            // 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());
        }
Exemplo n.º 14
0
 /// <summary>
 /// Overload method for Say that allows a Say object to be passed directly.
 /// </summary>
 /// <param name="say">A Say object.</param>
 public void say(Say say)
 {
     this.say(say.value, say.@as, say.name, (bool)say.required);
 }
Exemplo n.º 15
0
        /// <summary>
        /// Ooverload method for Say that allows an arrat of prompts to be used.
        /// </summary>
        /// <param name="says">The prompts to say or send to the caller.</param>
        public void Say(IEnumerable<String> says)
        {
            List<Say> saysToAdd = new List<Say>();
            foreach (string element in says)
            {
                Say say = new Say();
                say.Value = element;
                say.As = null;
                say.Name = null;
                say.Required = true;

                saysToAdd.Add(say);
            }

            JsonSerializerSettings settings = new JsonSerializerSettings();
            settings.DefaultValueHandling = DefaultValueHandling.Ignore;
            ActionElements.Add("{ \"say\":" + JsonConvert.SerializeObject(saysToAdd, Formatting.None, settings) + "}");
        }
Exemplo n.º 16
0
 /// <summary>
 /// Overload method for Say that allows a Say object to be passed directly.
 /// </summary>
 /// <param name="say">A Say object.</param>
 public void Say(Say say)
 {
     Say(say.Value, say.As, say.Name, say.Required);
 }
Exemplo n.º 17
0
 private static TropoCSharp.Tropo.Say AudioToSay(IAudio audio, string json)
 {
     TropoCSharp.Tropo.Say s = new TropoCSharp.Tropo.Say(AudioToSayString(audio, json));
     return(s);
 }
        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());
        }
        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);
        }
Exemplo n.º 20
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");
        }
Exemplo n.º 21
0
 public Ask(Choices choices, string name, Say say)
 {
     Choices = choices;
     Name = name;
     Say = new [] {say};
 }
Exemplo n.º 22
0
 public Ask(Choices choices, string name, Say say)
 {
     Choices = choices;
     Name = name;
     Say = say;
 }
Exemplo n.º 23
0
 public On(string @event, string next, Say say)
 {
     Event = @event;
     Next  = next;
     Say   = say;
 }
Exemplo n.º 24
0
 public Ask(Choices choices, string name, Say say)
 {
     Choices = choices;
     Name    = name;
     Say     = say;
 }
Exemplo n.º 25
0
        /// <summary>
        /// Ooverload method for Say that allows an arrat of prompts to be used.
        /// </summary>
        /// <param name="says">The prompts to say or send to the caller.</param>
        public void say(Array says)
        {
            ArrayList saysToAdd = new ArrayList();
            foreach (string element in says)
            {
                Say say = new Say();
                say.value = element;
                say.@as = null;
                say.name = null;
                say.required = true;

                saysToAdd.Add(say);
            }

            JsonSerializerSettings settings = new JsonSerializerSettings();
            settings.DefaultValueHandling = DefaultValueHandling.Ignore;
            this.tropo.Add("{ \"say\":" + JsonConvert.SerializeObject(saysToAdd, Formatting.None, settings) + "}");
        }
Exemplo n.º 26
0
        /// <summary>
        /// When the current session is a voice channel this key will either play a message or an audio file from a URL.
        /// In the case of an text channel it will send the text back to the user via i nstant messaging or SMS. 
        /// </summary>
        /// <param name="value">This defines what the user will hear when the action is executed. </param>
        /// <param name="as">This specifies the type of data being spoken, so the TTS Engine can interpret it correctly.</param>
        /// <param name="name">Identifies the return value of a Say, so you know the context for the returned information.</param>
        /// <param name="required">Determines whether Tropo should move on to the next action.</param>
        public void say(string @value, string @as, string name, bool? required)
        {
            Say say = new Say();
            say.@value = @value;
            say.@as = @as;
            say.name = name;
            say.required = required;
            say.voice = String.IsNullOrEmpty(this.Voice) ? null : this.Voice;

            serialize(say, "say");
        }
        public void testMessageFromObject()
        {
            Say say = new Say("This is an announcement");
            string from = "3055551212";
            Message message = new Message();
            List<String> to = new List<String>();
            to.Add("3055195825");
            message.Say = say;
            message.To = to;
            message.From = from;
            message.AnswerOnMedia = false;
            message.Channel = Channel.Text;
            message.Network = Network.SMS;
            message.Timeout = 10;

            Tropo tropo = new Tropo();
            tropo.Voice = Voice.BritishEnglishFemale;
            tropo.Message(message);

            Assert.AreEqual(this.messageJson, tropo.RenderJSON());
        }
Exemplo n.º 28
0
 public Ask()
 {
     Say = new Say[0];
 }
Exemplo n.º 29
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");
        }
Exemplo n.º 30
0
 public On(string @event, string next, Say say)
 {
     Event = @event;
     Next = next;
     Say = say;
 }
Exemplo n.º 31
0
        /// <summary>
        /// A shortcut method to create a session, say something, and hang up, all in one step. 
        /// This is particularly useful for sending out a quick SMS or IM. 
        /// </summary>
        /// <param name="say">This determines what is played or sent to the caller.</param>
        /// <param name="to">The destination to make a call to or send a message to.</param>
        /// <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="channel">This defines the channel used to place new calls.</param>
        /// <param name="from">A string representing who the call is from.</param>
        /// <param name="name">Identifies the return value of a Message, so you know the context for the returned information.</param>
        /// <param name="network">Network is used mainly by the text channels; values can be SMS when sending a text message, or a valid IM network name such as AIM, MSN, JABBER, YAHOO and GTALK.</param>
        /// <param name="required">Determines whether Tropo should move on to the next action.</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 Message(Say say, IEnumerable<String> to, bool? answerOnMedia, string channel, string from, string name, string network, bool? required, float? timeout)
        {
            Message message = new Message();
            message.Say = say;
            message.To = to;
            message.AnswerOnMedia = answerOnMedia;
            message.Channel = channel;
            message.From = from;
            message.Name = name;
            message.Network = network;
            message.Required = required;
            message.Timeout = timeout;
            message.Voice = String.IsNullOrEmpty(this.Voice) ? null : this.Voice;

            Serialize(message, "message");
        }
        public void testMessageUseAllOptions()
        {
            Say say = new Say("This is an announcement");
            Tropo tropo = new Tropo();
            tropo.Voice = Voice.BritishEnglishFemale;
            string from = "3055551212";
            List<String> to = new List<String>();
            to.Add("3055195825");
            tropo.Message(say, to, false, Channel.Text, from, "foo", Network.SMS, true, 10);

            Assert.AreEqual(this.messageJsonAllOptions, tropo.RenderJSON());
        }
Exemplo n.º 33
0
        /// <summary>
        /// Adds an event callback so that your application may be notified when a particular event occurs.
        /// </summary>
        /// <param name="event">This defines which event the on action handles.</param>
        /// <param name="next">When an associated event occurs, Tropo will post to the URL defined here. If left blank, Tropo will simply hangup.</param>
        /// <param name="say">This determines what is played or sent to the caller.</param>      
        public void On(string @event, string next, Say say)
        {
            On on = new On();
            on.Event = @event;
            on.Next = next;
            on.Say = say;

            Serialize(on, "on");
        }
        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());
        }
Exemplo n.º 35
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");
        }
Exemplo n.º 36
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");
        }
Exemplo n.º 37
0
        /// <summary>
        /// Overload for say that allows events to be set via allowSignals.
        /// </summary>
        /// <param name="value"></param>
        /// <param name="allowSignals">Allows for the assignment of an interruptable signal for this Tropo function</param>
        /// <param name="as"></param>
        /// <param name="name"></param>
        /// <param name="required"></param>
        public void Say(string @value, Array allowSignals, string @as, string name, bool? required)
        {
            Say say = new Say();
            say.allowSignals = allowSignals;
            say.Value = @value;
            say.As = @as;
            say.Name = name;
            say.Required = required;
            say.Voice = String.IsNullOrEmpty(this.Voice) ? null : this.Voice;

            Serialize(say, "say");
        }
Exemplo n.º 38
0
 /// <summary>
 /// Overload method for Say that allows a Say object to be passed directly.
 /// </summary>
 /// <param name="say">A Say object.</param>
 public void Say(Say say)
 {
     Say(say.Value, say.As, say.Name, say.Required);
 }
Exemplo n.º 39
0
        /// <summary>
        /// Overload for Record that allows all events
        /// </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="interdigitTimeout">Defines how long to wait - in seconds - between key presses to determine the user has stopped entering input.</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, Array allowSignals, bool?bargein, bool?beep, Choices choices, string format, int?interdigitTimeout, 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.InterdigitTimeout = interdigitTimeout;
            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");
        }