answer method
Answers an inbound call. Returns true if successful, false otherwise. See twilio_js.Call.accept
Implementation
@override
Future<bool?> answer() async {
if (_jsCall != null) {
// Accept incoming call
_jsCall!.accept();
activeCall = activeCallFromNativeJsCall(_jsCall!);
// attach event listeners
// _attachCallEventListeners(_jsCall!);
// log event
final params = getCallParams(_jsCall!);
final from = params["From"] ?? "";
final to = params["To"] ?? "";
Logger.logLocalEventEntries(
["Answer", from, to, jsonEncode(params)],
prefix: "",
);
// notify SW to cancel notification
final callSid = _getSid();
webCallkit.updateCallStatus(callSid!, callStatus: CKCallState.active);
return true;
}
return false;
}