The Telephony channel in Microsoft Bot Framework allows you to bind an Azure Communication Services' PSTN phone number with a Microsoft Bot Framework bot.
The Telephony channel under the hood is built on Microsoft Speech Services to allow Speech to Text and Text to Speech capabilities crucial for enabling an audio interaction/conversation over phone lines.
Please follow these steps to enable the Telephony channel for your bot.
- Step 1: Create a new bot. You can skip this step if you already have a working bot.
- Step 2: Get an Azure Communication Services Resource and acquire a phone number in it.
- Step 3: Create an Azure Cognitive Services Resource. Please note that Telephony is currently supported in WestUS2 and EastUS regions.
IMPORTANT: If you do not enable this step, you will hear silence when calling the phone number.
You will need to make a small configuration change so that your bot can communicate with the Telephony channel using web sockets. Follow these steps to enable web sockets:
-
Navigate to the Azure portal > App Service hosting your bot > Configuration (in the left navigation pane) > open
General Settings
tab. -
Locate the toggle for Web sockets and set it to
On
. -
Click Save.
-
In addition to this, ensure your bot code has enabled communication over web socket, for example in dotnet it is
app.UseWebSockets();
inStartup.cs
, and in Node.js it isstreamingAdapter.useWebSocket()
see example.
Once you have created an Azure Cognitive Services and Azure Communication Services resource, you are ready to configure Telephony.
-
Go to the Azure portal > Select the bot (Created in previous step) > Channels (Preview)
-
Select the Telephony channel
-
Select Connect in the command bar
-
In the "Connect Phone Numbers" pane, make sure you have the correct subscriptions selected, then choose an Azure Cognitive Services resource and an Azure Communication Services resource.
-
Select one or many phone number(s) to connect to your bot, then select Connect
- Repeat this step for any additional Azure Communication Service resources you'd like to connect.
-
Select Apply to save your changes and connect the selected number(s) to the bot.