Skip to content

Commit e5bbc93

Browse files
authored
Update voice-video-calling-cte-java.md
1 parent 1ae9dfa commit e5bbc93

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,25 @@ We can also join an existing call with preset options, such as being muted
337337
*/
338338
public TeamsCall joinTeamsCall(TeamsCallAgent teamsCallAgent){
339339
TeamsMeetingLinkLocator link = new TeamsMeetingLinkLocator("meetingLink");
340-
AudioOptions audioOptions = new AudioOptions().setMuted(true);
340+
OutgoingAudioOptions audioOptions = new OutgoingAudioOptions().setMuted(true);
341341
JoinTeamsCallOptions options = new JoinTeamsCallOptions().setAudioOptions(audioOptions);
342342
TeamsCall call = teamsCallAgent.join(this, link, options);
343343
}
344344
```
345345

346+
## Setup Incoming Call Listener
347+
348+
To be able to detect incoming calls and other actions not done by this user, listeners must be setup
349+
350+
```java
351+
private TeamsIncomingCall teamsincomingCall;
352+
teamsCallAgent.addOnIncomingCallListener(this::handleIncomingCall);
353+
354+
private void handleIncomingCall(TeamsIncomingCall incomingCall) {
355+
this.teamsincomingCall = incomingCall;
356+
}
357+
```
358+
346359
## Launch the app and call the echo bot
347360

348361
The app can now be launched using the "Run App" button on the toolbar (Shift+F10). Verify you're able to place calls by calling `8:echo123`. A pre-recorded message plays then repeat your message back to you.

0 commit comments

Comments
 (0)