示例#1
0
        public async Task ListVoiceSettingsWithFiltersAsync()
        {
            var options = new VoiceSettingsListOptions
            {
                PageSize = 10,
            };
            var res = await numVoiceService.ListPhoneNumberVoiceAsync(options);

            Console.WriteLine(res.TelnyxResponse.ObjectJson);
        }
        public NumberConfigurationVoiceServiceTest(MockHttpClientFixture mockHttpClientFixture)
            : base(mockHttpClientFixture)
        {
            this.service = new NumberConfigurationVoiceService();

            this.updateOptions = new VoiceSettingUpdateOptions
            {
                CallForwarding = new CallForwarding()
                {
                    CallForwardingEnabled = true,
                    ForwardingType        = "on_failure",
                    ForwardsTo            = "+13035559997",
                },
                CallRecording = new CallRecording()
                {
                    InboundCallRecordingEnabled  = true,
                    InboundCallRecordingChannels = "single",
                    InboundCallRecordingFormat   = "wav",
                },
                CnamListing = new CnamListing()
                {
                    CnamListingEnabled = true,
                    CnamListingDetails = "example",
                },
                MediaFeatures = new MediaFeatures()
                {
                    AcceptAnyRtpPacketsEnabled = true,
                    RtpAutoAdjustEnabled       = true,
                    T38FaxGatewayEnabled       = true,
                    MediaHandlingMode          = "default",
                },
                TechPrefixEnabled  = false,
                TranslatedNumber   = "+13035559996",
                UsagePaymentMethod = PaymentMethod.PayPerMinute,
            };
            this.emergencyOptions = new EmergencyOptions
            {
                EmergencyAddressId = "1315261609962112019",
                EmergencyEnabled   = false
            };
            this.listOptions = new VoiceSettingsListOptions
            {
                PageNumber = 1,
                PageSize   = 25,
                //PhoneNumber = "+13035559999",
                //Size = 10,
                //UsagePaymentMethod = PaymentMethod.PayPerMinute
            };

            this.requestOptions = new RequestOptions();

            this.cancellationToken = default(CancellationToken);
        }