Search in sources :

Example 1 with CallReconnectResult

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

the class CallAsyncRequestsManager method handleOnCallConnectReceived.

public static ChatResponse<CallReconnectResult> handleOnCallConnectReceived(ChatMessage chatMessage) {
    ChatResponse<CallReconnectResult> response = null;
    try {
        response = new ChatResponse<>();
        response.setUniqueId(chatMessage.getUniqueId());
        response.setSubjectId(chatMessage.getSubjectId());
        ClientDTO clientDTO = App.getGson().fromJson(chatMessage.getContent(), ClientDTO.class);
        CallReconnectResult result = new CallReconnectResult();
        result.setCallId(chatMessage.getSubjectId());
        result.setClientId(clientDTO.getClientId());
        response.setResult(result);
    } catch (Exception e) {
        Log.wtf(TAG, e);
    }
    return response;
}
Also used : ClientDTO(com.fanap.podchat.call.model.ClientDTO) SendClientDTO(com.fanap.podchat.call.model.SendClientDTO) PodChatException(com.fanap.podchat.util.PodChatException) JsonSyntaxException(com.google.gson.JsonSyntaxException) CallReconnectResult(com.fanap.podchat.call.result_model.CallReconnectResult)

Example 2 with CallReconnectResult

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

the class CallAsyncRequestsManager method handleOnCallReconnectReceived.

public static ChatResponse<CallReconnectResult> handleOnCallReconnectReceived(ChatMessage chatMessage) {
    ChatResponse<CallReconnectResult> response = null;
    try {
        response = new ChatResponse<>();
        response.setUniqueId(chatMessage.getUniqueId());
        response.setSubjectId(chatMessage.getSubjectId());
        ClientDTO clientDTO = App.getGson().fromJson(chatMessage.getContent(), ClientDTO.class);
        CallReconnectResult result = new CallReconnectResult();
        result.setCallId(chatMessage.getSubjectId());
        result.setClientId(clientDTO.getClientId());
        response.setResult(result);
    } catch (Exception e) {
        Log.wtf(TAG, e);
    }
    return response;
}
Also used : ClientDTO(com.fanap.podchat.call.model.ClientDTO) SendClientDTO(com.fanap.podchat.call.model.SendClientDTO) PodChatException(com.fanap.podchat.util.PodChatException) JsonSyntaxException(com.google.gson.JsonSyntaxException) CallReconnectResult(com.fanap.podchat.call.result_model.CallReconnectResult)

Aggregations

ClientDTO (com.fanap.podchat.call.model.ClientDTO)2 SendClientDTO (com.fanap.podchat.call.model.SendClientDTO)2 CallReconnectResult (com.fanap.podchat.call.result_model.CallReconnectResult)2 PodChatException (com.fanap.podchat.util.PodChatException)2 JsonSyntaxException (com.google.gson.JsonSyntaxException)2