Ejemplo n.º 1
0
 public static Task UnmuteAsync(this AudioVideoMcuSession mcuSession,
                                ParticipantEndpoint endpoint)
 {
     return(Task.Factory.FromAsync(mcuSession.BeginUnmute,
                                   mcuSession.EndUnmute, endpoint,
                                   null));
 }
Ejemplo n.º 2
0
 public static Task MuteAsync(this AudioVideoMcuSession mcuSession,
                              ParticipantEndpoint endpoint, MuteOptions options)
 {
     return(Task.Factory.FromAsync(mcuSession.BeginMute,
                                   mcuSession.EndMute, endpoint, options,
                                   null));
 }
 public static Task MuteAsync(this AudioVideoMcuSession mcuSession,
     ParticipantEndpoint endpoint, MuteOptions options)
 {
     return Task.Factory.FromAsync(mcuSession.BeginMute,
         mcuSession.EndMute, endpoint, options,
         null);
 }
Ejemplo n.º 4
0
        private void EstablishAvCallAndAudioRouteForNewAttendee(ParticipantEndpoint newAttendeeParticipantEndpoint)
        {
            AudioVideoCall newAttendeeCall = new AudioVideoCall(_trustedParticipantConversation);

            // Save the new Attendee Participant Endpoint in the Application
            // Context.
            newAttendeeCall.ApplicationContext = newAttendeeParticipantEndpoint;

            AudioVideoCallEstablishOptions avCallEstablishOptions = new AudioVideoCallEstablishOptions();

            // Remove the call from the default Mcu route because we will be
            // specifying custom routes after the call is established.
            avCallEstablishOptions.AudioVideoMcuDialInOptions.RemoveFromDefaultRouting = true;

            // When the Flow is active, add the tone handler
            newAttendeeCall.AudioVideoFlowConfigurationRequested += new EventHandler <
                AudioVideoFlowConfigurationRequestedEventArgs>(
                NewAttendeeCall_AudioVideoFlowConfigurationRequested);

            newAttendeeCall.BeginEstablish(avCallEstablishOptions, NewAttendeeCallEstablishCompleted,
                                           newAttendeeCall);

            // Add the call to the collection so it can be retrieved later.
            _trustedParticipantCalls.Add(newAttendeeParticipantEndpoint.Uri, newAttendeeCall);
        }
Ejemplo n.º 5
0
 public static Task AddToDefaultRoutingAsync(this
                                             AudioVideoMcuSession mcuSession, ParticipantEndpoint endpoint,
                                             AddToDefaultRoutingOptions options)
 {
     return(Task.Factory.FromAsync(
                mcuSession.BeginAddToDefaultRouting,
                mcuSession.EndAddToDefaultRouting,
                endpoint, options, null));
 }
 public static Task AddToDefaultRoutingAsync(this 
     AudioVideoMcuSession mcuSession, ParticipantEndpoint endpoint,
     AddToDefaultRoutingOptions options)
 {
     return Task.Factory.FromAsync(
         mcuSession.BeginAddToDefaultRouting,
         mcuSession.EndAddToDefaultRouting,
         endpoint, options, null);
 }
Ejemplo n.º 7
0
 internal void OnRemoteParticipantAdded(ParticipantEndpoint localEndpoint, ParticipantEndpoint clientEndpoint)
 {
     if (_localEndpoint == null)
     {
         _localEndpoint = localEndpoint;
     }
     if (_remoteEndpoint == null)
     {
         _remoteEndpoint = clientEndpoint;
         //InitConversationContext();
     }
 }
Ejemplo n.º 8
0
        void EstablishControlCall()
        {
            AudioVideoCallEstablishOptions ceo = new AudioVideoCallEstablishOptions()
            {
                UseGeneratedIdentityForTrustedConference = true
            };

            _controlAVCall = new AudioVideoCall(_location.Conversation);

            _controlAVCall.AudioVideoFlowConfigurationRequested += new EventHandler <AudioVideoFlowConfigurationRequestedEventArgs>(_controlAVCall_AudioVideoFlowConfigurationRequested);
            _controlAVCall.BeginEstablish(ceo,
                                          ar =>
            {
                try
                {
                    _controlAVCall.EndEstablish(ar);

                    List <IncomingAudioRoute> routesin  = new List <IncomingAudioRoute>();
                    List <OutgoingAudioRoute> routesout = new List <OutgoingAudioRoute>();

                    ParticipantEndpoint localEndpoint  = GetLocalParticipant().GetEndpoints()[0];
                    ParticipantEndpoint remoteEndpoint = _controlAVCall.RemoteEndpoint;

                    routesin.Add(new IncomingAudioRoute(localEndpoint));
                    routesin.Add(new IncomingAudioRoute(remoteEndpoint));

                    routesout.Add(new OutgoingAudioRoute(localEndpoint));
                    routesout.Add(new OutgoingAudioRoute(remoteEndpoint));

                    _controlAVCall.AudioVideoMcuRouting.BeginUpdateAudioRoutes(routesout, routesin,
                                                                               ar2 =>
                    {
                        try
                        {
                            _controlAVCall.AudioVideoMcuRouting.EndUpdateAudioRoutes(ar2);
                        }
                        catch (Exception ex)
                        {
                            Log(ex.ToString());
                        }
                    },
                                                                               null);
                }
                catch (Exception ex)
                {
                    Log(ex.ToString());
                }
            },
                                          null);
        }
