簡體   English   中英

使用Lync 2013 SDK的Skype for Business-AutomationModalitySettings.FirstInstantMessage不起作用

[英]Skype for Business Using Lync 2013 SDK- AutomationModalitySettings.FirstInstantMessage Not Working

我有以下代碼用於開始IM對話-

public void IMbtn_Click(object sender, RoutedEventArgs e)
        {

            var participants = new List<string>();
            participants.Add("blabla.com");

            if (_lyncAutomation != null)
            {

                var bridgeNames = _info.Bridges.Where(b => b.Selected && b.Enabled).Select(b => b.Name);
                var chatTitle = $"{_info.Title} {string.Join(", ", bridgeNames)}";
                string chat = "Welcome to test's chat!";

                AutomationModalities mode = AutomationModalities.InstantMessage; 
                var convoSettings = new Dictionary<AutomationModalitySettings, object>();
                convoSettings.Add(AutomationModalitySettings.Subject, chatTitle);
                convoSettings.Add(AutomationModalitySettings.FirstInstantMessage, chat);
                convoSettings.Add(AutomationModalitySettings.SendFirstInstantMessageImmediately, true);

                try
                {
                    _lyncAutomation.BeginStartConversation(mode, participants, convoSettings,
                                                      StartConversationCallback, null);

                }
                catch (LyncClientException lyncClientException)
                {
                    MessageBox.Show("Call failed.");
                    Logger.Log("Exception while creating Lync call: " + lyncClientException);
                }
                catch (SystemException systemException)
                {
                    if (IsLyncException(systemException))
                    {
                        MessageBox.Show("Call failed.");
                        Logger.Log("Error: " + systemException);
                    }
                    else
                    {
                        throw;
                    }
                }
            }
        }

該代碼可以完美創建帶有標題和所有內容的IM convo。 但是,在我的環境中(使用Skype for Business),不會發送第一條消息,盡管在使用Lync 2013的朋友的環境中,他對第一條消息的發送沒有任何問題。

有人聽說過這樣的話嗎?

預先感謝您提供的任何幫助。

我不確定是什么原因導致該問題,但是可以接受的解決方法是使用StartConversationCallBack發送第一條消息

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM