Skip to content

IncomingCall

Lejla Solak edited this page Feb 10, 2025 · 4 revisions



accept()

Description

Accepts an incoming call, which ends up in both parties receiving CallEstablishedEvent, after accept is processed by Infobip WebRTC platform.

Arguments

  • none

Returns

  • N/A

Example

IncomingCallEventListener incomingCallEventListener = incomingWebrtcCallEvent -> {
    IncomingWebrtcCall incomingWebrtcCall = incomingWebrtcCallEvent.getIncomingWebrtcCall();
    incomingWebrtcCall.setEventListener(new DefaultWebrtcCallEventListener());
    incomingWebrtcCall.accept();
};



decline()

Description

Declines the incoming call, which ends up in both parties receiving the CallHangupEvent, after decline is processed by Infobip WebRTC platform.

Arguments

  • none

Returns

  • N/A

Example

IncomingCallEventListener incomingCallEventListener = incomingWebrtcCallEvent -> {
    IncomingWebrtcCall incomingWebrtcCall = incomingWebrtcCallEvent.getIncomingWebrtcCall();
    incomingWebrtcCall.setEventListener(new DefaultWebrtcCallEventListener());
    incomingWebrtcCall.decline();
};



decline(declineOptions)

Description

Declines the incoming call, which ends up in both parties receiving the CallHangupEvent, after decline is processed by Infobip WebRTC platform. DeclineOptions give control over declining the call on all devices.

Arguments

  • declineOptions: DeclineOptions - An optional setting that allows you to decline an incoming call on all devices.

Returns

  • N/A

Example

IncomingCallEventListener incomingCallEventListener = incomingWebrtcCallEvent -> {
    IncomingWebrtcCall incomingWebrtcCall = incomingWebrtcCallEvent.getIncomingWebrtcCall();
    incomingWebrtcCall.setEventListener(new DefaultWebrtcCallEventListener());
    DeclineOptions declineOptions = DeclineOptions.builder()
            .setDeclineOnAllDevices(true)
            .build();
    incomingWebrtcCall.decline(declineOptions);
};

Tutorials

Migration guides

Reference documentation

Clone this wiki locally