2012-10-16 3 views
0

PresenceView는 수동으로 프로비저닝 된 응용 프로그램 끝점을 사용하여 만들어집니다. 나는 그것을 "구독"이라고하는 세 가지 목표로 제공했습니다. 하지만 첫 번째 알림 만받습니다. 그 후에는 아무 일도 일어나지 않습니다. 폴링의 경우도 마찬가지입니다. NotificationRecieved 이벤트는 첫 번째 알림 후에 실행되지 않습니다. Lync 이벤트 로그에 오류가 표시되지 않고 어떤 예외도 발생하지 않습니다.RemotePresenceView가 하나의 알림 만 수신하면 아무 일도 일어나지 않습니다.

내 설정은 응용 프로그램 풀 역할을하는 DC, Lync Server 및 Developer 컴퓨터가있는 가상 환경입니다. 모든 것이 괜찮아 보입니다.

다음은 내 코드 샘플입니다. 내 솔루션은 두 개의 프로젝트로 구성됩니다. 작은 콘솔 응용 프로그램과 lync 코드가있는 프로젝트입니다. UCMA 코드 샘플의 SubscribePresenceView 샘플 솔루션을 기반으로합니다.이 솔루션은 대신 사용자 끝점을 사용하지만 현재 상태를 올바르게 업데이트합니다.

 public void Run() 
    { 
     _helper = new Helper(new ConsoleLogger()); 
     _applicationEndpoint = _helper.CreateApplicationEndpoint(); 


     var viewSettings = new RemotePresenceViewSettings(); 
     viewSettings.SubscriptionMode = RemotePresenceViewSubscriptionMode.Default; 
     _presenceView = new RemotePresenceView(_applicationEndpoint, viewSettings); 

     List<RemotePresentitySubscriptionTarget> targets = new List<RemotePresentitySubscriptionTarget>(); 
     targets.Add(new RemotePresentitySubscriptionTarget("sip:[email protected]")); 
     targets.Add(new RemotePresentitySubscriptionTarget("sip:[email protected]")); 
     targets.Add(new RemotePresentitySubscriptionTarget("sip:[email protected]")); 

     this.WireUpHandlersForView(_presenceView); 

     _presenceView.StartSubscribingToPresentities(targets); 
    } 

핸들 알림 위임 방법 :

private void RemotePresenceView_NotificationReceived(object sender, RemotePresentitiesNotificationEventArgs e) 
    { 
     // A RemotePresentityNotification will contain all the 
     // categories for one user; Notifications can contain notifications 
     // for multiple users. 

     foreach (RemotePresentityNotification notification in e.Notifications) 
     { 
      Console.WriteLine("\nReceived a Notification for user "+ notification.PresentityUri + "."); 

      // If a category on notification is null, the category 
      // was not present in the notification. This means there were no 
      // changes in that category. 



      if (notification.AggregatedPresenceState != null) 
      { 
       Console.WriteLine("Aggregate State = " + notification.AggregatedPresenceState.Availability + "."); 
      } 

      if (notification.PersonalNote != null) 
      { 
       Console.WriteLine("PersonalNote: " + notification.PersonalNote.Message + "."); 
      } 

      if (notification.ContactCard != null) 
      { 
       // A ContactCard contains many properties; only display 
       // some. 
       ContactCard contactCard = notification.ContactCard; 
       Console.WriteLine("ContactCard Company: " + contactCard.Company + "."); 
       Console.WriteLine("ContactCard DisplayName: " + contactCard.DisplayName + "."); 
       Console.WriteLine("ContactCard EmailAddress: " + contactCard.EmailAddress + "."); 
      }   
     } 
    } 

더 많은 정보가 필요하면 알려 주시기 바랍니다.

+0

안녕하세요, 스택 오버플로에 오신 것을 환영합니다! 약간의 질문을 다시 시도해보십시오. 기본적으로, 여기서 문제가되지 않습니다. –

+0

내 질문에 : 프레즌스 상태가 업데이트되지 않는 이유는 무엇입니까? – mupersan82

+0

문제점 문을 다시 작성했습니다. 도움이되기를 바랍니다. – mupersan82

답변

1

해결 방법을 찾지 못했지만 대신에 UserEndPoint를 대신 사용했습니다. 제대로 작동합니다.

0

나는 아주 오래된 것을 지금도 깨닫고 있지만, 나는 정확히 똑같은 문제를 최근에 가지고 있었기 때문에 대답 할만한 가치가있을 것입니다.

이유는, 내 경우 서버가 응용 프로그램 끝점으로 연결을 다시 설정할 수 없었기 때문입니다. 여기서 코드에 문제가있는 것을 볼 수 없으므로 두 시스템 간의 방화벽 또는 라우팅 문제 일 가능성이 큽니다.

응용 프로그램 끝점을 설정할 때 포트를 정의하면 응용 프로그램 끝점 (이 경우 개발자 컴퓨터)을 호스팅하는 컴퓨터에서 해당 포트에 액세스 할 수 있어야합니다.

  • 응용 프로그램 끝점을 설정하면 서버에 대한 연결이 열립니다 (일반적으로 포트 5061이라고 생각합니다).
  • RemotePresenceView에 가입하면 해당 가입 요청이 해당 연결로 보내지고 서버는 동일한 연결의 모든 구독 된 프리젠 테이션 (바보 같은 단어)의 현재 상태에 대한 알림으로 응답합니다. 공고.
  • 모든 후속 알림의 경우 서버는 엔드 포인트에 대해 정의한 포트에서 응용 프로그램 엔드 포인트 호스트 시스템으로 다시 연결을 시도합니다. 이는 문제가있는 곳일 수 있습니다.

사용자 엔드 포인트의 경우 포트를 열지 않아도되므로 서버는 클라이언트의 서버 연결에 대한 알림 만 전송하므로 작동합니다.

관련 문제