public CallDialResponse Dial()
        {
            CallDialResponse       callDialResponse       = new CallDialResponse();
            CallControlDialOptions callControlDialOptions = new CallControlDialOptions {
                To              = "+18005550100 or SIP:[email protected]",
                From            = "+18005550101",
                ConnectionId    = "string",
                AudioUrl        = "http://example.com/message.wav",
                TimeoutSecs     = 60,
                TimeLimitSecs   = 600,
                ClientState     = "aGF2ZSBhIG5pY2UgZGF5ID1d",
                CommandId       = new Guid("891510ac-f3e4-11e8-af5b-de00688a4901"),
                LinkTo          = "ilditnZK_eVysupV21KzmzN_sM29ygfauQojpm4BgFtfX5hXAcjotg==",
                SipAuthUsername = "******",
                SipAuthPassword = "******",
                FromDisplayName = "string"
            };

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

            try
            {
                callDialResponse = callControlService.Dial(callControlDialOptions);
                Console.WriteLine(JsonConvert.SerializeObject(callDialResponse));
            }
            catch (TelnyxException ex)
            {
                Console.WriteLine("exception");
                Console.WriteLine(JsonConvert.SerializeObject(ex));
            }
            return(callDialResponse);
        }
        public CallControlDialServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new CallControlDialService();

            this.createOptions = new CallControlDialOptions()
            {
                AnsweringMachineDetection = AnsweringMachineEnum.Disabled,
                AudioUrl        = "http://example.com/message.wav",
                ConnectionId    = "connection",
                From            = "+18005550101",
                LinkTo          = "ilditnZK_eVysupV21KzmzN_sM29ygfauQojpm4BgFtfX5hXAcjotg",
                SipAuthPassword = "******",
                SipAuthUsername = "******",
                TimeLimitSecs   = 100,
                TimeoutSecs     = 100,
                To               = "+18005550100",
                ClientState      = "aGF2ZSBhIG5pY2UgZGF5ID1d",
                CommandId        = new System.Guid("891510ac-f3e4-11e8-af5b-de00688a4901"),
                WebhookUrl       = "https://test.com/api/v1/testApi",
                WebhookUrlMethod = WebhookUrlMethods.POST
            };
        }
Exemple #3
0
 public virtual async Task <CallDialResponse> DialAsync(CallControlDialOptions options, RequestOptions requestOptions = null, CancellationToken ct = default)
 {
     return(await this.callControlDialService.CreateAsync(options, requestOptions, ct));
 }
Exemple #4
0
 public virtual CallDialResponse Dial(CallControlDialOptions options, RequestOptions requestOptions = null)
 {
     return(this.callControlDialService.Create(options, requestOptions));
 }