Ejemplo n.º 1
0
        private async Task JoinCallAndSetChatThreadId()
        {
            try
            {
                token_credential = new Azure.WinRT.Communication.CommunicationTokenCredential(user_token_);
                CallAgentOptions call_agent_options = new CallAgentOptions();
                call_agent = await call_client.CreateCallAgent(token_credential, call_agent_options);
            }
            catch
            {
                _ = await new MessageDialog("It was not possible to create call agent. Please check if token is valid.").ShowAsync();
                return;
            }

            //  Join a Teams meeting
            try
            {
                JoinCallOptions         joinCallOptions         = new();
                TeamsMeetingLinkLocator teamsMeetingLinkLocator = new(TxtTeamsLinkTextBox.Text);
                call_ = await call_agent.JoinAsync(teamsMeetingLinkLocator, joinCallOptions);
            }
            catch
            {
                _ = await new MessageDialog("It was not possible to join the Teams meeting. Please check if Teams Link is valid.").ShowAsync();
                return;
            }

            //  set thread Id
            thread_Id_ = ExtractThreadIdFromTeamsLink();

            //  Set up call callbacks
            call_.OnStateChanged += Call_OnStateChangedAsync;
        }
Ejemplo n.º 2
0
        public async Task <bool> Init(string token)
        {
            var credentials = new CommunicationTokenCredential(token);

            _callClient = new CallClient();
            var callOptions = new CallAgentOptions();

            _callAgent     = Com.Laerdal.Azurecommunicationhelper.CallClientHelper.GetCallAgent(_callClient, Application.Context, credentials);
            _deviceManager = Com.Laerdal.Azurecommunicationhelper.CallClientHelper.GetDeviceManager(_callClient, Application.Context);
            return(true);
        }
        public async Task <bool> Init(string token)
        {
            var credentials = new CommunicationTokenCredential(token);

            _callClient = new CallClient();
            _callAgent  = (CallAgent)await _callClient.CreateCallAgent(Application.Context, credentials).GetAsync();

            _deviceManager = (DeviceManager)await _callClient.DeviceManager.GetAsync();

            return(true);
        }
Ejemplo n.º 4
0
        static void Main()
        {
            var    analogPhone = new AnalogPhone();
            IPhone phone       = new AnalogPhoneAdapter(analogPhone);
            var    agent       = new CallAgent(phone);

            agent.CallNumber("0800123456");

            phone = new DigitalPhone();
            agent = new CallAgent(phone);
            agent.CallNumber("0800123456");

            Console.Read();
        }