use of com.fanap.podchat.call.request_model.CallRequest in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method requestP2PCallWithContactId.
private void requestP2PCallWithContactId(int contactId, int callType, String contactName) {
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 + contactName).setDescription("Generated at " + new Date().toString()).build();
if (callRequest.getCallType() == CallType.Constants.VIDEO_CALL) {
showVideoViews();
} else {
prepareAudioCallView();
}
String uniqueId = requestCallByServerType(callRequest);
callUniqueIds.add(uniqueId);
callImpUniqueIds.add(uniqueId);
}
use of com.fanap.podchat.call.request_model.CallRequest in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method requestGroupAudioCallByContactId.
@SuppressLint("MissingPermission")
@Override
public void requestGroupAudioCallByContactId(String callName, ArrayList<Long> selectContactIds) {
view.hideContactsFragment();
view.showFabContact();
List<Invitee> invitees = new ArrayList<>();
for (Long cId : selectContactIds) {
invitees.add(new Invitee(cId, InviteType.Constants.TO_BE_USER_CONTACT_ID));
}
CallRequest request = new CallRequest.Builder().setTitle(callName).setCallType(CallType.Constants.VIDEO_CALL).setInvitees(invitees).build();
prepareAudioCallView();
callImpUniqueIds.add(chat.requestGroupCall(request));
}
use of com.fanap.podchat.call.request_model.CallRequest in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method requestGroupVideoCallByContactId.
@SuppressLint("MissingPermission")
@Override
public void requestGroupVideoCallByContactId(String callName, ArrayList<Long> selectContactIds) {
view.hideContactsFragment();
view.showFabContact();
List<Invitee> invitees = new ArrayList<>();
for (Long cId : selectContactIds) {
invitees.add(new Invitee(cId, InviteType.Constants.TO_BE_USER_CONTACT_ID));
}
CallRequest request = new CallRequest.Builder().setTitle(callName).setCallType(CallType.Constants.VIDEO_CALL).setInvitees(invitees).build();
showVideoViews();
callImpUniqueIds.add(chat.requestGroupCall(request));
}
use of com.fanap.podchat.call.request_model.CallRequest in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method requestMainOrSandboxCall.
@SuppressLint("MissingPermission")
@Override
public void requestMainOrSandboxCall(String query, boolean isGroupCall) {
try {
if (Util.isNotNullOrEmpty(query)) {
showVideoViews();
String uniqueId = "";
if (query.contains("-")) {
String[] ids = query.split("-");
List<Invitee> invitees = new ArrayList<>();
if (ids.length == 1) {
// P2P Call
Invitee invitee = new Invitee();
invitee.setId(ids[0]);
invitee.setIdType(InviteType.Constants.TO_BE_USER_ID);
invitees.add(invitee);
// request with invitee list
CallRequest callRequest = new CallRequest.Builder(invitees, BASE_CALL_TYPE).build();
uniqueId = chat.requestCall(callRequest);
view.updateStatus("Request p2p call with: " + ids[0]);
} else if (ids.length <= 5) {
for (String id : ids) {
Invitee invitee = new Invitee();
invitee.setId(id);
invitee.setIdType(InviteType.Constants.TO_BE_USER_CONTACT_ID);
invitees.add(invitee);
}
CallRequest callRequest = new CallRequest.Builder(invitees, BASE_CALL_TYPE).setTitle(GROUP_CALL_NAME_PREFIX + ids).setDescription("Generated at " + new Date().toString()).build();
uniqueId = chat.requestGroupCall(callRequest);
view.updateStatus("Request group call invitees: " + Arrays.toString(ids));
} else {
view.updateStatus("حداکثر اعضای تماس گروهی 5 نفر می باشد");
}
} else {
// Group Call with subject id
CallRequest callRequest = new CallRequest.Builder(Long.parseLong(query), BASE_CALL_TYPE).setTitle(GROUP_CALL_NAME_PREFIX + query).setDescription("Generated at " + new Date().toString()).build();
if (isGroupCall) {
uniqueId = chat.requestGroupCall(callRequest);
} else {
uniqueId = chat.requestCall(callRequest);
}
}
if (Util.isNotNullOrEmpty(uniqueId)) {
callUniqueIds.add(uniqueId);
callImpUniqueIds.add(uniqueId);
}
}
} catch (NumberFormatException e) {
view.updateStatus("Wrong format");
}
}
use of com.fanap.podchat.call.request_model.CallRequest in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method requestP2PCallWithUserId.
@SuppressLint("MissingPermission")
@Override
public void requestP2PCallWithUserId(int userId, int callType) {
List<Invitee> invitees = new ArrayList<>();
Invitee invitee = new Invitee();
invitee.setId(userId);
invitee.setIdType(InviteType.Constants.TO_BE_USER_ID);
invitees.add(invitee);
// request with invitee list
CallRequest callRequest = new CallRequest.Builder(invitees, callType).build();
if (callRequest.getCallType() == CallType.Constants.VIDEO_CALL) {
showVideoViews();
} else {
prepareAudioCallView();
}
String uniqueId = chat.requestCall(callRequest);
callUniqueIds.add(uniqueId);
callImpUniqueIds.add(uniqueId);
}
Aggregations