Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outgoing Call Never Stops "Dialing" Android #257

Open
2 tasks done
stephanoparaskeva opened this issue Aug 7, 2020 · 16 comments · Fixed by ThinhVu/rn-call-keep#1
Open
2 tasks done

Outgoing Call Never Stops "Dialing" Android #257

stephanoparaskeva opened this issue Aug 7, 2020 · 16 comments · Fixed by ThinhVu/rn-call-keep#1
Labels
android question Further information is requested

Comments

@stephanoparaskeva
Copy link

stephanoparaskeva commented Aug 7, 2020

Bug report

  • I've checked the example to reproduce the issue.

  • Reproduced on:

  • Android

Description

I call RNCallKeep.startCall(id, name, name) and the outgoing call begins. The android device displays "Dialling". When the callee accepts the call, the RNCallKeep.backToForeground() successfully runs. But the call is still in "Dialling" mode.

I've tried calling many different functions before/after the "RNCallKeep.backToForeground()" Call:

  • RNCallKeep.setCurrentCallActive(uuid)
  • RNCallKeep.updateDisplay(id, foo, bar)
  • RNCallKeep.answerIncomingCall(id)

None Have Worked

@faizalshap
Copy link

faizalshap commented Aug 11, 2020

RNCallKeep.setCurrentCallActive(uuid) should work make sure that the id match

@stephanoparaskeva
Copy link
Author

stephanoparaskeva commented Aug 11, 2020

RNCallKeep.setCurrentCallActive(uuid) should work make sure that the id match

I've tried RNCallKeep.setCurrentCallActive(uuid) and have made sure that the Id's match. It still did not work. What else could be the problem?

@danjenkins
Copy link
Collaborator

Hi @stephanoparaskeva - what kind of uuid are you using? Firstly don't call backToForeground yet - just get the call into an answered state.

Have you looked at the logs from android ?

@danjenkins danjenkins added android question Further information is requested labels Sep 7, 2020
@stephanoparaskeva
Copy link
Author

Hi @stephanoparaskeva - what kind of uuid are you using? Firstly don't call backToForeground yet - just get the call into an answered state.

Have you looked at the logs from android ?

The library is called uuid and is imported like this:

import { v4 as uuid } from 'uuid';

The logs for android are far too flooded and have way too much information for me to decipher.
The problem doesn't seem to be 'backToForeground' as the issue persists even if I remove that and simply add 'setCurrentCallActive':

Before (issue occurring)

  const onRemoteStreamListener = async (
    _session: Session,
    userId: number,
    stream: Stream
  ) =>
    setRemoteStreams([...remoteStreams, { userId, stream }], () => {
      InCallManager.start({ media: 'video', auto: false });
      InCallManager.setSpeakerphoneOn(true);
      RNCallKeep.backToForeground();
    });

After (issue still persists):

  const onRemoteStreamListener = async (
    _session: Session,
    userId: number,
    stream: Stream
  ) =>
    setRemoteStreams([...remoteStreams, { userId, stream }], () => {
      InCallManager.start({ media: 'video', auto: false });
      InCallManager.setSpeakerphoneOn(true);
      const id = oneTimeId();
      RNCallKeep.setCurrentCallActive(id);
    });

The complete code can be found here

@ThinhVu
Copy link

ThinhVu commented Sep 10, 2020

@danjenkins

Added log in VoiceConnectionService in callkeep
Screen Shot 2020-09-10 at 14 59 54

Js code log:
Screen Shot 2020-09-10 at 15 26 37

VoiceConnectionService log:
Screen Shot 2020-09-10 at 15 27 03

And it'll do nothing to active call
Screen Shot 2020-09-10 at 15 30 09

Further investigate: Seem like each time we startCall, new uuid will be generated and used as connection id, not the value we pass in.
Screen Shot 2020-09-10 at 15 36 54

@ThinhVu
Copy link

ThinhVu commented Sep 10, 2020

To fix this bug
Screen Shot 2020-09-10 at 16 02 10

@stephanoparaskeva
Copy link
Author

Issue is still occuring

@ThinhVu
Copy link

ThinhVu commented Dec 21, 2020

Issue is still occuring

Because this issue has been fixed in fork repo.

@stephanoparaskeva
Copy link
Author

Issue is still occuring

Because this issue has been fixed in fork repo.

But this needs to be merged into master...

@ThinhVu
Copy link

ThinhVu commented Dec 28, 2020

Issue is still occuring

Because this issue has been fixed in fork repo.

But this needs to be merged into master...

It's just a work-around. I just fix it in my fork repo because merging this fix into master branch may lead to another bugs.
Someone who have more knownledge about this project should investigate and find the root cause and fix it.

Romick2005 pushed a commit to Romick2005/react-native-callkeep that referenced this issue Apr 2, 2021
@JeroenVanSteijn
Copy link

I have the same issue, any update?

@Beregit
Copy link

Beregit commented Mar 29, 2022

Still no updates? I have the same issue and ThinhVu commit fixes it for me too. Would be nice if someone could review that and merge it into master.

@danjenkins
Copy link
Collaborator

Still no updates? I have the same issue and ThinhVu commit fixes it for me too. Would be nice if someone could review that and merge it into master.

There is no pull request into this repo from what I've seen?

@Beregit
Copy link

Beregit commented Mar 29, 2022

Still no updates? I have the same issue and ThinhVu commit fixes it for me too. Would be nice if someone could review that and merge it into master.

There is no pull request into this repo from what I've seen?

That's true. I've just created one. This is my first pull request, I hope everything is OK.

#555

@Beregit
Copy link

Beregit commented Mar 29, 2022

I think this issue is also related #436

I had that problem too, endCall listener always receives a different callUUID than what I originally passed on startCall. But if I used the original uuid passed to start to endCall() it works.

@IuryPiva
Copy link

Yeh, looking at androids code, the uuid you passed to startCall gets overridden. You can listen to didReceiveStartCallAction to update the callUUID that callKit is using.

      const onNativeCall = ({ callUUID }: { callUUID: string }) => {
        // _onOutGoingCall on android is also called when making a call from the app
        if (Platform.OS == "android") setUuid(callUUID);

      };

      RNCallKeep.addEventListener("didReceiveStartCallAction", onNativeCall);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants