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
### Motivation and Context
The current README for the "call_automation" demo is lacking some
important details to be successful at running the demo.
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
### Description
Improve the README around the ordering of the steps and details provided
to make it easier for users to run the demo.
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
Copy file name to clipboardExpand all lines: python/samples/demos/call_automation/readme.md
+43-4
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Original code for this sample can be found [here](https://github.com/Azure-Sampl
8
8
9
9
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
10
10
- A deployed Communication Services resource. [Create a Communication Services resource](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource).
11
-
- A [phone number](https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/telephony/get-phone-number) in your Azure Communication Services resource that can get inbound calls. NB: phone numbers are not available in free subscriptions.
11
+
- A [phone number](https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/telephony/get-phone-number) in your Azure Communication Services resource that can get inbound calls. NOTE: although trial phone numbers are available in free subscriptions, they will not work properly. You must have a paid phone number.
12
12
-[Python](https://www.python.org/downloads/) 3.9 or above.
13
13
- An Azure OpenAI Resource and Deployed Model. See [instructions](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal).
14
14
- Install `uv`, see [the uv docs](https://docs.astral.sh/uv/getting-started/installation/).
@@ -34,10 +34,10 @@ devtunnel host
34
34
Copy the `.env.example` file to `.env` and update the following values:
35
35
36
36
1.`ACS_CONNECTION_STRING`: Azure Communication Service resource's connection string.
37
-
2.`CALLBACK_URI_HOST`: Base url of the app. (For local development use the dev tunnel url from the step above)
37
+
2.`CALLBACK_URI_HOST`: Base url of the app. (For local development use the dev tunnel url from the step above). This URI is in the form of `https://<unique-id>-8080.XXXX.devtunnels.ms`.
38
38
3.`AZURE_OPENAI_ENDPOINT`: Azure Open AI service endpoint
39
39
4.`AZURE_OPENAI_REALTIME_DEPLOYMENT_NAME`: Azure Open AI deployment name
40
-
5.`AZURE_OPENAI_API_VERSION`: Azure Open AI API version, this should be one that includes the realtime api, for instance '2024-10-01-preview'
40
+
5.`AZURE_OPENAI_API_VERSION`: Azure Open AI API version, this should be one that includes the realtime api, for instance '2024-10-01-preview'. This API version is the currently the only supported version.
41
41
6.`AZURE_OPENAI_API_KEY`: Azure Open AI API key, optionally, you can also use Entra Auth.
42
42
43
43
## Run the app
@@ -47,7 +47,46 @@ Copy the `.env.example` file to `.env` and update the following values:
47
47
- execute `uv run --env-file .env call_automation.py` directly in your terminal (this uses `uv`, which will then install the requirements in a temporary virtual environment, see [uv docs](https://docs.astral.sh/uv/guides/scripts) for more info).
48
48
2. Browser should pop up with a simple page. If not navigate it to `http://localhost:8080/` or your dev tunnel url.
49
49
3. Register an EventGrid Webhook for the IncomingCall(`https://<devtunnelurl>/api/incomingCall`) event that points to your devtunnel URI. Instructions [here](https://learn.microsoft.com/en-us/azure/communication-services/concepts/call-automation/incoming-call-notification).
50
+
- To register the event, navigate to your ACS resource in the Azure Portal (follow the Microsoft Learn Docs if you prefer to use the CLI).
51
+
- On the left menu bar click "Events."
52
+
- Click on "+Event Subscription."
53
+
- Provide a unique name for the event subscription details, for example, "IncomingCallWebhook"
54
+
- Leave the "Event Schema" as "Event Grid Schema"
55
+
- Provide a unique "System Topic Name"
56
+
- For the "Event Types" select "Incoming Call"
57
+
- For the "Endpoint Details" select "Webhook" from the drop down
58
+
- Once "Webhook" is selected, you will need to configure the URI for the incoming call webhook, as mentioned above: `https://<devtunnelurl>/api/incomingCall`.
59
+
-**Important**: before clicking on "Create" to create the event subscription, the `call_automation.py` script must be running, as well as your devtunnel. ACS sends a verification payload to the app to make sure that the communication is configured properly. The event subscription will not succeed in the portal without the script running. If you see an error, this is most likely the root cause.
60
+
50
61
51
62
Once that's completed you should have a running application. The way to test this is to place a call to your ACS phone number and talk to your intelligent agent!
52
63
53
-
In the terminal you should see all sorts of logs from both ACS and Semantic Kernel.
64
+
In the terminal you should see all sorts of logs from both ACS and Semantic Kernel. Successful logs can look like the following:
65
+
66
+
```bash
67
+
[YYYY-MM-DD HH:MM:SS,mmm] INFO in call_automation: incoming call handler caller id: +14255551234
68
+
[2YYYY-MM-DD HH:MM:SS,mmm] INFO in call_automation: callback url: https://<devtunnelurl>/api/callbacks/<guid>?callerId=%2B14257059063
69
+
[YYYY-MM-DD HH:MM:SS,mmm] INFO in call_automation: websocket url: wss://<devtunnelurl>/ws
70
+
[YYYY-MM-DD HH:MM:SS,mmm] INFO in call_automation: Answered call for connection id: <guid>>
[YYYY-MM-DD HH:MM:SS,mmm] INFO in call_automation: Received Event:-> Microsoft.Communication.ParticipantsUpdated, Correlation Id:-><guid>, CallConnectionId:-><guid>
[YYYY-MM-DD HH:MM:SS,mmm] INFO in call_automation: Received Event:-> Microsoft.Communication.CallConnected, Correlation Id:-><guid>, CallConnectionId:-><guid>
79
+
[YYYY-MM-DD HH:MM:SS,mmm] INFO in call_automation: Received Event:-> Microsoft.Communication.MediaStreamingStarted, Correlation Id:-><guid>, CallConnectionId:-><guid>
80
+
[YYYY-MM-DD HH:MM:SS,mmm] INFO in call_automation: Media streaming content type:--> Audio
81
+
[YYYY-MM-DD HH:MM:SS,mmm] INFO in call_automation: Media streaming status:--> mediaStreamingStarted
82
+
[YYYY-MM-DD HH:MM:SS,mmm] INFO in call_automation: Media streaming status details:--> subscriptionStarted
AI:-- Ah, greetings, dear traveler of the world! In this moment, amidst the tapestry of time and space, you seek a glimpse of the weather that graces a particular place. Pray, tell me, to which location do you wish to turn your gaze, so I might summon the winds and the skies to unfold their secrets for you?
0 commit comments