CreateXml() public method

Create valid TelApi XML response
public CreateXml ( ) : string
return string
Beispiel #1
0
        private async void btnGenerateInboundXML_Click(object sender, RoutedEventArgs e)
        {
            var response = new Response();

            response.Say("Hello", null, null)
                    .Say("This is automated message", Voice.woman, null)
                    .Say("From now I will record this call", Voice.man, null)
                    .Record("http://url-post.com", null, 5, "#", 30, null, null, true, null, null)
                    .Say("I will dial another number now.")
                    .Dial(Dial.Create("+1234556"))
                    .Play("url-to-play.com")
                    .GetSpeech(GetSpeech.Create("gramar-url.com", "action-url.com").Say("Pausing...", null, null).Pause())
                    .Say("I will hangup now. Goodbye!", null, null)
                    .Hangup();

            var info = new MessageDialog(response.CreateXml());
            await info.ShowAsync();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            // We need to create Response object and after 
            // that we can call any method that we need

            var response = new Response();

            response.Say("Hello", null, null)
                    .Say("This is automated message", Voice.woman, null)
                    .Say("From now I will record this call", Voice.man, null)
                    .Record(UrlWhereToPost, null, 5, "#", 30, null, null, true, null, null)
                    .Say("I will dial another number now.")
                    .Dial(Dial.Create(PhoneNumberToDial))
                    .Play(UrlWhatToPlay)
                    .GetSpeech(GetSpeech.Create(UrlOfGrammar, UrlWhereToPost).Say("Pausing...", null, null).Pause())                    
                    .Say("I will hangup now. Goodbye!", null, null)
                    .Hangup();

            // On the end we need to call CreateXml on Response object
            // so that we can see our generated XML

            Console.WriteLine("{0}", response.CreateXml());
            Console.ReadKey();
        }