Skip to content

IncomingCall

Ajša Terko edited this page Feb 22, 2023 · 3 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 = new IncomingCallEventListener() {
    @Override
    public void onIncomingWebrtcCall(IncomingApplicationCallEvent incomingApplicationCallEvent) {
        IncomingWebrtcCall incomingWebrtcCall = incomingWebrtcCallEvent.getIncomingWebrtcCall();
        Log.d("WebRTC", "Received incoming WebRTC call from:  " + incomingWebrtcCall.source().identifier());
        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 = new IncomingCallEventListener() {
    @Override
    public void onIncomingWebrtcCall(IncomingApplicationCallEvent incomingApplicationCallEvent) {
        IncomingWebrtcCall incomingWebrtcCall = incomingWebrtcCallEvent.getIncomingWebrtcCall();
        Log.d("WebRTC", "Received incoming WebRTC call from:  " + incomingWebrtcCall.source().identifier());
        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 - Additional option to decline an incoming call on all devices.

Returns

  • N/A

Example

IncomingCallEventListener incomingCallEventListener = new IncomingCallEventListener() {
    @Override
    public void onIncomingWebrtcCall(IncomingApplicationCallEvent incomingApplicationCallEvent) {
        IncomingWebrtcCall incomingWebrtcCall = incomingWebrtcCallEvent.getIncomingWebrtcCall();
        Log.d("WebRTC", "Received incoming WebRTC call from:  " + incomingWebrtcCall.source().identifier());
        incomingWebrtcCall.setEventListener(new DefaultWebrtcCallEventListener());
        incomingWebrtcCall.decline(DeclineOptions.builder().setDeclineOnAllDevices(true).build());
    }
};

Tutorials

Migration guides

Reference documentation

Clone this wiki locally