react-native-callkeep icon indicating copy to clipboard operation
react-native-callkeep copied to clipboard

Outgoing Call Never Stops "Dialing" Android

Open stephanoparaskeva opened this issue 5 years ago • 16 comments

Bug report

  • [x] I've checked the example to reproduce the issue.

  • Reproduced on:

  • [x] 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

stephanoparaskeva avatar Aug 07 '20 10:08 stephanoparaskeva

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

faizalshap avatar Aug 11 '20 15:08 faizalshap

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?

stephanoparaskeva avatar Aug 11 '20 18:08 stephanoparaskeva

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 avatar Sep 07 '20 12:09 danjenkins

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

stephanoparaskeva avatar Sep 07 '20 17:09 stephanoparaskeva

@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 avatar Sep 10 '20 08:09 ThinhVu

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

ThinhVu avatar Sep 10 '20 09:09 ThinhVu

Issue is still occuring

stephanoparaskeva avatar Nov 24 '20 19:11 stephanoparaskeva

Issue is still occuring

Because this issue has been fixed in fork repo.

ThinhVu avatar Dec 21 '20 02:12 ThinhVu

Issue is still occuring

Because this issue has been fixed in fork repo.

But this needs to be merged into master...

stephanoparaskeva avatar Dec 24 '20 22:12 stephanoparaskeva

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.

ThinhVu avatar Dec 28 '20 03:12 ThinhVu

I have the same issue, any update?

JeroenVanSteijn avatar Jun 29 '21 10:06 JeroenVanSteijn

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.

Beregit avatar Mar 29 '22 07:03 Beregit

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?

danjenkins avatar Mar 29 '22 07:03 danjenkins

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.

https://github.com/react-native-webrtc/react-native-callkeep/pull/555

Beregit avatar Mar 29 '22 07:03 Beregit

I think this issue is also related https://github.com/react-native-webrtc/react-native-callkeep/issues/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.

Beregit avatar Mar 29 '22 10:03 Beregit

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);

IuryPiva avatar Jul 17 '22 15:07 IuryPiva