public void MakeFreeClimbClientNoAccountIdTest()
        {
            FreeClimbClient client = new FreeClimbClient("AC736ca2078721a9a41fb47f07bf40d9e21cb304da", "8e3d1c1c519fc761856f8cc825bcfea94d8c58b5");

            Assert.AreEqual(client.getCredAccountId, "AC736ca2078721a9a41fb47f07bf40d9e21cb304da");
            Assert.AreEqual(client.getCredAuthToken, "8e3d1c1c519fc761856f8cc825bcfea94d8c58b5");
        }
Exemplo n.º 2
0
        public static IList <Conference> GetConferencesList()
        {
            string             acctId      = getAcctId();
            string             apiKey      = getApiKey();
            IList <Conference> conferences = new List <Conference>();
            FreeClimbClient    client      = new FreeClimbClient(acctId, apiKey);
            // you can pass an option ConferenceSearchFilters class to the getConferences method to filter by certain criteria (e.g. alias, create date)
            ConferenceList conferenceList = client.getConferencesRequester.getConferences();

            if (conferenceList.getTotalSize > 0)
            {
                // Retrieve all pages of results
                while (conferenceList.getLocalSize < conferenceList.getTotalSize)
                {
                    conferenceList.loadNextPage();
                }
                foreach (IFreeClimbCommon item in conferenceList.export())
                {
                    Conference conf = item as Conference;
                    // do whatever you need to do with conferene object which contains all the conference properties
                    conferences.Add(conf);
                }
            }
            return(conferences);
        }
        static void Main(string[] args)
        {
            // Create FreeClimbClient object
            FreeClimbClient client = new FreeClimbClient(getFreeClimbAccountId(), getFreeClimbApiKeys());

            // Invoke get method to retrieve initial list of recording information
            RecordingList recordingList = client.getRecordingsRequester.getMeta();

            // Check if list is empty by checking total size of the list
            if (recordingList.getTotalSize > 0)
            {
                // retrieve all recording for server
                while (recordingList.getLocalSize < recordingList.getTotalSize)
                {
                    recordingList.loadNextPage();
                }

                // Convert current pages recording information to a linked list
                LinkedList <IFreeClimbCommon> commonList = recordingList.export();

                // Loop through linked list to process recording information
                foreach (IFreeClimbCommon element in commonList)
                {
                    // Cast each element to the Recording element for processing
                    Recording recording = element as Recording;

                    // Process recording element
                    Console.Write(recording.getRecordingId);
                }
            }
        }
        static void Main(string[] args)
        {
            string queueId = "";
            // Create FreeClimbClient object
            FreeClimbClient client = new FreeClimbClient(getFreeClimbAccountId(),
                                                         getFreeClimbAccountToken());

            // Invoke getMembers method to retrieve initial list of queue member information
            QueueMemberList queueMemberList = client.getQueuesRequester.getMembers(queueId);

            // Check if list is empty by checking total size of the list
            if (queueMemberList.getTotalSize > 0)
            {
                // retrieve all queue member information from server
                while (queueMemberList.getLocalSize < queueMemberList.getTotalSize)
                {
                    queueMemberList.loadNextPage();
                }

                // Convert current pages queue information to a linked list
                LinkedList <IFreeClimbCommon> commonList = queueMemberList.export();

                // Loop through linked list to process queue member information
                foreach (IFreeClimbCommon element in commonList)
                {
                    // Cast each element to the QueueMember element for processing
                    QueueMember queueMember = element as QueueMember;
                    Console.WriteLine(queueMember.getCallId);
                }
            }
            else
            {
                Console.WriteLine("No Members in queue");
            }
        }
Exemplo n.º 5
0
        public static IList <Participant> GetConferenceParticipantsList(string conferenceId)
        {
            string acctId              = getAcctId();
            string apiKey              = getApiKey();
            IList <Participant> ret    = new List <Participant> ();
            FreeClimbClient     client = new FreeClimbClient(acctId, apiKey);
            // the last two parameters are to filter on the participants talk and listen properties respectively
            ParticipantList participantList = client.getConferencesRequester.getParticipants(conferenceId);

            if (participantList.getTotalSize > 0)
            {
                // Retrieve all pages of results
                while (participantList.getLocalSize < participantList.getTotalSize)
                {
                    participantList.loadNextPage();
                }
                foreach (IFreeClimbCommon item in participantList.export())
                {
                    Participant participant = item as Participant;
                    // do whatever you need to do with participant object which contains all the conference properties
                    ret.Add(participant);
                }
            }
            return(ret);
        }
