react-native-webrtc / react-native-callkeep

iOS CallKit framework and Android ConnectionService for React Native
ISC License
921 stars 444 forks source link

[iOS] hold/unhold issue #762

Open uhiku opened 8 months ago

uhiku commented 8 months ago

Bug report

Description

I am using jssip with callkeep to manage calls in our app and I have an issue with hold/unhold functionality. When the call is in progress and all is good trying to hold a call RNCallKeep.setOnHold(uuid, true) works but when I try to unhold it audio and microphone is not working. Only when user toggles the audio route it starts working. I've tried to leave jssip out to isolate issue. Also checked this one #80 #123 Any help is appreciated!

Steps to Reproduce

  1. Make an outbound/inbound call
  2. Set it on hold
  3. Try to unhold it and no audio is heard
  4. Change audio route (toggle speaker) and it works

Versions

- Callkeep: ^4.3.12
- React Native: ^0.72.7
- iOS: 17.2
- Android:
- Phone model: iPhone 15 Pro

Logs

N/A

mikkeldanielsen commented 8 months ago

Hi! I'm using JsSIP and react-native-callkeep and I don't have this issue.

When putting the call on hold I first call the JsSIP method for hold. Afterward RNCallKeep.setOnHold(uuid, true).

For unhold I first call JsSIP method for unhold and afterward RNCallKeep.setOnHold(uuid, false).

chanphiromsok commented 8 months ago

I also have this issue microphone can not click I did not use SIP I use firebase fcm sometime it can toggle but it rare

uhiku commented 7 months ago

Hi! I'm using JsSIP and react-native-callkeep and I don't have this issue.

When putting the call on hold I first call the JsSIP method for hold. Afterward RNCallKeep.setOnHold(uuid, true).

For unhold I first call JsSIP method for unhold and afterward RNCallKeep.setOnHold(uuid, false).

@mikkeldanielsen what versions of callkeep and jssip are you using?

mikkeldanielsen commented 7 months ago

Hi! I'm using JsSIP and react-native-callkeep and I don't have this issue. When putting the call on hold I first call the JsSIP method for hold. Afterward RNCallKeep.setOnHold(uuid, true). For unhold I first call JsSIP method for unhold and afterward RNCallKeep.setOnHold(uuid, false).

@mikkeldanielsen what versions of callkeep and jssip are you using?

Hi @uhiku. I try to keep react-native-callkeep fully updated. I use a react-native-webrtc version by @danjenkins

"react-native-webrtc": "github:nimbleape/react-native-webrtc#95ddda5f4c7919cc93fa59b18c4b937646bd13ce", "react-native-jssip": "https://github.com/avodevelopment/react-native-jssip", "react-native-callkeep": "4.3.12",

AbdulBsit commented 4 months ago

Happening with me too, mainly when

Also, the way i am doing is, on Hold action or mute action, i take action using callkeep method, and setHold or mute in webrtc track when callkeep responded with that event.

@uhiku Did you find any solution?

Irfanwani commented 4 months ago

for me, the listener for the hold is not working,

RNCallKeep.addEventListener('didToggleHoldCallAction', (data) =>
    callkeepobj.toggleHold(data, inv),
  );

And callkeepobj.toggleHold is defined as;

toggleHold(data) {
    const { callUUID, hold } = data;
    console.log(JSON.stringify(data), 'call hold from RNCALLVIEW');
    RNCallKeep.setOnHold(callUUID, hold);
  }

All the other listeners are working perfetly fine, but this is the only one where i don't get any response

L65FREAD commented 2 months ago

any updates on this? I am having the same issue on the latest version

mikkeldanielsen commented 1 month ago

for me, the listener for the hold is not working,

RNCallKeep.addEventListener('didToggleHoldCallAction', (data) =>
    callkeepobj.toggleHold(data, inv),
  );

And callkeepobj.toggleHold is defined as;

toggleHold(data) {
    const { callUUID, hold } = data;
    console.log(JSON.stringify(data), 'call hold from RNCALLVIEW');
    RNCallKeep.setOnHold(callUUID, hold);
  }

All the other listeners are working perfetly fine, but this is the only one where I don't get any response

When I receive the didToggleHoldCallAction I don't call RNCallKeep.setOnHold(callUUID, hold). When you receive didToggleHoldCallAction callkit is already on hold. So when I receive didToggleHoldCallAction I call a method within the SIP library to set the call on hold.

I use JSSIP:

RNCallKeep.addEventListener('didToggleHoldCallAction', didToggleHoldCallAction)

const didToggleHoldCallAction = ({hold, callUUID}) => {
      if(call.uuidString !== null && call.uuidString === callUUID){
        if(hold){
          if( call.call.held === false ){
            call.hold()
          }
        } else {
          call.unhold()
        }
      }
  }