public CallControlTransferServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new CallControlTransferService();

            this.createOptions = new CallControlTransferOptions()
            {
                ClientState               = "aGF2ZSBhIG5pY2UgZGF5ID1d",
                CommandId                 = new System.Guid("891510ac-f3e4-11e8-af5b-de00688a4901"),
                To                        = "SIP:[email protected]",
                From                      = "+18005550101",
                AudioUrl                  = "http://www.example.com/sounds/greeting.wav",
                TimeLimitSecs             = 14400,
                TimeoutSecs               = 30,
                AnsweringMachineDetection = AnsweringMachineEnum.Disabled,
                SipAuthPassword           = "******",
                SipAuthUsername           = "******"
            };
        }
        public CallTransferResponse Transfer()
        {
            CallTransferResponse       response = new CallTransferResponse();
            CallControlTransferOptions options  = new CallControlTransferOptions
            {
                To = "+15552223333"
            };

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

            try
            {
                response = callControlService.Transfer(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 <CallTransferResponse> TransferAsync(CallControlTransferOptions options, string postFix = "actions/transfer", RequestOptions requestOptions = null, CancellationToken ct = default)
 {
     return(await this.callControlTransferService.CreateAsync(this.CallControlId, options, postFix, requestOptions, ct));
 }
Ejemplo n.º 4
0
 public virtual CallTransferResponse Transfer(CallControlTransferOptions options, string postFix = "actions/transfer", RequestOptions requestOptions = null)
 {
     return(this.callControlTransferService.Create(this.CallControlId, options, postFix, requestOptions));
 }