當前位置: 首頁>>代碼示例>>C#>>正文


C# TwilioRestClient.GetCall方法代碼示例

本文整理匯總了C#中Twilio.TwilioRestClient.GetCall方法的典型用法代碼示例。如果您正苦於以下問題:C# TwilioRestClient.GetCall方法的具體用法?C# TwilioRestClient.GetCall怎麽用?C# TwilioRestClient.GetCall使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Twilio.TwilioRestClient的用法示例。


在下文中一共展示了TwilioRestClient.GetCall方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: 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 call = twilio.GetCall("CA42ed11f93dc08b952027ffbc406d0868");

        Console.WriteLine(call.To);
    }
開發者ID:TwilioDevEd,項目名稱:api-snippets,代碼行數:11,代碼來源:instance-get-example-1.4.x.cs

示例2: GetPrice

        private static decimal? GetPrice(TwilioRestClient client, string callId)
        {
            try
            {
                var count = 3;
                var price = 0m;

                while (count > 0)
                {
                    var call = client.GetCall(callId);
                    if (call.Price.HasValue)
                        price = (-1) * call.Price.Value;

                    if (price > 0)
                        break;

                    count--;
                    Thread.Sleep(5000);
                }

                Log.InfoFormat("Price: {0}, callId: {1}", price, callId);

                return price;
            }
            catch (Exception e)
            {
                Log.ErrorFormat("GetPrice: StackTrace:{0}, Message: {1}", e.StackTrace, e.Message);
            }

            return null;
        }
開發者ID:vipwan,項目名稱:CommunityServer,代碼行數:31,代碼來源:ApiHelper.cs

示例3: GetCallStatus

        private static string GetCallStatus(Call activeCall)
        {
            string accountSid = "ACa2de2b9a03db42ee981073b917cc8132";
            string authToken = "921a664399748302a019ee35c40e888c";

            TwilioRestClient client = new TwilioRestClient(accountSid, authToken);
            var call = client.GetCall(activeCall.Sid);
            return call.Status;
        }
開發者ID:rjdudley,項目名稱:CallCenter,代碼行數:9,代碼來源:StateManager.cs

示例4: GetCallDuration

        private static int GetCallDuration(Call activeCall)
        {
            string accountSid = "ACa2de2b9a03db42ee981073b917cc8132";
            string authToken = "921a664399748302a019ee35c40e888c";

            TwilioRestClient client = new TwilioRestClient(accountSid, authToken);
            var call = client.GetCall(activeCall.Sid);
            return call.Duration.HasValue ? call.Duration.Value : 0;
        }
開發者ID:rjdudley,項目名稱:CallCenter,代碼行數:9,代碼來源:StateManager.cs

示例5: GetCall

        private static LocationalCall GetCall(string CallSid)
        {
            string accountSid = "ACa2de2b9a03db42ee981073b917cc8132";
            string authToken = "921a664399748302a019ee35c40e888c";

            TwilioRestClient client = new TwilioRestClient(accountSid, authToken);
            var call = client.GetCall(CallSid);
            return new LocationalCall(call);
        }
開發者ID:1kevgriff,項目名稱:CallCenter,代碼行數:9,代碼來源:PhoneController.cs


注:本文中的Twilio.TwilioRestClient.GetCall方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。