0

我正在编写一个简单的 C# 应用程序来应答 Lync 呼叫并根据数据库值将其转发到另一个电话号码。这完美无缺。但是,有时我想将呼叫转接到用户的语音信箱。我不知道如何获取语音信箱的 URI :(

假设我在 ConversationAdded 事件的处理程序中。我试过这个:

Conversation conv = args.Conversation;
string voicemailURI = String.Format("{0};opaque=app:voicemail",conv.SelfParticipant.Contact.Uri);
// the contact returned here, however, does not contain the opaque=app:voicemail
Contact forwardContact = lync.ContactManager.GetContactByUri(voicemailURI);

还:

Conversation conv = args.Conversation;
// following throws ArgumentException: Value does not fall within the expected range
Phone voicemail = lync.Self.GetPhone(ContactEndpointType.VoiceMail);
string voicemailURI = voicemail.Endpoint.Uri
Contact forwardContact = lync.ContactManager.GetContactByUri(voicemailURI);

UC 语音信箱已设置并正常工作。我不确定该术语究竟是什么,但它由 Exchange 处理,并且邮件出现在我的收件箱中。如果我只是让电话响起,它最终会出现在语音邮件中,但我的应用程序知道它应该立即发送到那里,所以我想立即转发它。

4

1 回答 1

0

我想我不太清楚你为什么关心联系方式?您的第一个示例将为您提供直接转到语音邮件的 URI。那时你可以这样做:

        var automation = LyncClient.GetAutomation();
        var conversationModes = AutomationModalities.Audio;
        var conversationSettings = new Dictionary<AutomationModalitySettings, object>();
        List<string> participants = new List<string>();
        Conversation conv = args.Conversation;            
        string voicemailURI = String.Format("{0};opaque=app:voicemail",conv.SelfParticipant.Contact.Uri);
        participants.Add(voicemailUri);
        automation.BeginStartConversation(AutomationModalities.Audio, participants, null, StartConversationCallback, automation);
于 2012-07-10T14:17:09.177 回答