Search in sources :

Example 1 with RejectCallRequest

use of com.fanap.podchat.call.request_model.RejectCallRequest 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)

Example 2 with RejectCallRequest

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

the class CallPresenter method rejectIncomingCall.

@Override
public void rejectIncomingCall() {
    RejectCallRequest request = new RejectCallRequest.Builder(callVO.getCallId()).build();
    String uniqueId = chat.rejectVoiceCall(request);
    callUniqueIds.add(uniqueId);
    getActiveCalls();
}
Also used : RejectCallRequest(com.fanap.podchat.call.request_model.RejectCallRequest)

Example 3 with RejectCallRequest

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

the class CallPresenter method rejectIncomingCallWithMessage.

@Override
public void rejectIncomingCallWithMessage(String msg) {
    RejectCallRequest request = new RejectCallRequest.Builder(callVO.getCallId()).build();
    String uniqueId = chat.rejectVoiceCall(request);
    callUniqueIds.add(uniqueId);
    RequestMessage requestRejectMessage = new RequestMessage.Builder("الان نمی‌تونم جواب بدم", callVO.getConversationVO().getId()).messageType(TextMessageType.Constants.TEXT).jsonMetaData(new GsonBuilder().create().toJson("{\"callRejectWithMessage\":true}")).build();
    callUniqueIds.add(chat.sendTextMessage(requestRejectMessage, null));
    getActiveCalls();
}
Also used : GsonBuilder(com.google.gson.GsonBuilder) RequestMessage(com.fanap.podchat.requestobject.RequestMessage) RejectCallRequest(com.fanap.podchat.call.request_model.RejectCallRequest)

Aggregations

RejectCallRequest (com.fanap.podchat.call.request_model.RejectCallRequest)3 GsonBuilder (com.google.gson.GsonBuilder)2 EndCallRequest (com.fanap.podchat.call.request_model.EndCallRequest)1 RequestMessage (com.fanap.podchat.requestobject.RequestMessage)1