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

How I know the call state ?

Open florindumitru opened this issue 7 years ago • 7 comments

Hi, I need to know which event can detect the call state changes. For example when a call is active or not, if destination answered .

Thanks

florindumitru avatar Sep 27 '18 06:09 florindumitru

Its in the readme to listen for events

endpoint.addListener("call_changed", (newCall) => { if (call.getId() === newCall.getId()) { // Our call changed, do smth. } }

Look at the sample app, it pretty much does most functionality: https://github.com/datso/react-native-pjsip-app/blob/master/app/modules/pjsip.js#L48

cmendes0101 avatar Sep 27 '18 12:09 cmendes0101

I already tried that and the state not change. GetState and _state remains in ringing state

florindumitru avatar Sep 27 '18 12:09 florindumitru

Did you try the other events? If so which ones did you try and which event are you exactly looking for that is not working?

cmendes0101 avatar Sep 27 '18 12:09 cmendes0101

I want to know when the call is established. I makeCall and after I need too check when deatination answer to the call to can stop the ringing

florindumitru avatar Sep 27 '18 12:09 florindumitru

Why are you not using SIP ringing?

You probably want to use call.getState() and look for PJSIP_INV_STATE_CONFIRMED. Mostly all are in the example app. Please take the time to go through and understand how that works

cmendes0101 avatar Sep 27 '18 13:09 cmendes0101

Hi @cmendes0101, I have a different problem: when calling to pjsip, the other party is not able to hear a ring. I am however able to answer the call from pjsip no problem. Here's a related issue, I'd greatly appreciate your help on this.

glocore avatar Dec 07 '18 06:12 glocore

@platonish Probably should open a separate issue instead of linking tickets that are possible not related since this was knowing call state. The other ticket sounds closer to your issue

cmendes0101 avatar Dec 07 '18 07:12 cmendes0101