| title | View calling events |
|---|---|
| titleSuffix | An Azure Communication Services article |
| description | This article describes how to handle voice and video calling events using Azure Communication Services. |
| author | laithrodan |
| manager | micahvivion |
| services | azure-communication-services |
| ms.author | laithrodan |
| ms.date | 06/28/2025 |
| ms.topic | quickstart |
| ms.service | azure-communication-services |
| ms.subservice | calling |
| ms.custom | mode-other |
[!INCLUDE Public Preview]
You can use Azure Event Grid to handle Communication Services voice and video calling events.
Azure Event Grid is a cloud-based eventing service. This article describes how to subscribe to events for communication service events, and trigger an event to view the result. Typically, you send events to an endpoint that processes the event data and takes actions. In this article, we send the events to a web app that collects and displays the messages.
- An Azure account with an active subscription. Create an account for free.
- An Azure Communication Service resource. For more information, see Create an Azure Communication Services resource.
- An Azure Communication Services voice and video calling enabled client. Add voice calling to your app.
If you're new to Event Grid, you might need to register the Event Grid resource provider following these steps:
In the Azure portal:
- Select Subscriptions on the left menu.
- Select the subscription you're using for Event Grid.
- On the left menu, under Settings, select Resource providers.
- Find Microsoft.EventGrid.
- If not registered, select Register.
It might take a moment for the registration to finish. Select Refresh to update the status. When Status is Registered, you're ready to continue.
In this article, we use the Azure Event Grid Viewer Sample to view events in near-real time. This provides the user with the experience of a real-time feed. In addition, the payload of each event should be available for inspection as well.
In the portal, navigate to your Azure Communication Services Resource that you created. Inside the Communication Service resource, select Events from the left menu of the Communication Services page.
:::image type="content" source="./../sms/media/handle-sms-events/select-events.png" alt-text="Screenshot showing selecting the event subscription button within a resource's events page.":::
Press Add Event Subscription to enter the creation wizard.
On the Create Event Subscription page, Enter a name for the event subscription.
You can subscribe to specific events, to tell Event Grid which of the voice and video events you want to subscribe to, and where to send the events. Select the events you want to subscribe to from the dropdown menu. For voice and video calling, you can choose Call Started, Call Ended, Call Participant added, or Call Participant Removed.
If you're prompted to provide a System Topic Name, feel free to provide a unique string. This field has no impact on your experience and is used for internal telemetry purposes.
Check out the full list of events supported by Azure Communication Services.
:::image type="content" source="./media/handle-calling-events/select-events-voice-video-calling.png" alt-text="Screenshot showing the calling event types being selected.":::
Select Web Hook for Endpoint type.
:::image type="content" source="./../sms/media/handle-sms-events/select-events-create-linkwebhook.png" alt-text="Screenshot showing the Endpoint Type field being set to Web Hook.":::
For Endpoint, click Select an endpoint, and enter the URL of your web app.
In this case, we use the URL from the Azure Event Grid Viewer Sample we set up earlier in the quickstart. The URL for the sample uses the format: https://{{site-name}}.azurewebsites.net/api/updates
Then select Confirm Selection.
:::image type="content" source="./../sms/media/handle-sms-events/select-events-create-selectwebhook-epadd.png" alt-text="Screenshot showing confirming a Web Hook Endpoint.":::
To view event triggers, we must first generate the events.
Call Startedevents are generated when an Azure Communication Services voice and video call is started. To trigger this event, just start a call attached to your Communication Services resource.Call Endedevents are generated when an Azure Communication Services voice and video call is ended. To trigger this event, just end a call attached to your Communication Services resource.Call Participant Addedevents are generated when a participant is added to an Azure Communication Services voice and video call. To trigger this event, add a participant to an Azure Communication Services voice and video call attached to your Communication Services resource.Call Participant Removedevents are generated when a participant is removed from an Azure Communication Services voice and video call. To trigger this event, remove a participant from an Azure Communication Services voice and video call attached to your Communication Services resource.
Check out the full list of events supported by Azure Communication Services.
Once you complete either action of the previous actions, you notice voice and video calling events are sent to your endpoint. These events show up in the Azure Event Grid Viewer Sample we set up at the beginning. You can press the eye icon next to the event to see the entire payload.
Learn more about the event schemas and other eventing concepts.
If you want to clean up and remove a Communication Services subscription, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it. Learn more about cleaning up resources.