public CallGatherUsingSpeakResponse GatherUsingSpeak()
        {
            CallGatherUsingSpeakResponse       response = new CallGatherUsingSpeakResponse();
            CallControlGatherUsingSpeakOptions options  = new CallControlGatherUsingSpeakOptions
            {
                Language = "en-US",
                Voice    = "female",
                Payload  = "Telnyx call control test"
            };

            Console.WriteLine(JsonConvert.SerializeObject(options));

            try
            {
                response = callControlService.GatherUsingSpeak(options);
                Console.WriteLine(JsonConvert.SerializeObject(response));
            }
            catch (TelnyxException ex)
            {
                Console.WriteLine("exception");
                Console.WriteLine(JsonConvert.SerializeObject(ex));
            }
            return(response);
        }
Пример #2
0
        public CallControlGatherUsingSpeakServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new CallControlGatherUsingSpeakService();

            this.createOptions = new CallControlGatherUsingSpeakOptions()
            {
                ClientState             = "aGF2ZSBhIG5pY2UgZGF5ID1d",
                CommandId               = new System.Guid("891510ac-f3e4-11e8-af5b-de00688a4901"),
                Payload                 = "Say this on the call",
                InvalidPayload          = "Say this on the call",
                PayloadType             = "text",
                ServiceLevel            = "basic",
                Voice                   = "female",
                Language                = "en-US",
                InterDigitTimeoutMillis = 5000,
                MaximumDigits           = 128,
                MaximumTries            = 3,
                TimeoutMillis           = 60000,
                MinimumDigits           = 128,
                TerminatingDigit        = "#",
                ValidDigits             = "123"
            };
        }
Пример #3
0
 public virtual async Task <CallGatherUsingSpeakResponse> GatherUsingSpeakAsync(CallControlGatherUsingSpeakOptions options, string postFix = "actions/gather_using_speak", RequestOptions requestOptions = null, CancellationToken ct = default)
 {
     return(await this.callControlGatherUsingSpeakService.CreateAsync(this.CallControlId, options, postFix, requestOptions, ct));
 }
Пример #4
0
 public virtual CallGatherUsingSpeakResponse GatherUsingSpeak(CallControlGatherUsingSpeakOptions options, string postFix = "actions/gather_using_speak", RequestOptions requestOptions = null)
 {
     return(this.callControlGatherUsingSpeakService.Create(this.CallControlId, options, postFix, requestOptions));
 }