/// <summary> /// Create and start AV session with remote Uri /// </summary> /// <param name="remoteUri"></param> public void StartAVSession(string avRemoteUri) { this.avRemoteUri = avRemoteUri; // Create AV session CreateSession(UCC_SESSION_TYPE.UCCST_AUDIO_VIDEO); // Create remote participant UccUriManager uriManager = new UccUriManager(); IUccSessionParticipant participant = this.avSession.CreateParticipant(uriManager.ParseUri(this.avRemoteUri), null); IUccAudioVideoSessionParticipant avParticipant = participant as IUccAudioVideoSessionParticipant; // Create audio channel IUccMediaChannel channel = avParticipant.CreateChannel(UCC_MEDIA_TYPES.UCCMT_AUDIO, null); channel.PreferredMedia = (int)(UCC_MEDIA_DIRECTIONS.UCCMD_RECEIVE | UCC_MEDIA_DIRECTIONS.UCCMD_SEND); // Add channel avParticipant.AddChannel(channel); UccOperationContext context = new UccOperationContextClass(); context.Initialize(operationId++, null); // Add remote participant this.avSession.AddParticipant(participant, context); }
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); } }
/// <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); }
/// <summary> /// Create and start IM session with remote Uri /// </summary> /// <param name="remoteUri"></param> public void StartIMSession(string imRemoteUri) { this.imRemoteUri = imRemoteUri; // Create IM session CreateSession(UCC_SESSION_TYPE.UCCST_INSTANT_MESSAGING); // Create remote participant UccUriManager uriManager = new UccUriManager(); IUccSessionParticipant participant = this.imSession.CreateParticipant(uriManager.ParseUri(this.imRemoteUri), null); UccOperationContext context = new UccOperationContextClass(); context.Initialize(operationId++, null); // Add remote participant this.imSession.AddParticipant(participant, context); }
/// <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); }