Exemplo n.º 1
0
        public void InitClient()
        {
            IUccPlatform platform = new UccPlatform();

            platform.Initialize(this.AppName, null);

            IUccUriManager _uriManager = new UccUriManager();
            UccUri         uri         = _uriManager.ParseUri(this._sip);

            //Create an endpoint object from the platform object
            _mainEndpoint = platform.CreateEndpoint(UCC_ENDPOINT_TYPE.UCCET_PRINCIPAL_SERVER_BASED, uri, null, null);
            IUccServerSignalingSettings serverSignalingSettings = (IUccServerSignalingSettings)_mainEndpoint;

            serverSignalingSettings.Server = serverSignalingSettings.CreateSignalingServer(this._serverAddress, this.TransportMode); //ac.rockfin.com:443 //qlocsfepool.mi.corp.rockfin.com
            serverSignalingSettings.AllowedAuthenticationModes = (int)this.AuthMode;

            UccCredential credential = serverSignalingSettings.CredentialCache.CreateCredential(this._userName, this._password, this._domain);

            serverSignalingSettings.CredentialCache.SetCredential("*", credential);

            //Advise for events
            Advise <_IUccEndpointEvents>(
                this._mainEndpoint,
                this);

            this._mainEndpoint.Enable();



            while (this._sessionManager == null)
            {
                System.Threading.Thread.Sleep(1000);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create Endpoint and associate to related events
        /// </summary>
        public void CreateEndpoint()
        {
            // Create endpoint
            UccUriManager uriManager = new UccUriManager();

            this.endpoint = this.platform.CreateEndpoint(UCC_ENDPOINT_TYPE.UCCET_PRINCIPAL_SERVER_BASED, uriManager.ParseUri(uri), null, null);

            // Configure the endpoint
            IUccServerSignalingSettings settings = (IUccServerSignalingSettings)this.endpoint;

            // Add the credentials -- note: "*" means any realm
            UccCredential credential = settings.CredentialCache.CreateCredential(signName, password, domain);

            settings.CredentialCache.SetCredential("*", credential);

            // Set the server to use
            settings.Server = settings.CreateSignalingServer(serverName, (transport == "TCP")? UCC_TRANSPORT_MODE.UCCTM_TCP:UCC_TRANSPORT_MODE.UCCTM_TLS);


            // Set the allowed authentication modes
            settings.AllowedAuthenticationModes = (int)UCC_AUTHENTICATION_MODES.UCCAM_DIGEST;

            // Register this client to receive event
            // notifications when the login session changes.
            Advise <_IUccEndpointEvents>(this.endpoint, this);
            Advise <_IUccSessionManagerEvents>(this.endpoint, this);
        }
Exemplo n.º 3
0
        private void InitializeEndpoint(EndpointConfiguration configuration, AuthenticationMode authMode)
        {
            this.CleanupEndpoint();


            // set vars
            if (Helpers.TryParseUri(Helpers.CorrectUri(configuration.Uri), out this.uri) == false)
            {
                throw new Exception("Sign-in address is not valid Uri");
            }
            this.selfPresentity.SetUri(this.uri.Value);
            this.selfPresentityMonitor.SetUri(this.uri);
            this.disableImSessions = configuration.DisableImSessions;

            // platform events
            ComEvents.Advise <_IUccPlatformEvents>(this.platform, this);


            // create endpoint
            this.endpoint = this.platform.CreateEndpoint(UCC_ENDPOINT_TYPE.UCCET_PRINCIPAL_SERVER_BASED, this.uri, configuration.EndpoindIdString, null);
            ComEvents.Advise <_IUccEndpointEvents>(this.endpoint, this);
            ComEvents.Advise <_IUccSessionManagerEvents>(this.endpoint, this);



            // server signaling settings
            this.signalingSettings = (IUccServerSignalingSettings)this.endpoint;
            ComEvents.Advise <_IUccServerSignalingSettingsEvents>(this.signalingSettings, this);

            this.signalingSettings.AllowedAuthenticationModes = (int)authMode.ToUccAuthenticationMode();

            UccCredential credential = authMode.IsDefaultCreditals() ?
                                       this.signalingSettings.CredentialCache.DefaultCredential :
                                       this.signalingSettings.CredentialCache.CreateCredential(configuration.Username, configuration.Password, null);

            this.signalingSettings.CredentialCache.SetCredential(configuration.Realm, credential);


            // media endpoint settings
            this.mediaEndpointSettings = (IUccMediaEndpointSettings)this.endpoint;
            ComEvents.Advise <_IUccMediaEndpointEvents>(this.endpoint, this);


            // create session manager
            this.sessionManager = (IUccSessionManager)this.endpoint;
            ComEvents.Advise <_IUccSessionManagerEvents>(this.sessionManager, this);

            // create user search manager
            this.userSearchManager = (IUccUserSearchManager)this.endpoint;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Create Endpoint and associate to related events
        /// </summary>
        public void CreateEndpoint()
        {
            // Create endpoint
            UccUriManager uriManager = new UccUriManager();

            this.endpoint = this.platform.CreateEndpoint(UCC_ENDPOINT_TYPE.UCCET_PRINCIPAL_SERVER_BASED, uriManager.ParseUri(uri), null, null);

            // Configure the endpoint
            IUccServerSignalingSettings settings = (IUccServerSignalingSettings)this.endpoint;

            // Add the credentials -- note: "*" means any realm
            UccCredential credential = settings.CredentialCache.CreateCredential(signName, password, domain);

            settings.CredentialCache.SetCredential("*", credential);

            // Set the server to use
            //settings.Server = settings.CreateSignalingServer(serverName, (transport == "TCP") ? UCC_TRANSPORT_MODE.UCCTM_TCP : UCC_TRANSPORT_MODE.UCCTM_TLS);
            settings.Server = settings.CreateSignalingServer(serverName, UCC_TRANSPORT_MODE.UCCTM_TCP);

            //settings.


            // Set the allowed authentication modes
            //settings.AllowedAuthenticationModes = (int)UCC_AUTHENTICATION_MODES.UCCAM_KERBEROS
            //                                        | (int)UCC_AUTHENTICATION_MODES.UCCAM_NTLM;
            settings.AllowedAuthenticationModes = (int)UCC_AUTHENTICATION_MODES.UCCAM_DIGEST;
            // Register this client to receive event
            // notifications when the login session changes.
            Advise <_IUccEndpointEvents>(this.endpoint, this);
            //Advise<_IUcc>(this.endpoint, this);
            Advise <_IUccSessionManagerEvents>(this.endpoint, this);
            //Advise<IUccIncomingRequestEvent>(this.endpoint, this);

            //IUccSessionManager manager = (IUccSessionManager)this.endpoint;
            //manager.RegisterSessionDescriptionEvaluator(this);
            string proxyEndpointTelId  = "tel:1234;phone-context=AB32-cdp.AB32-udp";
            string proxyEndpointSipURI = "sip:[email protected]";

            //proxyendpoint = this.platform.CreateProxyEndpoint(UCC_ENDPOINT_TYPE.UCCET_PROXY_TELEPHONY, endpoint, uriManager.ParseUri(uri), proxyEndpointTelId, null);
            // notifications when the login session changes.
            //Advise<_IUccEndpointEvents>(this.proxyendpoint, this);
            //Advise<_IUcc>(this.endpoint, this);
            //Advise<_IUccSessionManagerEvents>(this.proxyendpoint, this);
        }
Exemplo n.º 5
0
        public void CleanupEndpoint()
        {
            foreach (var invite in this.AvInvites)
            {
                invite.Decline();
            }

            foreach (Session session in this.Sessions)
            {
                session.UccSession = null;
            }

            this.IsDisabled = true;
            this.SelfPresentity.SetAvailability(AvailabilityValues.Unknown);

            ComEvents.UnadviseAll(this);

            this.selfPresentityMonitor.DestroyUccPresentity();
            if (this.selfSubscription != null && this.selfSubscription.Presentities.Count > 0)
            {
                this.selfSubscription.Unsubscribe(null);
            }
            this.selfSubscription = null;

            foreach (Presentity presentity in this.Presentities)
            {
                presentity.DestroyUccPresentity();
            }
            if (this.subscription != null && this.subscription.Presentities.Count > 0)
            {
                this.subscription.Unsubscribe(null);
            }
            this.subscription = null;

            this.signalingSettings     = null;
            this.mediaEndpointSettings = null;
            this.userSearchManager     = null;

            this.endpoint = null;
        }