diff --git a/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestConnect.cs b/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestConnect.cs index 5c6fe51..f0bf820 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestConnect.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestConnect.cs @@ -10,13 +10,14 @@ public class TestConnect [Fact] public void ConnectTest() { - var expected = " e-abc123 "; + var expected = " e-abc123 "; var endpoint = new Endpoint(); endpoint.EndpointId = "e-abc123"; var connect = new Connect(); connect.EventCallbackUrl = "https://example.com/callback"; + connect.EventFallbackUrl = "https://fallback.example.com/callback"; connect.Destination = endpoint; var response = new Response(connect); diff --git a/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestForward.cs b/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestForward.cs index ab4cc2f..1d83eba 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestForward.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestForward.cs @@ -10,7 +10,7 @@ public class TestForward [Fact] public void ForwardTest() { - var expected = " "; + var expected = " "; var forward = new Forward(); forward.To = "+15551234567"; @@ -19,6 +19,8 @@ public void ForwardTest() forward.DiversionTreatment = "propagate"; forward.DiversionReason = "away"; forward.Uui = "93d6f3c0be5845960b744fa28015d8ede84bd1a4;encoding=base64,asdf;encoding=jwt"; + forward.Privacy = true; + forward.CallerDisplayName = "Anonymous"; var response = new Response(forward); var actual = response.ToBXML(); diff --git a/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestGather.cs b/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestGather.cs index e1be225..fe79a43 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestGather.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestGather.cs @@ -11,7 +11,7 @@ public class TestGather [Fact] public void GatherTest() { - var expected = " test https://test.url/test.mp3 "; + var expected = " test https://test.url/test.mp3 "; var speakSentence = new SpeakSentence(); speakSentence.Text = "test"; @@ -34,6 +34,14 @@ public void GatherTest() gather.InterDigitTimeout = 5; gather.FirstDigitTimeout = 5; gather.RepeatCount = 1; + gather.Input = "dtmf speech"; + gather.Hints = "sales,support"; + gather.Language = "en-US"; + gather.PartialResultCallback = "https://partialTest.url/"; + gather.PartialResultCallbackMethod = "POST"; + gather.ProfanityFilter = false; + gather.SpeechModel = "default"; + gather.SpeechTimeout = 10; gather.SpeakSentence = new List { speakSentence }; gather.PlayAudio = new List { playAudio }; diff --git a/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestRecord.cs b/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestRecord.cs index 19d0b8f..7efd23f 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestRecord.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestRecord.cs @@ -9,7 +9,7 @@ public class TestRecord [Fact] public void RecordTest() { - var expected = " "; + var expected = " "; var record = new Bandwidth.Standard.Model.Bxml.Verbs.Record(); record.RecordCompleteUrl = "https://test.url/"; @@ -31,6 +31,7 @@ public void RecordTest() record.MaxDuration = 60; record.SilenceTimeout = 0; record.FileFormat = "wav"; + record.RecordingName = "test-recording"; var response = new Response(record); var actual = response.ToBXML(); diff --git a/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestStartRecording.cs b/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestStartRecording.cs index b6f63cc..74314be 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestStartRecording.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestStartRecording.cs @@ -10,7 +10,7 @@ public class TestStartRecording [Fact] public void StartRecordingTest() { - var expected = " "; + var expected = " "; var startRecording = new StartRecording(); startRecording.RecordingAvailableUrl = "https://test.url/"; @@ -24,6 +24,7 @@ public void StartRecordingTest() startRecording.Tag = "test"; startRecording.FileFormat = "mp3"; startRecording.MultiChannel = true; + startRecording.RecordingName = "test-recording"; var response = new Response(startRecording); var actual = response.ToBXML(); diff --git a/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestStartTranscription.cs b/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestStartTranscription.cs index e9aaf0a..47c9411 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestStartTranscription.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestStartTranscription.cs @@ -11,7 +11,7 @@ public class TestStartTranscription [Fact] public void StartTranscriptionTest() { - var expected = " "; + var expected = " "; var customParam = new CustomParam(); customParam.Name = "testName"; @@ -27,6 +27,8 @@ public void StartTranscriptionTest() startTranscription.Password = "password"; startTranscription.Destination = "wss://test.url/"; startTranscription.Stabilized = true; + startTranscription.DetectLanguage = false; + startTranscription.PreferredLanguages = "en-US,es-US"; startTranscription.CustomParams = new List { customParam }; var response = new Response(startTranscription); diff --git a/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestTransfer.cs b/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestTransfer.cs index 82b90df..30bdf90 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestTransfer.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/Bxml/TestTransfer.cs @@ -10,7 +10,7 @@ public class TestTransfer [Fact] public void TransferTest() { - var expected = " +15551234567 sip:1-999-123-4567@voip-provider.example.net "; + var expected = " +15551234567 sip:1-999-123-4567@voip-provider.example.net "; var phoneNumber = new PhoneNumber(); phoneNumber.Number = "+15551234567"; @@ -34,6 +34,7 @@ public void TransferTest() transfer.Tag = "test"; transfer.DiversionTreatment = "none"; transfer.DiversionReason = "user-busy"; + transfer.Privacy = true; transfer.PhoneNumbers = new PhoneNumber[] { phoneNumber }; transfer.SipUris = new SipUri[] { sipUri }; diff --git a/src/Bandwidth.Standard/Model/Bxml/Verbs/Connect.cs b/src/Bandwidth.Standard/Model/Bxml/Verbs/Connect.cs index 0ca1a2c..0b123d2 100644 --- a/src/Bandwidth.Standard/Model/Bxml/Verbs/Connect.cs +++ b/src/Bandwidth.Standard/Model/Bxml/Verbs/Connect.cs @@ -15,6 +15,12 @@ public class Connect : IVerb [XmlAttribute("eventCallbackUrl")] public string EventCallbackUrl { get; set; } + /// + /// (optional) A fallback url which, if provided, will be used to retry the event callback delivery in case eventCallbackUrl fails to respond. + /// + [XmlAttribute("eventFallbackUrl")] + public string EventFallbackUrl { get; set; } + /// /// The endpoint destination to connect to. /// diff --git a/src/Bandwidth.Standard/Model/Bxml/Verbs/Forward.cs b/src/Bandwidth.Standard/Model/Bxml/Verbs/Forward.cs index 81d1bd1..e568074 100644 --- a/src/Bandwidth.Standard/Model/Bxml/Verbs/Forward.cs +++ b/src/Bandwidth.Standard/Model/Bxml/Verbs/Forward.cs @@ -1,5 +1,4 @@ using Bandwidth.Standard.Model.Bxml; -using System; using System.Xml.Serialization; namespace Bandwidth.Standard.Model.Bxml.Verbs @@ -34,7 +33,7 @@ public Forward() /// The number of seconds to wait before timing out the call /// [XmlIgnore] - public Nullable CallTimeout { get; set; } + public int? CallTimeout { get; set; } /// /// The setter does nothing! This is just a surrogate field for nullable xml attribute serialization. @@ -63,5 +62,27 @@ public string CallTimeoutAsText /// [XmlAttribute("uui")] public string Uui { get; set; } + + /// + /// (optional) Whether to hide the calling number. Use callerDisplayName to customize the displayed name. + /// + [XmlIgnore] + public bool? Privacy { get; set; } + + /// + /// The setter does nothing! This is just a surrogate field for nullable xml attribute serialization. + /// + [XmlAttribute("privacy")] + public string PrivacyAsText + { + get { return (Privacy.HasValue) ? Privacy.ToString().ToLower() : null; } + set { } + } + + /// + /// (optional) The caller display name to use when the call is created, up to 256 characters. If privacy is true, only Restricted, Anonymous, Private, or Unavailable are valid. + /// + [XmlAttribute("callerDisplayName")] + public string CallerDisplayName { get; set; } } } diff --git a/src/Bandwidth.Standard/Model/Bxml/Verbs/Gather.cs b/src/Bandwidth.Standard/Model/Bxml/Verbs/Gather.cs index fcec2cb..7501a90 100644 --- a/src/Bandwidth.Standard/Model/Bxml/Verbs/Gather.cs +++ b/src/Bandwidth.Standard/Model/Bxml/Verbs/Gather.cs @@ -1,5 +1,4 @@ using Bandwidth.Standard.Model.Bxml; -using System; using System.Collections.Generic; using System.Xml.Serialization; @@ -86,7 +85,7 @@ public Gather() /// Quantity of digits to collect. /// [XmlIgnore] - public Nullable MaxDigits { get; set; } + public int? MaxDigits { get; set; } /// /// The setter does nothing! This is just a surrogate field for nullable xml attribute serialization. @@ -134,7 +133,7 @@ public string FirstDigitTimeoutAsText /// Integer between 1 and 30 that specifies how many times to play the audio. This parameter will be honored both inside and outside of a Gather verb. /// [XmlIgnore] - public Nullable RepeatCount { get; set; } + public int? RepeatCount { get; set; } /// /// The setter does nothing! This is just a surrogate field for nullable xml attribute serialization. @@ -146,6 +145,74 @@ public string RepeatCountAsText set { } } + /// + /// (optional) The input mode - dtmf, speech, or both. Defaults to dtmf. + /// + [XmlAttribute("input")] + public string Input { get; set; } + + /// + /// (optional) Words or phrases that improve speech recognition. Only used when input includes speech. + /// + [XmlAttribute("hints")] + public string Hints { get; set; } + + /// + /// (optional) Language code for speech recognition. Only used when input includes speech. + /// + [XmlAttribute("language")] + public string Language { get; set; } + + /// + /// (optional) Relative or absolute URL to send the Partial Result event to. Only used when input includes speech. + /// + [XmlAttribute("partialResultCallback")] + public string PartialResultCallback { get; set; } + + /// + /// (optional) The HTTP method to use for the request to partialResultCallback. Defaults to POST. + /// + [XmlAttribute("partialResultCallbackMethod")] + public string PartialResultCallbackMethod { get; set; } + + /// + /// (optional) Whether profane words are filtered out of the speech recognition result. Defaults to true. Only used when input includes speech. + /// + [XmlIgnore] + public bool? ProfanityFilter { get; set; } + + /// + /// The setter does nothing! This is just a surrogate field for nullable xml attribute serialization. + /// + [XmlAttribute("profanityFilter")] + public string ProfanityFilterAsText + { + get { return (ProfanityFilter.HasValue) ? ProfanityFilter.ToString().ToLower() : null; } + set { } + } + + /// + /// (optional) The speech recognition model to use. Only used when input includes speech. + /// + [XmlAttribute("speechModel")] + public string SpeechModel { get; set; } + + /// + /// (optional) Seconds to wait for speech input before timing out. Defaults to 5. + /// + [XmlIgnore] + public int? SpeechTimeout { get; set; } + + /// + /// The setter does nothing! This is just a surrogate field for nullable xml attribute serialization. + /// + [XmlAttribute("speechTimeout")] + public string SpeechTimeoutAsText + { + get { return (SpeechTimeout.HasValue) ? SpeechTimeout.ToString() : null; } + set { } + } + /// /// Using the SpeakSentence inside the Gather verb will speak the text to the callee. /// diff --git a/src/Bandwidth.Standard/Model/Bxml/Verbs/Record.cs b/src/Bandwidth.Standard/Model/Bxml/Verbs/Record.cs index c4a8e81..a6ecc1f 100644 --- a/src/Bandwidth.Standard/Model/Bxml/Verbs/Record.cs +++ b/src/Bandwidth.Standard/Model/Bxml/Verbs/Record.cs @@ -1,5 +1,4 @@ using Bandwidth.Standard.Model.Bxml; -using System; using System.Xml.Serialization; namespace Bandwidth.Standard.Model.Bxml.Verbs @@ -111,7 +110,7 @@ public class Record : IVerb /// (optional) Maximum length of recording (in seconds). /// [XmlIgnore] - public Nullable MaxDuration { get; set; } + public int? MaxDuration { get; set; } /// /// The setter does nothing! This is just a surrogate field for nullable xml attribute serialization. @@ -127,7 +126,7 @@ public string MaxDurationAsText /// (optional) Length of silence after which to end the recording (in seconds). Max is equivalent to the maximum maxDuration value. /// [XmlIgnore] - public Nullable SilenceTimeout { get; set; } + public int? SilenceTimeout { get; set; } /// /// The setter does nothing! This is just a surrogate field for nullable xml attribute serialization. @@ -144,5 +143,11 @@ public string SilenceTimeoutAsText /// [XmlAttribute("fileFormat")] public string FileFormat { get; set; } + + /// + /// (optional) A name identifying this recording, returned in the Recording Available event. + /// + [XmlAttribute("recordingName")] + public string RecordingName { get; set; } } } diff --git a/src/Bandwidth.Standard/Model/Bxml/Verbs/StartRecording.cs b/src/Bandwidth.Standard/Model/Bxml/Verbs/StartRecording.cs index 88ae34e..92ebe97 100644 --- a/src/Bandwidth.Standard/Model/Bxml/Verbs/StartRecording.cs +++ b/src/Bandwidth.Standard/Model/Bxml/Verbs/StartRecording.cs @@ -75,5 +75,11 @@ public class StartRecording : IVerb /// [XmlAttribute("multiChannel")] public bool MultiChannel { get; set; } + + /// + /// (optional) A name identifying this recording, returned in the Recording Available event. + /// + [XmlAttribute("recordingName")] + public string RecordingName { get; set; } } } diff --git a/src/Bandwidth.Standard/Model/Bxml/Verbs/StartTranscription.cs b/src/Bandwidth.Standard/Model/Bxml/Verbs/StartTranscription.cs index becb699..b8b3477 100644 --- a/src/Bandwidth.Standard/Model/Bxml/Verbs/StartTranscription.cs +++ b/src/Bandwidth.Standard/Model/Bxml/Verbs/StartTranscription.cs @@ -67,6 +67,28 @@ public StartTranscription() [XmlAttribute("stabilized")] public bool Stabilized { get; set; } + /// + /// (optional) Whether to detect the dominant language of the call rather than assuming English. Defaults to false. + /// + [XmlIgnore] + public bool? DetectLanguage { get; set; } + + /// + /// The setter does nothing! This is just a surrogate field for nullable xml attribute serialization. + /// + [XmlAttribute("detectLanguage")] + public string DetectLanguageAsText + { + get { return (DetectLanguage.HasValue) ? DetectLanguage.ToString().ToLower() : null; } + set { } + } + + /// + /// (optional) Comma-separated list of language locales to transcribe in, defaulting to en-US. Requires detectLanguage to be false, and supports one dialect per language. + /// + [XmlAttribute("preferredLanguages")] + public string PreferredLanguages { get; set; } + /// /// You may specify up to 12 CustomParam elements nested within a StartTranscription tag. diff --git a/src/Bandwidth.Standard/Model/Bxml/Verbs/Transfer.cs b/src/Bandwidth.Standard/Model/Bxml/Verbs/Transfer.cs index 0f9fb47..5dbbb6a 100644 --- a/src/Bandwidth.Standard/Model/Bxml/Verbs/Transfer.cs +++ b/src/Bandwidth.Standard/Model/Bxml/Verbs/Transfer.cs @@ -111,6 +111,22 @@ public string callTimeoutAsText [XmlAttribute("diversionReason")] public string DiversionReason { get; set; } + /// + /// (optional) Whether to hide the calling number. Use transferCallerDisplayName to customize the displayed name. + /// + [XmlIgnore] + public bool? Privacy { get; set; } + + /// + /// The setter does nothing! This is just a surrogate field for nullable xml attribute serialization. + /// + [XmlAttribute("privacy")] + public string PrivacyAsText + { + get { return (Privacy.HasValue) ? Privacy.ToString().ToLower() : null; } + set { } + } + /// /// Phone numbers to attempt to transfer the call to. ///