Exemplo n.º 6
0
        static void Dequeue(string queueId, string callId = "")
        {
            // Create FreeClimbClient object
            FreeClimbClient client = new FreeClimbClient(getFreeClimbAccountId(),
                                                         getFreeClimbApiKeys());

            // Invoke method to update the QueueMeber to dequeue it from the queue
            QueueMember queueMember = client.getQueuesRequester.updateQueueMember(queueId, callId);
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            string queueId = "";
            string callId  = "";
            // Create FreeClimbClient object
            FreeClimbClient client = new FreeClimbClient(getFreeClimbAccountId(),
                                                         getFreeClimbApiKeys());

            // Invoke get method to retrieve queued call metadata
            QueueMember queueMember = client.getQueuesRequester.getQueueMember(queueId, callId);
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            string queueId = "";
            // Create FreeClimbClient object
            FreeClimbClient client = new FreeClimbClient(getFreeClimbAccountId(),
                                                         getFreeClimbApiKeys());

            // Invoke get method to retrieve queued metadata
            Queue queue = client.getQueuesRequester.get(queueId);

            Console.WriteLine(queue.getQueueId);
        }
Exemplo n.º 9
0
        private void terminateConference(string conferenceId)
        {
            // your credentials information filled in here
            string          acctId = getAcctId();
            string          apiKey = getApiKey();
            FreeClimbClient client = new FreeClimbClient(acctId, apiKey);
            // terminating a conference is done by changing the status to Terminated
            ConferenceOptions options = new ConferenceOptions();

            options.setStatus(com.freeclimb.EConferenceStatus.Terminated);
            client.getConferencesRequester.update(conferenceId, options);
        }
Exemplo n.º 10
0
        static void Main(string[] args)
        {
            string alias = "My_First_Queue";

            QueueOptions options = new QueueOptions();

            options.setAlias(alias); // Set the optional alias

            // Create FreeClimbClient object
            FreeClimbClient client = new FreeClimbClient(getFreeClimbAccountId(),
                                                         getFreeClimbApiKeys());

            // Invoke method to create queue metadata
            Queue queue = client.getQueuesRequester.create(options);
        }
        static void Main(string[] args)
        {
            try {
                string freeClimbAccountId = System.Environment.GetEnvironmentVariable("ACCOUNT_ID");
                string freeClimbApiKey    = System.Environment.GetEnvironmentVariable("API_KEY");
                string recordingId        = "";

                // Create FreeClimbClient object
                FreeClimbClient client = new FreeClimbClient(freeClimbAccountId, freeClimbApiKey);

                // Invoke deleted method to delete recording Url
                client.getRecordingsRequester.delete(recordingId);
            } catch (FreeClimbException ex) {
                // Exception throw upon failure
                System.Console.WriteLine(ex.Message);
            }
        }
        static void Main(string[] args)
        {
            string alias   = "My_FC_Queue";
            int    maxSize = 10;
            string queueId = System.Environment.GetEnvironmentVariable("QUEUE_ID");

            // Create FreeClimbClient object
            FreeClimbClient client = new FreeClimbClient(getFreeClimbAccountId(),
                                                         getFreeClimbApiKeys());

            QueueOptions options = new QueueOptions();

            options.setAlias(alias);
            options.setMaxSize(maxSize);

            // Invoke get method to modify the queue
            Queue queue = client.getQueuesRequester.update(queueId, options);
        }
        public ActionResult InboundCall(CallStatusCallback freeClimbRequest)
        {
            // Create an empty PerCL script container
            PerCLScript script = new PerCLScript();

            // Verify inbound call is in proper state
            if (freeClimbRequest.getCallStatus == ECallStatus.Ringing)
            {
                // Create PerCL say script with US English as the language
                Say say = new Say();
                say.setLanguage(ELanguage.EnglishUS);
                // Set greeting prompt
                say.setText("Hello. Your call will be queued.");

                // Add PerCL say script to PerCL container
                script.Add(say);

                // Create PerCL pause script with a 100 millisecond pause
                script.Add(new Pause(100));

                // Create queue options with an alias
                QueueOptions options = new QueueOptions();
                options.setAlias("InboundCallQueue");

                // Create FreeClimbClient object
                FreeClimbClient client = new FreeClimbClient(getFreeClimbAccountId(), getFreeClimbApiKeys());

                // Create a queue with an alias
                Queue queue = client.getQueuesRequester.create(options);

                // Create PerCL say to enqueue the call into the newly created queue with an actionUrl
                Enqueue enqueue = new Enqueue(queue.getQueueId, getAppUrl() + "/voice/InboundCallAction");
                // Add waitUrl
                enqueue.setWaitUrl(getAppUrl() + "/voice/InboundCallWait");

                // Add PerCL enqueue script to PerCL container
                script.Add(enqueue);
            }

            // Convert PerCL container to JSON and append to response
            return(Content(script.toJson(), "application/json"));
        }
        static void Main(string[] args)
        {
            try
            {
                string FreeClimbAccountId = System.Environment.GetEnvironmentVariable("ACCOUNT_ID");
                string FreeClimbApiKey    = System.Environment.GetEnvironmentVariable("API_KEY");
                string RecordingId        = "";

                // Create FreeClimbClient object
                FreeClimbClient client = new FreeClimbClient(FreeClimbAccountId, FreeClimbApiKey);

                // Invoke get method with AudioReturn format of Stream to obtain IO stream of audio
                Stream stream = client.getRecordingsRequester.stream(RecordingId);
            }
            catch (FreeClimbException ex)
            {
                // Exception throw upon failure
                Console.Write(ex.Message);
            }
        }
