当前位置: 首页>>代码示例>>C#>>正文


C# TwilioRestClient.ListCalls方法代码示例

本文整理汇总了C#中Twilio.TwilioRestClient.ListCalls方法的典型用法代码示例。如果您正苦于以下问题:C# TwilioRestClient.ListCalls方法的具体用法?C# TwilioRestClient.ListCalls怎么用?C# TwilioRestClient.ListCalls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Twilio.TwilioRestClient的用法示例。


在下文中一共展示了TwilioRestClient.ListCalls方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

 public void Main(string[] args)
 {
     // Setup configuration sources.
     // The order in which Configuration is built
     // is important
     var builder = new ConfigurationBuilder(Options.ApplicationBaseDirectory)
         .AddJsonFile("config.json")
         .AddEnvironmentVariables()
         .AddUserSecrets()
         .AddCommandLine(args);
     Configuration = builder.Build();
     // Instantiate a new Twilio Rest Client
     var client = new TwilioRestClient(
       Configuration.Get("AccountSid"),
       Configuration.Get("AuthToken")
     );
     // Select all calls from my account
     var calls = client.ListCalls(new CallListRequest());
     // Check for any exceptions
     if (calls.RestException != null)
     {
         throw new FormatException(calls.RestException.Message);
     }
     // Loop through them and show information
     foreach (var call in calls.Calls)
     {
         var callDetails = $"From: {call.From}, Day: {call.DateCreated}, Duration: {call.Duration}s";
         WriteLine(callDetails);
     }
     ReadLine();
 }
开发者ID:ZhangYueqiu,项目名称:asp5-mvc6-examples,代码行数:31,代码来源:Program.cs

示例2: Index

        // GET: Dashboard
        public ActionResult Index()
        {
            //var tickets = _repository.All();
            var twilio = new TwilioRestClient(_credentials.AccountSid, _credentials.AuthToken);

            // Build the parameters
            var options = new CallListRequest();

            var calls = twilio.ListCalls(options);
            foreach (var call in calls.Calls)
            {
                Console.WriteLine(call.Direction);
            }
            return View(calls.Calls);
        }
开发者ID:henrihietala,项目名称:twilio-quickblox-poc,代码行数:16,代码来源:DashboardController.cs

示例3: Main

    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/user/account
        string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        string AuthToken = "your_auth_token";
        var twilio = new TwilioRestClient(AccountSid, AuthToken);

        var request = new CallListRequest();
        request.From = "client:tommy";
        var calls = twilio.ListCalls(request);

        foreach (var call in calls.Calls)
        {
          Console.WriteLine(call.Direction);
        }
    }
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:16,代码来源:list-get-example-7.4.x.cs

示例4: Index

        public IActionResult Index(string phoneNumber)
        {
            // Instantiate a new Twilio Rest Client
            var client = new TwilioRestClient("your-twilio-account-sid", "your-twilio-auth-token");

            // Select all calls from my account based on a phoneNumber
            var calls = client.ListCalls(new CallListRequest(){To = phoneNumber});

            // Check for any exceptions
            if (calls.RestException != null)
            {
                throw new FormatException(calls.RestException.Message);
            }

            return View(calls.Calls);
        }
开发者ID:mplacona,项目名称:TwilioCallLog,代码行数:16,代码来源:HomeController.cs

示例5: Main

    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/user/account
        string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        string AuthToken = "your_auth_token";
        var twilio = new TwilioRestClient(AccountSid, AuthToken);

        var request = new CallListRequest();
        request.Status = "busy";
        request.To = "+15558675309";
        var calls = twilio.ListCalls(request);

        foreach (var call in calls.Calls)
        {
          Console.WriteLine(call.StartTime);
        }
    }
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:17,代码来源:list-get-example-6.4.x.cs

示例6: Main

    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/user/account
        string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        string AuthToken = "your_auth_token";
        var twilio = new TwilioRestClient(AccountSid, AuthToken);

        var request = new CallListRequest();
        request.Status = "completed";
        request.StartTimeComparison = ComparisonType.GreaterThanOrEqualTo;
        request.StartTime = new DateTime(2009, 07, 06);
        var calls = twilio.ListCalls(request);

        foreach (var call in calls.Calls)
        {
          Console.WriteLine(call.To);
        }
    }
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:18,代码来源:list-get-example-3.4.x.cs

示例7: Main

        public void Main(string[] args)
        {
            // Instantiate a new Twilio Rest Client
            var client = new TwilioRestClient("your-twilio-account-sid", "your-twilio-auth-token");

            // Select all calls from my account
            var calls = client.ListCalls(new CallListRequest());

            // Check for any exceptions
            if (calls.RestException != null)
            {
                throw new FormatException(calls.RestException.Message);
            }

            // Loop through them and show information
            foreach(var call in calls.Calls){
                var detail = String.Format("From: {0}, Day: {1}, Duration: {2}s", call.From, call.DateCreated, call.Duration);
                Console.WriteLine(detail);
            }
        }
开发者ID:mplacona,项目名称:TwilioCallLog,代码行数:20,代码来源:Program.cs

示例8: GetCalls

 public static CallResult GetCalls(Account Acnt)
 {
     TwilioRestClient acntInfo = new TwilioRestClient(Acnt.Sid, Acnt.AuthToken);
     CallResult calls = acntInfo.ListCalls();
     return (calls);
 }
开发者ID:chuckfrazier,项目名称:DataPlatform,代码行数:6,代码来源:ProcessTwilioData.cs

示例9: GetCallsAll

 public CallResult GetCallsAll(TwilioRestClient TwilioAccount, CallListRequest CallListReq )
 {
     var calls = TwilioAccount.ListCalls(CallListReq);
     return calls;
 }
开发者ID:ercrgg,项目名称:Twilio,代码行数:5,代码来源:TwilioConnect.cs


注:本文中的Twilio.TwilioRestClient.ListCalls方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。