我想知道在Lync中右鍵單擊聯繫人並選擇呼叫,然後單擊某個號碼時,獲取單擊的電話號碼的正確方法。如何獲取在Lync 2013中點擊的聯繫人的電話號碼?
預計是一個電話字符串,其中包含被點擊的電話號碼。
難道有人請概述我們在這種情況下使用的事件和代碼來檢索數字嗎?
目前我使用的ConversationManager.ConversationAdded
事件和檢索從接觸終點URI的電話號碼,但是隻運作時間的一半,有時默認端點來通過爲SIP字符串,即使我點擊了實際的電話號碼。
這裏的代碼。
Private Sub ConversationManager_ConversationAdded(ByVal sender As Object, ByVal e As Microsoft.Lync.Model.Conversation.ConversationManagerEventArgs) Handles m_lyncConversationManager.ConversationAdded
Dim ConvParticipants As IList(Of Participant) = e.Conversation.Participants
Dim ContactURI() As String = ConvParticipants.Item(1).Contact.Uri.ToString().Split(":")
If e.Conversation.Modalities(ModalityTypes.AudioVideo).State = ModalityState.Connecting Then
Dim outboundContact As Contact = ConvParticipants.Item(1).Contact
Dim _ContactSettings As IDictionary(Of ContactSetting, Object) = outboundContact.Settings
Dim outObject As Object = Nothing
Dim PhoneNumber() As String
If _ContactSettings.TryGetValue(ContactSetting.DefaultContactEndpoint, outObject) Then
PhoneNumber = DirectCast(outObject, ContactEndpoint).Uri.Split(":")
感謝您的答覆。但是這不會起作用,因爲您需要知道實際點擊的號碼。聯繫人卡片會給我多個號碼,所以無法知道實際點擊了哪個號碼。 – user2264109 2013-04-17 23:20:48