botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Initiate call from Bot to User

Open decv86 opened this issue 10 years ago • 4 comments

Hi! Help me pls! Is it possible to initiate a call from Bot to the user? In the old api it was possible, but now can not find a solution?

Thank you!

decv86 avatar Nov 15 '16 08:11 decv86

Have you tried version 3.3.0 as 3.3.1 and 3.3.2 seem to have auth issues when initiating a new conversation.

This works for me from service fabric

            string appid = CloudConfigurationManager.GetSetting("MicrosoftAppId");
            string appsecret = CloudConfigurationManager.GetSetting("MicrosoftAppPassword");

            var connector = new ConnectorClient(new Uri("https://facebook.botframework.com/"), appid, appsecret);
            var conversationId = await connector.Conversations.CreateDirectConversationAsync(from, to);
            IMessageActivity message = Activity.CreateMessageActivity();

            message.From = from;
            message.Recipient = to;
            message.Conversation = new ConversationAccount(id: conversationId.Id);
            message.Text = text;
            var reply = await connector.Conversations.SendToConversationAsync((Activity) message);

karlbarber avatar Nov 15 '16 12:11 karlbarber

thanks! how to initiate an audio call from bot?

decv86 avatar Nov 15 '16 21:11 decv86

@msft-shahins can you comment?

chrimc62 avatar Nov 28 '16 01:11 chrimc62

@decv86 currently you cannot proactively initiate an audio call to user. To workaround this, you can proactively send a message to user and ask them to call your bot. Here is a sample showing how you can proactively create a new conversation: https://github.com/Microsoft/BotBuilder-Samples/tree/master/CSharp/core-CreateNewConversation

msft-shahins avatar Nov 28 '16 21:11 msft-shahins