2012-04-30 58 views
0

我們有一個基於UCMA 3.0的應用程序/機器人,可將最終用戶與專家匹配。它將來自最終用戶的傳入一對一聊天請求遷移到多用戶會議中,然後邀請專家參加最終的多用戶會議。應用程序本身仍然是會議的參與者。在任何時候,可能會有幾個這樣的會議由我們的應用程序斡旋,但每個最終用戶只有一個。但是,一位專家可能同時參加多個會議。 在我們的應用程序日誌中,我們偶爾會看到以下異常。UCMA 3.0 API會議錯誤:在收到會議邀請或會議升級請求後無法加入不同的會議

會議遷移conf錯誤#63809878,地址:sip:[email protected]; gruu; opaque = app:conf:focus:id:TQRREACE System.InvalidOperationException:收到會議邀請後無法加入其他會議或會議升級請求。 在Microsoft.Rtc.Collaboration.ConferenceSession.VerifyAndGetConferenceAddress(字符串conferenceUri,字符串parameterName)以 在Microsoft.Rtc.Collaboration.ConferenceSession.BeginJoinCommon(字符串conferenceUri,ConferenceJoinOptions選項的AsyncCallback userCallback,對象狀態) 在Microsoft.Rtc.Collaboration。 ConferenceSession.BeginJoin(字符串conferenceUri,ConferenceJoinOptions選項,AsyncCallback的userCallback,對象狀態) 在(字符串A_0,A_1字符串,字符串A_2,A_3布爾,布爾A_4)

Below is the code snippet used to make conference. Previously this site was an OCS 2007 R2 Installation and was migrated to Lync 2010 Server. 
Site is running in mixed mode. It occurs only on production server and we are not able to generate this exception on dev server, we 
have tested it after generating more than 15 conferences simultaniously but no luck. 

私人無效CreateAdHohConf(字符串user1Uri,串user2uri,string subject) { 離子異常=空;

  // Create conference scheduling details for the conference. 
      ConferenceScheduleInformation scheduleInfo = new ConferenceScheduleInformation(); 

      // Restrict the conference to invited users only. 
      scheduleInfo.AccessLevel = ConferenceAccessLevel.Everyone; 


      // Set a subject for the conference. 
      scheduleInfo.Subject = subject; 
      scheduleInfo.Description = subject; 
      scheduleInfo.ConferenceId = ConferenceServices.GenerateConferenceId(); 
      scheduleInfo.ExpiryTime = System.DateTime.Now.AddHours(8); 
      scheduleInfo.IsPasscodeOptional = true; 
      scheduleInfo.PhoneAccessEnabled = false; 

      // Don't automatically assign a leader. 
      scheduleInfo.AutomaticLeaderAssignment = AutomaticLeaderAssignment.Everyone; 

      // Add the caller and recipient as participants. 
      scheduleInfo.Participants.Add(new ConferenceParticipantInformation("sip:" + user1Uri, ConferencingRole.Leader)); 
      scheduleInfo.Participants.Add(new ConferenceParticipantInformation("sip:" + user2uri, ConferencingRole.Leader)); 

      scheduleInfo.Mcus.Add(new ConferenceMcuInformation(McuType.ApplicationSharing)); 
      scheduleInfo.Mcus.Add(new ConferenceMcuInformation(McuType.InstantMessaging)); 
      scheduleInfo.Mcus.Add(new ConferenceMcuInformation(McuType.AudioVideo)); 
      scheduleInfo.Mcus.Add(new ConferenceMcuInformation(McuType.Meeting)); 

      //Scheduling conference 

      ConferenceServices objLocalConfSvc = lyncAgent.LocalEndpoint.ConferenceServices; 
      Conference confSession = null; 
      objLocalConfSvc.BeginScheduleConference(scheduleInfo, 
       result => 
       { 
        try 
        { 
         confSession = objLocalConfSvc.EndScheduleConference(result); 

        } 
        catch (RealTimeException rtex) 
        { 
         exception = rtex; 

        } 
        catch (Exception ex) 
        { 
         exception = ex; 

        } 
        finally 
        { 
         _waitForConferenceScheduling.Set(); 
        } 
       }, objLocalConfSvc); 

      _waitForConferenceScheduling.WaitOne(); 


      //Begin Join conference 
      ConferenceSession objLocalConfSession=this.call.Conversation.ConferenceSession; 
      try 
      { 
       ConferenceJoinOptions joinOptions = new ConferenceJoinOptions() { CanManageLobby = false, JoinMode = JoinMode.Default }; 
       objLocalConfSession.BeginJoin(new RealTimeAddress(confSession.ConferenceUri).Uri, joinOptions, 
        result => { 
         try 
         { 
          objLocalConfSession.EndJoin(result); 
         } 
         catch (Exception ex) 
         { 
          exception = ex; 

         } 
         finally 
         { 
          //Again, for sync. reasons. 
          _waitForConferenceJoin.Set(); 
         } 
        } 
       , this.call.Conversation.ConferenceSession); 
       // Wait until join completes.new RealTimeAddress(this._conference.ConferenceUri).Uri, 
       _waitForConferenceJoin.WaitOne(); 
      } 
      catch (InvalidOperationException ioex) 
      { 
       exception = ioex; 

      } 
      catch (Exception ex) 
      { 
       exception = ex; 

      } 

      //Begin Escalation 
      Conversation objLocalConv= this.call.Conversation; 
      try 
      { 
       objLocalConv.BeginEscalateToConference(
        result => 
        { 
         try 
         { 
          objLocalConv.EndEscalateToConference(result); 
         } 
         catch (Exception ex) 
         { 
          exception = ex; 

         } 
         finally 
         { 
          //Sync It 
          _waitForEscalation.Set(); 
         } 
        } 
         , objLocalConv); 
       // Wait until escalation completes. 
       _waitForEscalation.WaitOne(); 
      } 
      catch (InvalidOperationException ioex) 
      { 
       exception = ioex; 
      } 
      catch (Exception ex) 
      { 
       exception = ex; 
      } 
      finally 
      { 
       if (exception != null) 
       { 
        lyncAgent.Logger.Error("Error in Conference Migration conf call # " + GetHashCode() + " , Address :" + confSession.ConferenceUri , exception); 
       } 
      } 
     } 

請建議優先考慮什麼是可能的問題。

 Thanks in advance. 

回答

0

此方法是否駐留在可能由多個源同時調用的對象中?

如果是這樣,使用看起來像_waitForConferenceScheduling這樣的類級變量可能會有問題。線程A最終可能會在線程B的異步操作實際完成之前意外地讓線程B繼續。因此線程B可以在調用.BeginEscalate之前調用.EndJoin。

當我編寫UCMA代碼時,我通常使用嵌套回調來防止發生這種類型的事情。

除此之外,我建議您在應用程序服務器和Lync前端服務器上運行OCSLogger以收集SIPStack,S3和協作日誌。詳細查看實際的SIP消息將提供一些線索。

你會尋找會議的邀請和回覆該邀請的響應。

+0

我們已經測試的代碼,而無需等待處理,並使用回撥類似的方法:lyncAgent.LocalEndpoint.ConferenceServices.BeginScheduleConference(scheduleInfo,OnConferenceScheduleCompleted,lyncAgent.LocalEndpoint.ConferenceServices);但我們仍然得到同樣的錯誤。 – Krishna

0

我們設法檢測到原因。如果參與者列表中的任何人已添加了與我們的端點進行會話的會議的任何聯繫人,就會發生這種情況。