简体   繁体   English

使用Skype for Business发起呼叫的脚本

[英]Script that initiate a call using Skype For Business

I'm trying to create a simple script that can initiate a call to a contact on Skype For Businness . 我正在尝试创建一个简单的脚本,该脚本可以在Skype For Businness上发起对联系人的呼叫。

Actually, i'm trying to do it using the Lync 2013 SDK in C# but it don't seems to work. 实际上,我正在尝试使用C#中Lync 2013 SDK来执行此操作,但它似乎不起作用。 The function LyncClient.ConversationManager.AddConversation() just don't want to work and it launch a stupid exception : Microsoft.Lync.Model.LyncClientException . 函数LyncClient.ConversationManager.AddConversation()只是不想工作,它会启动一个愚蠢的异常: Microsoft.Lync.Model.LyncClientException Of course, this exception isn't referenced on the microsoft doc... 当然,Microsoft文档没有引用此异常。

There is almost two days i've past on it, if someone have a solution i'll be thanksfull ! 我已经过去了将近两天,如果有人有解决方案,我将非常感激!

First off, make sure you have a client from the LyncClient.GetClient() . 首先,请确保您具有LyncClient.GetClient()中的客户端。 Then check that the client is signed in. eg client.State == ClientState.SignedIn. 然后检查客户端是否已登录。例如, client.State == ClientState.SignedIn。

To make a new call you need to get the automation object from the Lync client. 要进行新呼叫,您需要从Lync客户端获取自动化对象。

automation = LyncClient.GetAutomation()

Then you use the BeginStartConversation / EndStartConversation to start the new call. 然后,您可以使用BeginStartConversation / EndStartConversation来开始新的调用。 eg 例如

var participantUri = new List<string> {"sip:{username}@{lyncdomain}"};
automation.EndStartConversation(automation.BeginStartConversation(AutomationModalities.Audio, participantUri, null, null, null))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM