Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions Project/src/MakeCall/MakeCall.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,22 @@ export default class MakeCall extends React.Component {
await this.callClient.createCallAgent(tokenCredential, { displayName: userDetails.displayName });
window.callAgent = this.callAgent;

this.callAgent.on('activeCallsUpdated', (args) => {
console.log(`activeCallsUpdated, activeCalls=${args.activeCallDetails}`);
this.setState({activeCallDetails: args.activeCallDetails});
});
try {
this.callAgent.on('activeCallsUpdated', (args) => {
console.log(`activeCallsUpdated, activeCalls=${args.activeCallDetails}`);
this.setState({activeCallDetails: args.activeCallDetails});
});

this.callAgent.on('noActiveCalls', () => {
console.log('noActiveCalls event received - user no longer in a call');
this.setState({activeCallDetails: undefined});
});
this.callAgent.on('noActiveCalls', () => {
console.log('noActiveCalls event received - user no longer in a call');
this.setState({activeCallDetails: undefined});
});
const activeCalls = await this.callAgent.getActiveCallDetails();
this.setState({ activeCallDetails: activeCalls.callId ? activeCalls : undefined });
} catch (e) {
console.log('active call transfer not configured for this release version');
}



this.callAgent.on('callsUpdated', e => {
Expand Down Expand Up @@ -235,9 +242,7 @@ export default class MakeCall extends React.Component {
this.setState({ loggedIn: true });
this.logInComponentRef.current.setCallAgent(this.callAgent);
this.logInComponentRef.current.setCallClient(this.callClient);
this.autoJoinMeetingByMeetingLink();
const activeCalls = await this.callAgent.getActiveCallDetails();
this.setState({ activeCallDetails: activeCalls.callId ? activeCalls : undefined });
this.autoJoinMeetingByMeetingLink();
} catch (e) {
console.error(e);
}
Expand Down
Loading