Ejemplo n.º 9
0
 public AgentContextChannel(Conversation conversation, ParticipantEndpoint remoteEndpoint)
 {
     m_innerChannel = new ConversationContextChannel(conversation, remoteEndpoint);
 }
Ejemplo n.º 10
0
 protected override void HandleParticipantEndpointPropertiesChanged(ParticipantEndpoint endpoint, Microsoft.Rtc.Internal.Collaboration.PropertyMergeInformation <McuParticipantEndpointProperties> pmi)
 {
     return;
 }
 internal void OnRemoteParticipantAdded(ParticipantEndpoint localEndpoint, ParticipantEndpoint clientEndpoint)
 {
     if (_localEndpoint == null)
     {
         _localEndpoint = localEndpoint;
     }
     if (_remoteEndpoint == null)
     {
         _remoteEndpoint = clientEndpoint;
         //InitConversationContext();
     }
 }
 public static Task UnmuteAsync(this AudioVideoMcuSession mcuSession,
     ParticipantEndpoint endpoint)
 {
     return Task.Factory.FromAsync(mcuSession.BeginUnmute,
         mcuSession.EndUnmute, endpoint,
         null);
 }
Ejemplo n.º 13
0
 public SupervisorContextChannel(Conversation conversation, ParticipantEndpoint remoteEndpoint);
Ejemplo n.º 14
0
 public AgentContextChannel(Conversation conversation, ParticipantEndpoint remoteEndpoint);
Ejemplo n.º 15
0
        static async System.Threading.Tasks.Task Main(string[] args)
        {
            Console.WriteLine(".NET Core Graph Tutorial\n");

            var appConfig = LoadAppSettings();

            if (appConfig == null)
            {
                Console.WriteLine("Missing or invalid appsettings.json...exiting");
                return;
            }

            var appId        = appConfig["appId"];
            var tenantId     = appConfig["tenantId"];
            var clientSecret = appConfig["clientSecret"];

            // Initialize the auth provider with values from appsettings.json
            IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder
                                                                           .Create(appId)
                                                                           .WithTenantId(tenantId)
                                                                           .WithClientSecret(clientSecret)
                                                                           .Build();


            //Install-Package Microsoft.Graph.Auth -PreRelease
            ClientCredentialProvider authProvider = new ClientCredentialProvider(confidentialClientApplication);

            // Initialize Graph client
            GraphHelper.Initialize(authProvider);

            int choice = -1;

            while (choice != 0)
            {
                Console.WriteLine("Please choose one of the following options:");
                Console.WriteLine("0. Exit");
                Console.WriteLine("1. Get meeting's members");
                Console.WriteLine("2. Get call's attendance");

                try
                {
                    choice = int.Parse(Console.ReadLine());
                }
                catch (System.FormatException)
                {
                    // Set to invalid value
                    choice = -1;
                }

                switch (choice)
                {
                case 0:
                    // Exit the program
                    Console.WriteLine("Goodbye...");
                    break;

                case 1:
                    Console.WriteLine("Please input the meetingId");
                    string meetingId = Console.ReadLine();
                    var    members   = await GraphHelper.GetTeamMembers(meetingId);

                    foreach (User member in members.ToList())
                    {
                        Console.WriteLine("Found member: " + member.DisplayName);
                    }
                    //var meeting = await GraphHelper.GetMeeting("https://teams.microsoft.com/l/meetup-join/19%3ameeting_NTg3ZGQ5YjYtNjI1Ny00ZTQ4LTg0ZWMtMmI4ZjZkYjJkNGRj%40thread.v2/0?context=%7b%22Tid%22%3a%221aed5afa-c363-478e-ae14-b73b6949addb%22%2c%22Oid%22%3a%228b406a47-ed00-45cb-ad12-cd01d6143bbb%22%7d");
                    break;

                case 2:
                    Console.WriteLine("Please input the callId");
                    string callId = Console.ReadLine();
                    //var callRecord = await GraphHelper.GetCallRecord(callId != "" ? callId : "f4ea5721-a7b5-44ee-8ceb-9dfa7a6dd41e");
                    var callRecord = await GraphHelper.GetCallRecordSessions(callId != ""?callId : "f4ea5721-a7b5-44ee-8ceb-9dfa7a6dd41e");

                    var joinWebUrl = callRecord.JoinWebUrl;
                    if (joinWebUrl == null)
                    {
                        break;
                    }
                    foreach (Session session in callRecord.Sessions)
                    {
                        ParticipantEndpoint caller = (ParticipantEndpoint)session.Caller;
                        var user = await GraphHelper.GetUserAsync(caller.Identity.User.Id);

                        //TODO - Find the mapping between this userId and the university's student ID.
                        StudentEvent studentEvent = new StudentEvent
                        {
                            //TODO - Find course ID based on joinWebUrl.
                            CourseID     = "COMP0088", // Course ID Upper case.
                            Timestamp    = ((DateTimeOffset)session.StartDateTime).UtcDateTime,
                            EventType    = EventType.Attendance,
                            ActivityType = "Meeting",
                            ActivityName = "Weekly Lecture",
                            Student      = new Student
                            {
                                Email     = user.Mail,
                                FirstName = user.GivenName,
                                LastName  = user.Surname,
                                ID        = user.Id
                            }
                        };
                        Console.WriteLine(studentEvent.ToString());
                        //_eventAggregator.ProcessEvent(studentEvent);
                    }
                    break;

                default:
                    Console.WriteLine("Invalid choice! Please try again.");
                    break;
                }
            }
        }