Search in sources :

Example 6 with CallRequest

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

the class CallPresenter method requestP2PCallWithP2PThreadId.

// Not using yet
@Override
public void requestP2PCallWithP2PThreadId(int threadId) {
    // request with threadId
    CallRequest callRequest = new CallRequest.Builder(threadId, BASE_CALL_TYPE).build();
    if (callRequest.getCallType() == CallType.Constants.VIDEO_CALL) {
        showVideoViews();
    }
    @SuppressLint("MissingPermission") String uniqueId = chat.requestCall(callRequest);
    callUniqueIds.add(uniqueId);
    callImpUniqueIds.add(uniqueId);
}
Also used : AcceptCallRequest(com.fanap.podchat.call.request_model.AcceptCallRequest) EndCallRequest(com.fanap.podchat.call.request_model.EndCallRequest) RejectCallRequest(com.fanap.podchat.call.request_model.RejectCallRequest) TerminateCallRequest(com.fanap.podchat.call.request_model.TerminateCallRequest) CallRequest(com.fanap.podchat.call.request_model.CallRequest) SuppressLint(android.annotation.SuppressLint)

Example 7 with CallRequest

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

the class CallPresenter method requestP2PCallWithContactId.

@SuppressLint("MissingPermission")
@Override
public void requestP2PCallWithContactId(int contactId, int callType) {
    List<Invitee> invitees = new ArrayList<>();
    Invitee invitee = new Invitee();
    invitee.setId(contactId);
    invitee.setIdType(InviteType.Constants.TO_BE_USER_CONTACT_ID);
    invitees.add(invitee);
    // request with invitee list
    CallRequest callRequest = new CallRequest.Builder(invitees, callType).setTitle(GROUP_CALL_NAME_PREFIX + contactId).setDescription("Generated at " + new Date().toString()).build();
    if (callRequest.getCallType() == CallType.Constants.VIDEO_CALL) {
        showVideoViews();
    } else {
        prepareAudioCallView();
    }
    String uniqueId;
    uniqueId = requestCallByServerType(callRequest);
    callUniqueIds.add(uniqueId);
    callImpUniqueIds.add(uniqueId);
}
Also used : Invitee(com.fanap.podchat.mainmodel.Invitee) AcceptCallRequest(com.fanap.podchat.call.request_model.AcceptCallRequest) EndCallRequest(com.fanap.podchat.call.request_model.EndCallRequest) RejectCallRequest(com.fanap.podchat.call.request_model.RejectCallRequest) TerminateCallRequest(com.fanap.podchat.call.request_model.TerminateCallRequest) CallRequest(com.fanap.podchat.call.request_model.CallRequest) ArrayList(java.util.ArrayList) Date(java.util.Date) SuppressLint(android.annotation.SuppressLint)

Example 8 with CallRequest

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

the class CallPresenter method requestGroupCallWithThreadId.

private void requestGroupCallWithThreadId(int threadId, int callType) {
    CallRequest callRequest = new CallRequest.Builder(threadId, callType).setTitle(GROUP_CALL_NAME_PREFIX + " " + threadId).setDescription("Generated at " + new Date().toString()).build();
    if (callRequest.getCallType() == CallType.Constants.VIDEO_CALL) {
        showVideoViews();
    } else {
        prepareAudioCallView();
    }
    @SuppressLint("MissingPermission") String uniqueId = chat.requestGroupCall(callRequest);
    callUniqueIds.add(uniqueId);
    callImpUniqueIds.add(uniqueId);
}
Also used : AcceptCallRequest(com.fanap.podchat.call.request_model.AcceptCallRequest) EndCallRequest(com.fanap.podchat.call.request_model.EndCallRequest) RejectCallRequest(com.fanap.podchat.call.request_model.RejectCallRequest) TerminateCallRequest(com.fanap.podchat.call.request_model.TerminateCallRequest) CallRequest(com.fanap.podchat.call.request_model.CallRequest) SuppressLint(android.annotation.SuppressLint) Date(java.util.Date)

Aggregations

AcceptCallRequest (com.fanap.podchat.call.request_model.AcceptCallRequest)8 CallRequest (com.fanap.podchat.call.request_model.CallRequest)8 EndCallRequest (com.fanap.podchat.call.request_model.EndCallRequest)8 RejectCallRequest (com.fanap.podchat.call.request_model.RejectCallRequest)8 TerminateCallRequest (com.fanap.podchat.call.request_model.TerminateCallRequest)8 SuppressLint (android.annotation.SuppressLint)7 Invitee (com.fanap.podchat.mainmodel.Invitee)6 ArrayList (java.util.ArrayList)6 Date (java.util.Date)4 GsonBuilder (com.google.gson.GsonBuilder)3