[英]Create a Call for an representation User in Skype for Business / Lync using the Lync SDK
[英]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.