Audio and Video Call issue

When we get a new build for testing Auido and Video call does not work, Is it s a inherent problem in infrastructure of the service? I am losing confidence on audio and video call.Call does not connect. Does nor ring. Does not disconnect properly.

we are using Android Sample App and SDK 2.0.3.

we reported same issue a 22 days ago as well, it improved that time but we have not tested it in between.

I got the following code from developer for the call. This the code from sample application. But we are not able to connect the calls. We even tried using 2.0.4beta1. Please help us how can we have reasonable behaviour here.

@Override
public void sendCallRequest(Context context, String contactUid, String receiverTypeUser, String callType) {

    Call call = new Call(contactUid, receiverTypeUser, callType);
    CometChat.initiateCall(call, new CometChat.CallbackListener<Call>() {
        @Override
        public void onSuccess(Call call) {
            CommonUtils.startCallIntent(context, ((User) call.getCallReceiver()), call.getType(), true, call.getSessionId());
        }

        @Override
        public void onError(CometChatException e) {
            Toast.makeText(context, e.getMessage(), Toast.LENGTH_SHORT).show();
        }

    });
}

@Override
public void addCallEventListener(Context context,String listenerId) {
CometChat.addCallListener(listenerId, new CometChat.CallListener() {
@Override
public void onIncomingCallReceived(Call call) {

            Log.d(TAG, "onIncomingCallReceived: "+call.toString());

                    if (call.getReceiverType().equals(CometChatConstants.RECEIVER_TYPE_USER)) {

                        CommonUtils.startCallIntent(context, (User) call.getCallInitiator(), call.getType(),
                                false, call.getSessionId());
                    } else if (call.getReceiverType().equals(CometChatConstants.RECEIVER_TYPE_GROUP)) {

                        CommonUtils.startCallIntent(context, (Group) call.getCallReceiver(), call.getType(),
                                false, call.getSessionId());
                    }
        }

        @Override
        public void onOutgoingCallAccepted(Call call) {

            Log.d(TAG, "onOutgoingCallAccepted: "+call.toString());
        }

        @Override
        public void onOutgoingCallRejected(Call call) {

            Log.d(TAG, "onOutgoingCallRejected: "+call.toString());
        }

        @Override
        public void onIncomingCallCancelled(Call call) {

            Log.d(TAG, "onIncomingCallCancelled: "+call.toString());
        }

    });
}

@Override
public void addCallEventListener(String callEventListener) {

    CometChat.addCallListener(callEventListener, new CometChat.CallListener() {
        @Override
        public void onIncomingCallReceived(Call call) {

            if(call.getReceiverType().equals(CometChatConstants.RECEIVER_TYPE_USER)) {

                CommonUtils.startCallIntent(context, (User) call.getCallInitiator(), call.getType(),
                        false, call.getSessionId());
            }
            else if(call.getReceiverType().equals(CometChatConstants.RECEIVER_TYPE_GROUP)) {

                CommonUtils.startCallIntent(context, (Group) call.getCallReceiver(), call.getType(),
                        false, call.getSessionId());
            }
        }
        @Override
        public void onOutgoingCallAccepted(Call call) {

        }
        @Override
        public void onOutgoingCallRejected(Call call) {

        }
        @Override
        public void onIncomingCallCancelled(Call call) {

        }
    });
}

Hi @VijayZ,

It seems like you are not performing any action or event when outgoing call is accepted. That’s the reason you are not able to connect call with each other. Please add CometChat.startCall() method in onOutgoingCallAccepted(Call call){ }.

You can refer the code below of our sample application.

@Override
public void addCallEventListener(String listener) {

    CometChat.addCallListener(listener, new CometChat.CallListener() {
        @Override
        public void onIncomingCallReceived(Call call) {
            
        }

        @Override
        public void onOutgoingCallAccepted(Call call) {

            Intent callIntent = new Intent(context, CallActivity.class);
            callIntent.putExtra(StringContract.IntentStrings.SESSION_ID, call.getSessionId());
            context.startActivity(callIntent);
            ((IncomingCallActivity) context).finish();
        }

        @Override
        public void onOutgoingCallRejected(Call call) {
            ((IncomingCallActivity) context).finish();
        }

        @Override
        public void onIncomingCallCancelled(Call call) {
            ((IncomingCallActivity) context).finish();
        }

    });
}
1 Like

we have downloaded the latest android code and tested it. it disconnects in 5 to 10 seconds. Please suggest how we can resolve this issue.

Hi @VijayZ,

Can you share the link of the latest Android code you have downloaded. Also share an error log and more details on your issue…?

using this url “https://github.com/cometchat-pro-samples/android-java-chat-app

hello @VijayZ
Can you please confirm if you are using the latest version of the sample app and also the latest version of the CometChat Android SDK

Yes we are using the latest code available on github “https://github.com/cometchat-pro-samples/android-java-chat-appand it is tested with 2.0.3 and 2.0.4beta1. But the problem is coming.

Hi, I have tested it on latest SDK with latest code it is working. Not sure what is the problem at our end.
may it is old java code or trial period expired?

we will test our code and let you know.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.