replacedBy method
Implementation
Future<void> replacedBy(CallSession newCall) async {
if (state == CallState.kWaitLocalMedia) {
Logs().v('Telling new call to wait for local media');
} else if (state == CallState.kCreateOffer ||
state == CallState.kInviteSent) {
Logs().v('Handing local stream to new call');
await newCall.gotCallFeedsForAnswer(getLocalStreams);
}
_successor = newCall;
onCallReplaced.add(newCall);
// ignore: unawaited_futures
hangup(reason: CallErrorCode.replaced);
}