datso / react-native-pjsip

A PJSIP module for React Native.
http://datso.github.io/react-native-pjsip
GNU General Public License v3.0
273 stars 229 forks source link

Still incoming after call declined #161

Open ofito opened 5 years ago

ofito commented 5 years ago

Hi, I have a problem trying to decline an incoming call, I use the same actions and reducer function that the demo app:

export function declineCall(call) { return async function (dispatch, getState) { const endpoint = getState().pjsip.endpoint; endpoint.declineCall(call); } }

But after decline the call you can check that the declined call is correctly disconnected but it created a new incoming call and the phone from where I'm calling still waiting to accept or decline the call. I don't know if I'm missing something. Hang up, after accept the call, works perfectly.

I appreciate it your help.

bensurachel commented 5 years ago

Use endpoint.hangCall(call) method

Soliy0u commented 5 years ago

I have same this problem. I have used to endpoint.hangupCall(call) but not working. I think, it's an error of pjsip. Anyone can help me?. Thank you so much.

Soliy0u commented 5 years ago

I have resolved this problem with endpoint.unholdCall(call). You only use unholdCall function before call endpoint.declineCall(call). It worked for me. My code: static suspendCall() { try { const endpoint = CallCenter.endpoint ? CallCenter.endpoint : new Endpoint(); const call = CallCenter.curCallInfo; if (call) { if (!CallCenter.outgoingCallBack) { CallCenter.acceptCall(call); } endpoint.unholdCall(call); endpoint.declineCall(call); }

    } catch (error) {
    }

}