Exemplo n.º 15
0
        static void Main(string[] args)
        {
            string          freeClimbAccountId = System.Environment.GetEnvironmentVariable("ACCOUNT_ID");
            string          freeClimbApiKey    = System.Environment.GetEnvironmentVariable("API_KEY");
            FreeClimbClient client             = new FreeClimbClient(freeClimbAccountId, freeClimbApiKey);
            CallList        callList           = client.getCallsRequester.get();

            if (callList.getTotalSize > 0)
            {
                while (callList.getLocalSize < callList.getTotalSize)
                {
                    callList.loadNextPage();
                }
                LinkedList <IFreeClimbCommon> commonList = callList.export();
                foreach (IFreeClimbCommon element in commonList)
                {
                    Call call = element as Call;
                    Console.WriteLine(call.getCallId);
                }
            }
        }
Exemplo n.º 16
0
        public void CreateCall([FromBody] string value)
        {
            string accountId = System.Environment.GetEnvironmentVariable("ACCOUNT_ID");
            string apiKey    = System.Environment.GetEnvironmentVariable("API_KEY");

            // Set up Call Details
            string applicationId        = System.Environment.GetEnvironmentVariable("APPLICATION_ID");
            string phoneNumber          = "+" + value;
            string freeclimbPhoneNumber = "Your FreeClimb Number Here";

            try {
                // Create the FreeClimbClient
                FreeClimbClient client = new FreeClimbClient(accountId, apiKey);
                // Create a Call
                Call call = client.getCallsRequester.create(phoneNumber,          // To
                                                            freeclimbPhoneNumber, // From,
                                                            applicationId);       // Application to Handle the call
            } catch (FreeClimbException ex) {
                System.Console.Write(ex.Message);
            }
        }
        static void Main(string[] args)
        {
            // If alias provided create and populate search filter object
            QueuesSearchFilters filters = null;

            if (String.IsNullOrEmpty(Alias) == false)
            {
                filters = new QueuesSearchFilters();
                filters.setAlias(Alias);
            }

            // Create FreeClimbClient object
            FreeClimbClient client = new FreeClimbClient(getFreeClimbAccountId(),
                                                         getFreeClimbApiKeys());

            // Invoke get method to retrieve initial list of queue information
            QueueList queueList = client.getQueuesRequester.get(filters);

            Console.Write($"Number of queues: {queueList.getTotalSize} \n");
            // Check if list is empty by checking total size of the list
            if (queueList.getTotalSize > 0)
            {
                // retrieve all queue information from server
                while (queueList.getLocalSize < queueList.getTotalSize)
                {
                    queueList.loadNextPage();
                }

                // Convert current pages queue information to a linked list
                LinkedList <IFreeClimbCommon> commonList = queueList.export();
                // Loop through linked list to process queue information
                foreach (IFreeClimbCommon element in commonList)
                {
                    // Cast each element to the Queue element for processing
                    Queue queue = element as Queue;

                    // Process queue element
                }
            }
        }