Пример #1
0
        public CallControlGatherUsingAudioServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new CallControlGatherUsingAudioService();

            this.createOptions = new CallControlGatherUsingAudioOptions()
            {
                ClientState             = "aGF2ZSBhIG5pY2UgZGF5ID1d",
                CommandId               = new System.Guid("891510ac-f3e4-11e8-af5b-de00688a4901"),
                InterDigitTimeoutMillis = 5000,
                TimeoutMillis           = 60000,
                ValidDigits             = "123",
                TerminatingDigit        = "#",
                MaximumDigits           = 10,
                MinimumDigits           = 1,
                MaximumTries            = 3,
                InvalidAudioUrl         = "asdfasdf",
                AudioUrl = "afadsfasdf"
            };
        }
        public CallGatherUsingAudioResponse GatherUsingAudio()
        {
            CallGatherUsingAudioResponse       response = new CallGatherUsingAudioResponse();
            CallControlGatherUsingAudioOptions options  = new CallControlGatherUsingAudioOptions
            {
                AudioUrl = "https://audio.example.com"
            };

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

            try
            {
                response = callControlService.GatherUsingAudio(options);
                Console.WriteLine(JsonConvert.SerializeObject(response));
            }
            catch (TelnyxException ex)
            {
                Console.WriteLine("exception");
                Console.WriteLine(JsonConvert.SerializeObject(ex));
            }
            return(response);
        }
Пример #3
0
 public virtual async Task <CallGatherUsingAudioResponse> GatherUsingAudioAsync(CallControlGatherUsingAudioOptions options, string postFix = "actions/gather_using_audio", RequestOptions requestOptions = null, CancellationToken ct = default)
 {
     return(await this.callControlGatherUsingAudioService.CreateAsync(this.CallControlId, options, postFix, requestOptions, ct));
 }
Пример #4
0
 public virtual CallGatherUsingAudioResponse GatherUsingAudio(CallControlGatherUsingAudioOptions options, string postFix = "actions/gather_using_audio", RequestOptions requestOptions = null)
 {
     return(this.callControlGatherUsingAudioService.Create(this.CallControlId, options, postFix, requestOptions));
 }