Ejemplo n.º 1
0
        public CallControlPlaybackStartServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new CallControlPlaybackStartService();

            this.createOptions = new CallControlPlaybackStartOptions()
            {
                ClientState = "aGF2ZSBhIG5pY2UgZGF5ID1d",
                CommandId   = new System.Guid("891510ac-f3e4-11e8-af5b-de00688a4901"),
                Loop        = "infinity",
                Overlay     = false,
                Stop        = "current",
                TargetLegs  = "self",
                AudioUrl    = "http://www.example.com/sounds/greeting.wav"
            };
        }
        public CallPlaybackStartResponse PlaybackStart()
        {
            CallPlaybackStartResponse       response = new CallPlaybackStartResponse();
            CallControlPlaybackStartOptions options  = new CallControlPlaybackStartOptions
            {
                AudioUrl = "https://audio.example.com"
            };

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

            try
            {
                response = callControlService.PlaybackStart(options);
                Console.WriteLine(JsonConvert.SerializeObject(response));
            }
            catch (TelnyxException ex)
            {
                Console.WriteLine("exception");
                Console.WriteLine(JsonConvert.SerializeObject(ex));
            }
            return(response);
        }
Ejemplo n.º 3
0
 public virtual async Task <CallPlaybackStartResponse> PlaybackStartAsync(CallControlPlaybackStartOptions options, string postFix = "actions/playback_start", RequestOptions requestOptions = null, CancellationToken ct = default)
 {
     return(await this.callControlPlaybackStartService.CreateAsync(this.CallControlId, options, postFix, requestOptions, ct));
 }
Ejemplo n.º 4
0
 public virtual CallPlaybackStartResponse PlaybackStart(CallControlPlaybackStartOptions options, string postFix = "actions/playback_start", RequestOptions requestOptions = null)
 {
     return(this.callControlPlaybackStartService.Create(this.CallControlId, options, postFix, requestOptions));
 }