Skip to content

Commit fdb6432

Browse files
authored
Merge pull request #163 from cybex-dev/fix_decline_incoming_call
Add Call `reject()` on `CallStatus.pending`
2 parents b0340d7 + feeeb72 commit fdb6432

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/_internal/twilio_voice_web.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,8 @@ class Call extends MethodChannelTwilioCall {
726726
_cancelNotification(callSid!);
727727

728728
CallStatus callStatus = getCallStatus(_jsCall!);
729-
if (callStatus == CallStatus.ringing) {
729+
// reject incoming call that is both outbound ringing or inbound pending
730+
if (callStatus == CallStatus.ringing || callStatus == CallStatus.pending) {
730731
_jsCall!.reject();
731732
} else {
732733
_jsCall!.disconnect();

0 commit comments

Comments
 (0)