Skip to content

Commit 1290963

Browse files
committed
update cte quickstart
1 parent 21ab1c1 commit 1290963

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

articles/communication-services/quickstarts/voice-video-calling/includes/custom-teams-endpoint/voice-video-calling-cte-javascript.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
author: xixian73
33
ms.service: azure-communication-services
44
ms.topic: include
5-
ms.date: 12/01/2021
5+
ms.date: 07/26/2021
66
ms.author: xixian
77
---
88

@@ -55,17 +55,13 @@ Here's the code:
5555
type="text"
5656
placeholder="User access token"
5757
style="margin-bottom:1em; width: 500px;"/>
58-
<button id="initialize-call-agent" type="button">Initialize Call Agent</button>
58+
<button id="initialize-teams-call-agent" type="button">Initialize Teams Call Agent</button>
5959
<br>
6060
<br>
6161
<input id="callee-teams-user-id"
6262
type="text"
6363
placeholder="Enter callee's Teams user identity in format: '8:orgid:USER_GUID'"
6464
style="margin-bottom:1em; width: 500px; display: block;"/>
65-
<input id="teams-thread-id"
66-
type="text"
67-
placeholder="Enter Teams thread id"
68-
style="margin-bottom:1em; width: 500px; display: block;"/>
6965
<button id="start-call-button" type="button" disabled="true">Start Call</button>
7066
<button id="hangup-call-button" type="button" disabled="true">Hang up Call</button>
7167
<button id="accept-call-button" type="button" disabled="true">Accept Call</button>
@@ -91,10 +87,10 @@ The following classes and interfaces handle some of the main features of the Azu
9187
| Name | Description |
9288
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
9389
| `CallClient` | The main entry point to the Calling SDK. |
94-
| `AzureCommunicationTokenCredential` | Implements the `CommunicationTokenCredential` interface, which is used to instantiate `callAgent`. |
95-
| `CallAgent` | Used to start and manage calls. |
90+
| `AzureCommunicationTokenCredential` | Implements the `CommunicationTokenCredential` interface, which is used to instantiate `teamsCallAgent`. |
91+
| `TeamsCallAgent` | Used to start and manage Teams calls. |
9692
| `DeviceManager` | Used to manage media devices. |
97-
| `Call` | Used for representing a Call |
93+
| `TeamsCall` | Used for representing a Teams Call |
9894
| `LocalVideoStream` | Used for creating a local video stream for a camera device on the local system. |
9995
| `RemoteParticipant` | Used for representing a remote participant in the Call |
10096
| `RemoteVideoStream` | Used for representing a remote video stream from a Remote Participant.
@@ -111,7 +107,7 @@ AzureLogger.log = (...args) => {
111107
console.log(...args);
112108
};
113109
// Calling web sdk objects
114-
let callAgent;
110+
let teamsCallAgent;
115111
let deviceManager;
116112
let call;
117113
let incomingCall;
@@ -120,8 +116,7 @@ let localVideoStreamRenderer;
120116
// UI widgets
121117
let userAccessToken = document.getElementById('user-access-token');
122118
let calleeTeamsUserId = document.getElementById('callee-teams-user-id');
123-
let teamsThreadId = document.getElementById('teams-thread-id');
124-
let initializeCallAgentButton = document.getElementById('initialize-call-agent');
119+
let initializeCallAgentButton = document.getElementById('initialize-teams-call-agent');
125120
let startCallButton = document.getElementById('start-call-button');
126121
let hangUpCallButton = document.getElementById('hangup-call-button');
127122
let acceptCallButton = document.getElementById('accept-call-button');
@@ -131,20 +126,20 @@ let connectedLabel = document.getElementById('connectedLabel');
131126
let remoteVideoContainer = document.getElementById('remoteVideoContainer');
132127
let localVideoContainer = document.getElementById('localVideoContainer');
133128
/**
134-
* Create an instance of CallClient. Initialize a CallAgent instance with a CommunicationUserCredential via created CallClient. CallAgent enables us to make outgoing calls and receive incoming calls.
129+
* Create an instance of CallClient. Initialize a TeamsCallAgent instance with a CommunicationUserCredential via created CallClient. TeamsCallAgent enables us to make outgoing calls and receive incoming calls.
135130
* You can then use the CallClient.getDeviceManager() API instance to get the DeviceManager.
136131
*/
137132
initializeCallAgentButton.onclick = async () => {
138133
try {
139134
const callClient = new CallClient();
140135
tokenCredential = new AzureCommunicationTokenCredential(userAccessToken.value.trim());
141-
callAgent = await callClient.createCallAgent(tokenCredential)
136+
teamsCallAgent = await callClient.createTeamsCallAgent(tokenCredential)
142137
// Set up a camera device to use.
143138
deviceManager = await callClient.getDeviceManager();
144139
await deviceManager.askDevicePermission({ video: true });
145140
await deviceManager.askDevicePermission({ audio: true });
146141
// Listen for an incoming call to accept.
147-
callAgent.on('incomingCall', async (args) => {
142+
teamsCallAgent.on('incomingCall', async (args) => {
148143
try {
149144
incomingCall = args.incomingCall;
150145
acceptCallButton.disabled = false;
@@ -171,7 +166,7 @@ startCallButton.onclick = async () => {
171166
try {
172167
const localVideoStream = await createLocalVideoStream();
173168
const videoOptions = localVideoStream ? { localVideoStreams: [localVideoStream] } : undefined;
174-
call = callAgent.startCall([{ microsoftTeamsUserId: calleeTeamsUserId.value.trim() }], { videoOptions: videoOptions, threadId: teamsThreadId });
169+
call = teamsCallAgent.startCall([{ microsoftTeamsUserId: calleeTeamsUserId.value.trim() }], { videoOptions: videoOptions });
175170
// Subscribe to the call's properties and events.
176171
subscribeToCall(call);
177172
} catch (error) {
@@ -181,7 +176,7 @@ startCallButton.onclick = async () => {
181176
/**
182177
* Accepting an incoming call with a video
183178
* Add an event listener to accept a call when the `acceptCallButton` is selected.
184-
* You can accept incoming calls after subscribing to the `CallAgent.on('incomingCall')` event.
179+
* You can accept incoming calls after subscribing to the `TeamsCallAgent.on('incomingCall')` event.
185180
* You can pass the local video stream to accept the call with the following code.
186181
*/
187182
acceptCallButton.onclick = async () => {

0 commit comments

Comments
 (0)