You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/communication-services/concepts/voice-video-calling/incoming-call-notification.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Given the above examples, the following scenarios will trigger an `IncomingCall`
30
30
| Source | Destination | Scenario(s) |
31
31
| ------ | ----------- | -------- |
32
32
| Azure Communication Services identity | Azure Communication Services identity | Call, Redirect, Add Participant, Transfer |
33
-
| Azure Communication Services identity | PSTN number owned by your Azure Communication Services resource | Call, Redirect, Add Participant
33
+
| Azure Communication Services identity | PSTN number owned by your Azure Communication Services resource | Call, Redirect, Add Participant, Transfer
34
34
| Public PSTN | PSTN number owned by your Azure Communication Services resource | Call, Redirect, Add Participant, Transfer
35
35
36
36
> [!NOTE]
@@ -46,7 +46,7 @@ This architecture has the following benefits:
46
46
- PSTN number assignment and routing logic can exist in your application versus being statically configured online.
47
47
- As identified in the above [calling scenarios](#calling-scenarios) section, your application can be notified even when users make calls between each other. You can then combine this scenario together with the [Call Recording APIs](../voice-video-calling/call-recording.md) to meet compliance needs.
48
48
49
-
To subscribe to the `IncomingCall` notification from Event Grid, [follow this how-to guide](../../how-tos/call-automation-sdk/subscribe-to-incoming-call.md).
49
+
To check out a sample payload for the event and to learn about other calling events published to Event Grid, check out this [guide](../../../event-grid/communication-services-voice-video-events.md#microsoftcommunicationincomingcall).
50
50
51
51
## Call routing in Call Automation or Event Grid
52
52
@@ -55,3 +55,7 @@ You can use [advanced filters](../../../event-grid/event-filtering.md) in your E
55
55
## Number assignment
56
56
57
57
Since the `IncomingCall` notification doesn't have a specific destination other than the Event Grid subscription you've created, you're free to associate any particular number to any endpoint in Azure Communication Services. For example, if you acquired a PSTN phone number of `+14255551212` and want to assign it to a user with an identity of `375f0e2f-e8db-4449-9bf7-2054b02e42b4` in your application, you'll maintain a mapping of that number to the identity. When an `IncomingCall` notification is sent matching the phone number in the **to** field, you'll invoke the `Redirect` API and supply the identity of the user. In other words, you maintain the number assignment within your application and route or answer calls at runtime.
58
+
59
+
## Next steps
60
+
-[Build a Call Automation application](../../quickstarts/voice-video-calling/callflows-for-customer-interactions.md) to simulate a customer interaction.
61
+
-[Redirect an inbound PSTN call](../../how-tos/call-automation-sdk/redirect-inbound-telephony-calls.md) to your resource.
In this quickstart, you'll learn how to build an application that uses the Azure Communication Services Call Automation SDK to handle the following scenario:
22
22
- handling the `IncomingCall` event from Event Grid
23
23
- answering a call
24
-
- playing an audio file
24
+
- playing an audio file and recognizing input(DTMF) from caller
25
25
- adding a communication user to the call such as a customer service agent who uses a web application built using Calling SDKs to connect to Azure Communication Services
26
26
27
27
::: zone pivot="programming-language-csharp"
@@ -32,13 +32,28 @@ In this quickstart, you'll learn how to build an application that uses the Azure
32
32
[!INCLUDE [Call flows for customer interactions with Java](./includes/call-automation/Callflow-for-customer-interactions-java.md)]
33
33
::: zone-end
34
34
35
+
## Subscribe to IncomingCall event
36
+
37
+
IncomingCall is an Azure Event Grid event for notifying incoming calls to your Communication Services resource. To learn more about it, see [this guide](../../concepts/voice-video-calling/incoming-call-notification.md).
38
+
1. Navigate to your resource on Azure portal and select `Events` from the left side menu.
39
+
1. Select `+ Event Subscription` to create a new subscription.
40
+
1. Filter for Incoming Call event.
41
+
1. Choose endpoint type as web hook and provide the public url generated for your application by ngrok. Make sure to provide the exact api route that you programmed to receive the event previously. In this case, it would be <ngrok_url>/api/incomingCall.
42
+

43
+
44
+
1. 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.
45
+
46
+
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.
47
+
35
48
## Testing the application
36
49
37
-
1. Place a call to the number you acquired in the Azure portal (see prerequisites above).
38
-
2. Your Event Grid subscription to the `IncomingCall` should execute and call your web server.
39
-
3. The call will be answered, and an asynchronous web hook callback will be sent to the NGROK callback URI.
40
-
4. When the call is connected, a `CallConnected` event will be sent to your web server, wrapped in a `CloudEvent` schema and can be easily deserialized using the Call Automation SDK parser. At this point, the application will request audio to be played and input from a targeted phone number.
41
-
5. When the input has been received and recognized, the web server will make a request to add a participant to the call.
50
+
1. Place a call to the number you acquired in the Azure portal.
51
+
2. Your Event Grid subscription to the `IncomingCall` should execute and call your application that will request to answer the call.
52
+
3. When the call is connected, a `CallConnected` event will be sent to your application's callback url. At this point, the application will request audio to be played and to receive input from the caller.
53
+
4. From your phone, press any three number keys, or press one number key and then # key.
54
+
5. When the input has been received and recognized, the application will make a request to add a participant to the call.
55
+
6. Once the added user answers, you can talk to them.
0 commit comments