質問

I just started to work with Lync API using SDK. Is it possible to call someone who is not in contact list using mobile phone number? Here is my code (I use automation for this):

LyncClient lyncClient = LyncClient.GetClient();
var automation = LyncClient.GetAutomation();
var conversationModes = AutomationModalities.Audio;
var conversationSettings = new Dictionary<AutomationModalitySettings, object>();
List<string> participants = new List<string>();
var contact = lyncClient.ContactManager.GetContactByUri("+1 (111) 1111111");
participants.Add(contact.Uri);
automation.BeginStartConversation(AutomationModalities.Audio, participants, null, StartConversationCallback, automation);

If user with phone +1 (111) 1111111 exists in my contact list it works fine, but if user doesn't exist or if it is my own phone number then I can't make call. Instead of calling I see popup window "Transfer call" that allows me to chose manually one guy to call from my contact list.

Have any solutions? I just want to make a call to any phone number like I do using MS Lync desktop client.

役に立ちましたか?

解決

So the reason that isn't working is because lyncClient.ContactManager.GetContactByUri("+1 (111) 1111111"); is not returning you a valid contact, as that isn't in your contact list. Rather then searching for a contact, just do this:

participants.Add("tel:+15555555555");

This will use a telUri which is a valid URI to begin a conversation with.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top