當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。