public CallControlSpeakServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new CallControlSpeakService();

            this.createOptions = new CallControlSpeakOptions()
            {
                ClientState  = "aGF2ZSBhIG5pY2UgZGF5ID1d",
                CommandId    = new System.Guid("891510ac-f3e4-11e8-af5b-de00688a4901"),
                Payload      = "1www2WABCDw9",
                PayloadType  = "text",
                ServiceLevel = "premium",
                Stop         = "current",
                Voice        = "male",
                Language     = "en-US"
            };
        }
        public CallSpeakResponse Speak()
        {
            CallSpeakResponse       callSpeakResponse       = new CallSpeakResponse();
            CallControlSpeakOptions callControlSpeakOptions = new CallControlSpeakOptions
            {
                Payload  = "Say this on the call",
                Language = "en-US",
                Voice    = "female"
            };

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

            try
            {
                callSpeakResponse = callControlService.Speak(callControlSpeakOptions);
                Console.WriteLine(JsonConvert.SerializeObject(callSpeakResponse));
            }
            catch (TelnyxException ex)
            {
                Console.WriteLine("exception");
                Console.WriteLine(JsonConvert.SerializeObject(ex));
            }
            return(callSpeakResponse);
        }
Пример #3
0
 public virtual async Task <CallSpeakResponse> SpeakAsync(CallControlSpeakOptions options, string postFix = "actions/speak", RequestOptions requestOptions = null, CancellationToken ct = default)
 {
     return(await this.callControlSpeakService.CreateAsync(this.CallControlId, options, postFix, requestOptions, ct));
 }
Пример #4
0
 public virtual CallSpeakResponse Speak(CallControlSpeakOptions options, string postFix = "actions/speak", RequestOptions requestOptions = null)
 {
     return(this.callControlSpeakService.Create(this.CallControlId, options, postFix, requestOptions));
 }