Hi,
I'm using ApplicationEndpoint with trusted Certificate to know whether Lync user is in call or not. I tried with below event, but it never fired while Lync client is trying to place a call.
applicationEndpoint.RegisterForIncomingCall<AudioVideoCall>(On_Call_Received);
Anyone that can tell me what's going wrong?
Note: Application Endpoint is established successfully and the state change event "_remotePresenceView_SubscriptionStateChanged" which knows that all Lync user presence state.
For your reference,
void Main()
{
_applicationEndpoint = CreateApplicationEndpoint();
Console.WriteLine("Platform Started.....");
// RemotePresenceView is the class to be used to subscribe to
if (_remotePresenceView == null)
{
_remotePresenceView = new RemotePresenceView(_applicationEndpoint);
_remotePresenceView.PresenceNotificationReceived += new EventHandler<
RemotePresentitiesNotificationEventArgs>(RemotePresence_PresenceNotificationReceived);
_remotePresenceView.SubscriptionStateChanged += _remotePresenceView_SubscriptionStateChanged;
}
IEnumerable<RemotePresentitySubscriptionTarget> SIPs = new RemotePresentitySubscriptionTarget[]
{ new RemotePresentitySubscriptionTarget("sip:manigandan.m@domain.int"),
new RemotePresentitySubscriptionTarget("sip:manitemp.m@domain.int")
};
_remotePresenceView.StartSubscribingToPresentities(SIPs);
_applicationEndpoint.RegisterForIncomingCall<AudioVideoCall>(On_Call_Received);
}
void On_Call_Received(object sender, CallReceivedEventArgs<AudioVideoCall> e)
{
Console.WriteLine("Call Received! From: " + e.RemoteParticipant.Uri )
}
public ApplicationEndpoint CreateApplicationEndpoint()
{
try
{
// Reuse platform instance so that all endpoints share the same platform.
if (_serverCollabPlatform == null)
{
CreateAndStartServerPlatform();
}
// Initalize and register the endpoint.
// NOTE: the _applicationContactURI should always be of the form "sip:user@host"
ApplicationEndpointSettings appEndpointSettings = new ApplicationEndpointSettings(this.lyncCredentialInfo.ApplicationContactURI,
this.lyncCredentialInfo.ServerFQDN,
5061);
_applicationEndpoint = new ApplicationEndpoint(_serverCollabPlatform, appEndpointSettings);
_endpointInitCompletedEvent.Reset();
//"Establishing the endpoint...";
_applicationEndpoint.BeginEstablish(EndEndpointEstablish, _applicationEndpoint);
// Sync; wait for the registration to complete.
_endpointInitCompletedEvent.WaitOne();
//"Application Endpoint established..."
}
catch (Exception ex)
{
_applicationEndpoint = null;
throw;
}
return _applicationEndpoint;
}
Thanks in advance.
-Mani