/// <summary> /// matchMakerStateChanged is the event handler that takes care of detecting when the matchmaker /// gets removed from the data base. When this happens, there is no other option but to shutdown the /// platform /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void matchMakerStateChanged(object sender, LocalEndpointStateChangedEventArgs args) { AcdPlatform platform = _matchMaker._platform; AcdLogger logger = _matchMaker._logger; if (args.Reason == LocalEndpointStateTransitionReason.OwnerDisabledOrRemoved) { if (null != platform) { platform.BeginShutdown(ar => { platform.EndShutdown(ar); }, null); if (null != logger) { logger.Log("AcdAgentMatchMaker: Contact has been moved or removed, shutting down the application."); } } else { if (null != logger) { _matchMaker._logger.Log("AcdAgentMatchMaker: Contact has been moved or removed, but the platform is null. Cannot shut down the application."); } } } }
internal AcdAgentHunter(AcdPortal portal, AcdAgentMatchMaker matchMaker, AcdLogger logger) { _portal = portal; _matchMaker = matchMaker; _logger = logger; _averageQueueTime = new AcdAverageQueueTime(portal); }
internal AcdConferenceServicesAnchor(string conferenceUri, ApplicationEndpoint endpoint, AcdLogger logger) { _endpoint = endpoint; _logger = logger; _conferenceUri = conferenceUri; _state = ConferenceServicesAnchorState.Idle; _conversation = new Conversation(endpoint); _conversation.Impersonate("sip:" + Guid.NewGuid() + "@" + endpoint.DefaultDomain, null, null); _conversation.ApplicationContext = this; }
internal AcdMusicOnHoldServer(AcdAgentMatchMaker matchMaker, string mohFilePath, AcdLogger logger) { _matchMaker = matchMaker; _mohFilePath = mohFilePath; _logger = logger; _mohFileSource = new WmaFileSource(mohFilePath); _mohPlayer = new Player(); _mohPlayer.SetMode(PlayerMode.Manual); _mohPlayer.SetSource(_mohFileSource); this.UpdateState(MusicOnHoldServerState.Created); }
/// <summary> /// AcdAgentMatchMaker constructs the Automatic Call Distributor match maker /// </summary> internal AcdAgentMatchMaker(AcdPlatform platform, AcdAgentMatchMakerConfiguration configuration, ApplicationEndpointSettings endpointSettings, AcdLogger logger) { _platform = platform; _configuration = configuration; _logger = logger; _matchMakerState = MatchMakerState.Created; _pendingAgentRequestQueueItems = new List <PendingAgentMatchRequestQueueItem>(); endpointSettings.AutomaticPresencePublicationEnabled = true; endpointSettings.Presence.RemotePresenceSubscriptionCategories.Clear(); endpointSettings.Presence.RemotePresenceSubscriptionCategories.Add("state"); //Create the endpoint that will be used by the Agent match maker. _endpoint = new ApplicationEndpoint(platform.CollaborationPlatform, endpointSettings); }
public AcdPortal(AcdPlatform platform, AcdPortalConfiguration config, ApplicationEndpointSettings endpointSettings) { _acdPlatform = platform; _configuration = config; _uri = config.Uri; _sessions = new List <AcdCustomerSession>(); _logger = new AcdLogger(); endpointSettings.AutomaticPresencePublicationEnabled = true; endpointSettings.Presence.PreferredServiceCapabilities = null; endpointSettings.UseRegistration = true; endpointSettings.SupportedMimePartContentTypes = new List <ContentType>() { new ContentType("application/octet-stream") }; _endpoint = new ApplicationEndpoint(this.Platform.CollaborationPlatform, endpointSettings); _endpoint.InnerEndpoint.AddSipExtension("picav"); this.UpdatePortalState(PortalState.Created); }
internal AcdSupervisorSession(AcdAgentMatchMaker matchMaker, Supervisor supervisor, AcdLogger logger) { _matchMaker = matchMaker; _supervisor = supervisor; _logger = logger; }
internal Agent(AcdLogger logger) { _logger = logger; this.IsOnline = false; }