Search in sources :

Example 1 with EndCallRequest

use of com.fanap.podchat.call.request_model.EndCallRequest in project pod-chat-android-sdk by FanapSoft.

the class CallPresenter method endRunningCall.

@Override
public void endRunningCall() {
    if (isInCall) {
        isInCall = false;
        isCallRecording = false;
        Log.e(TAG, "REQUEST END CALL FROM CLIENT");
        Log.e(TAG, "REQUEST END CALL FROM CLIENT. Call Response: " + callVO);
        if (callVO != null) {
            Log.e(TAG, "REQUEST END CALL FROM CLIENT call response not null");
            EndCallRequest endCallRequest = new EndCallRequest.Builder().setCallId(callVO.getCallId()).build();
            String uniqueId = chat.endCall(endCallRequest);
            callUniqueIds.add(uniqueId);
            stopScreenShare();
        }
    } else {
        Log.e(TAG, "REQUEST Cancel CALL FROM CLIENT");
        Log.e(TAG, "REQUEST Cancell CALL FROM CLIENT. Call: " + callVO);
        if (callVO != null) {
            Log.e(TAG, "REQUEST Cancel CALL FROM CLIENT call response not null");
            RejectCallRequest endCallRequest = new RejectCallRequest.Builder(callVO.getCallId()).build();
            String uniqueId = chat.rejectVoiceCall(endCallRequest);
            callUniqueIds.add(uniqueId);
        }
    }
    hideVideoViews();
    getActiveCalls();
}
Also used : GsonBuilder(com.google.gson.GsonBuilder) EndCallRequest(com.fanap.podchat.call.request_model.EndCallRequest) RejectCallRequest(com.fanap.podchat.call.request_model.RejectCallRequest)

Aggregations

EndCallRequest (com.fanap.podchat.call.request_model.EndCallRequest)1 RejectCallRequest (com.fanap.podchat.call.request_model.RejectCallRequest)1 GsonBuilder (com.google.gson.GsonBuilder)1