| page_type | languages | products | |||
|---|---|---|---|---|---|
| sample |
|
|
In this sample, I cover how you can use Call Automation SDK with all its features.
-
Create an Azure account with an active subscription. For details, see Create an account for free
-
Create an Azure Communication Services resource. For details, see Create an Azure Communication Resource. You will need to record your resource connection string for this sample.
-
Get a phone number for your new Azure Communication Services resource. For details, see Get a phone number
-
Create and host a Azure Dev Tunnel. Instructions here
-
.NET7 Framework (Make sure to install version that corresponds with your visual studio instance, 32 vs 64 bit)
-
Create
Dev Tunnels, for more details about Dev Tunnels.


- Open an instance of PowerShell, Windows Terminal, Command Prompt or equivalent and navigate to the directory that you'd like to clone the sample to.
- git clone https://github.com/ibrahimmalhas/ACS-CA-FullSample.git.
- Open the Program.cs file to configure the following settings:
acsConnectionString: Azure Communication Service resource's connection string.acsPhonenumber: Phone number associated with the Azure Communication Service resource. For e.g. "+1425XXXAAAA"targetPhonenumber: Target phone number to add in the call. For e.g. "+1425XXXAAAA"callbackUriHost: Base url of the app. (For local development replace the dev tunnel url)ParticipantToAdd: Phone number to add participant function
- Go to CallAutomation_SimpleIvr folder and open
CallAutomationApp.slnsolution in Visual Studio. - Visual studio dev tunnel url - Run the solution once and check for dev tunnels being created, select to continue on security prompt.
IncomingCall is an Azure Event Grid event for notifying incoming calls to your Communication Services resource. To learn more about it, see this guide.
-
Navigate to your resource on Azure portal and select
Eventsfrom the left side menu. -
Select
+ Event Subscriptionto create a new subscription. -
Filter for Incoming Call event.
-
Choose endpoint type as web hook and provide the public url generated for your application by Dev Tunnels. Make sure to provide the exact api route that you programmed to receive the event previously. In this case, it would be <dev_tunnel_url>/api/incomingCall.
-
Select create to start the creation of subscription and validation of your endpoint as mentioned previously. The subscription is ready when the provisioning status is marked as succeeded.
This subscription currently has no filters and hence all incoming calls will be sent to your application. To filter for specific phone number or a communication user, use the Filters tab.
- Detailed instructions on publishing the app to Azure are available at Publish a Web app.
Note: While you may use http://localhost for local testing, the sample when deployed will only work when served over https. The SDK does not support http.
-
Solution doesn't build, it throws errors during build
Clean/rebuild the C# solution


