ConnectyCube / connectycube-reactnative-samples

Chat and Video Chat code samples for React Native, ConnectyCube
https://connectycube.com
Apache License 2.0
124 stars 111 forks source link

CB 3.9.2 cannot hang up the call #249

Closed CMLCNL closed 2 years ago

CMLCNL commented 3 years ago

connectycube cannot hang up the call. We are using 3.9.2 but session.stop() is not working.

onEndCallAction session {"ID": "87dd8a0f-4502-4ce5-a8ab-41dfe388eac1", "acceptCallTime": 0, "answerTimer": null, "bandwidth": 0, "callType": 2, "currentUserID": 1229213, "initiatorID": 1229213, "localStream": null, "mediaParams": null, "onCallStatsReport": undefined, "onRemoteStreamListener": [Function onRemoteStreamListener], "onSessionCloseListener": undefined, "onSessionConnectionStateChangedListener": [Function onSessionConnectionStateChangedListener], "onUserNotAnswerListener": [Function onUserNotAnswerListener], "opponentsIDs": [935323], "peerConnections": {"935323": {"_dataChannelIds": [Set], "_localStreams": [Array], "_peerConnectionId": 2, "_remoteStreams": [Array], "_subscriptions": [Array], "answerTimeInterval": 0, "connectionState": "new", "delegate": [Circular], "dialingTimer": null, "iceCandidates": [Array], "iceConnectionState": "new", "iceGatheringState": "new", "released": true, "remoteSDP": null, "remoteStream": null, "sessionID": "87dd8a0f-4502-4ce5-a8ab-41dfe388eac1", "signalingState": "stable", "state": 1, "statsReportTimer": null, "type": "offer", "userID": 935323}}, "signalingProvider": {"signalingConnection": {"Parser": [Function FramedParser], "Socket": [Function Socket], "Transport": [Function ConnectionWebSocket], "_events": [Object], "_eventsCount": 10, "_maxListeners": undefined, "connect": [Function connect], "entity": [Circular], "hookOutgoing": [Function anonymous], "iqCallee": [Object], "iqCaller": [IQCaller], "jid": [JID], "mechanisms": [Array], "middleware": [Object], "options": [Object], "parser": [FramedParser], "parserListeners": [Object], "reconnect": [Reconnect], "resolve": undefined, "resourceBinding": undefined, "root": [Element], "sasl": [Object], "sessionEstablishment": undefined, "socket": [Socket], "socketListeners": [Object], "status": "online", "streamFeatures": [Object], "timeout": 2000, "transports": [Array], "websocket": undefined}}, "startCallTime": 2021-06-16T18:34:27.400Z, "state": 5}
[Wed Jun 16 2021 21:34:32.450]  LOG      STOP CALL
[Wed Jun 16 2021 21:34:32.474]  LOG      false || false
[Wed Jun 16 2021 21:34:32.494]  LOG      [VideoChat]: onIceConnectionStateCallback: closed
[Wed Jun 16 2021 21:34:32.496]  LOG      [VideoChat]: Stop, extension: {}
[Wed Jun 16 2021 21:34:32.515]  LOG      [VideoChat]: _close
[Wed Jun 16 2021 21:34:32.573]  LOG      User data:  {"called": "5B3IVCQFaCavZY5frbIcdK48UJE2", "caller": "u8OIZbATwldMBqswQSyX4QuEaZJ2"}
[Wed Jun 16 2021 21:34:32.719]  LOG      [VideoChat]: onStop. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1
[Wed Jun 16 2021 21:34:32.722]  WARN     [VideoChat]: Ignore 'onStop', there is no information about session 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1 by some reason.
[Wed Jun 16 2021 21:34:32.869]  LOG      [VideoChat]: onStop. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1
[Wed Jun 16 2021 21:34:32.872]  WARN     [VideoChat]: Ignore 'onStop', there is no information about session 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1 by some reason.
[Wed Jun 16 2021 21:34:33.266]  LOG      [VideoChat]: onStop. UserID:935323. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1
[Wed Jun 16 2021 21:34:33.269]  WARN     [VideoChat]: Ignore 'onStop', there is no information about session 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1 by some reason.
[Wed Jun 16 2021 21:34:33.270]  LOG      [VideoChat]: onStop. UserID:935323. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1
[Wed Jun 16 2021 21:34:33.270]  WARN     [VideoChat]: Ignore 'onStop', there is no information about session 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1 by some reason.
[Wed Jun 16 2021 21:34:33.382]  LOG      [VideoChat]: _dialingCallback, answerTimeInterval: 5000
[Wed Jun 16 2021 21:34:33.834]  LOG      [VideoChat]: onCall. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1. extension: 
[Wed Jun 16 2021 21:34:34.290]  LOG      User data:  null
[Wed Jun 16 2021 21:34:34.293]  LOG      User data:  null
[Wed Jun 16 2021 21:34:34.294]  LOG      result.isSuccess profile true
[Wed Jun 16 2021 21:34:34.294]  LOG      ["iYgpFUtiGDU6pMpTzAVUaO8BPGJ2", "uGCKneXzbybyeZczI0dLZnzywTH3", "5B3IVCQFaCavZY5frbIcdK48UJE2"] follows 11
[Wed Jun 16 2021 21:34:34.471]  LOG      ["iYgpFUtiGDU6pMpTzAVUaO8BPGJ2", "uGCKneXzbybyeZczI0dLZnzywTH3", "5B3IVCQFaCavZY5frbIcdK48UJE2"] follows 11
[Wed Jun 16 2021 21:34:34.502]  LOG      ["iYgpFUtiGDU6pMpTzAVUaO8BPGJ2", "uGCKneXzbybyeZczI0dLZnzywTH3", "5B3IVCQFaCavZY5frbIcdK48UJE2"] follows 11
[Wed Jun 16 2021 21:34:34.923]  LOG      USER LOGIN CB:  {"_id": "60926123f8550e007e00503b", "avatar": null, "created_at": "2020-04-02T20:51:49Z", "custom_data": null, "email": null, "external_id": null, "external_user_id": null, "facebook_id": null, "full_name": null, "id": 1229213, "last_request_at": "2021-06-16T18:30:14Z", "login": "905523940717", "phone": "905523940717", "twitter_id": null, "updated_at": "2021-06-16T18:34:33Z", "user_tags": "", "website": null}
[Wed Jun 16 2021 21:34:34.925]  LOG      USER LOGIN CB TOKEN:  {"application_id": ****, "created_at": "2021-06-16T18:34:32.762Z", "id": ******, "nonce": 9955, "token": "B54328C482ADF33839D9F8412D77487AAA19", "ts": 1623868472, "updated_at": "2021-06-16T18:34:32.762Z", "user_id": null}
[Wed Jun 16 2021 21:34:37.260]  LOG      ["iYgpFUtiGDU6pMpTzAVUaO8BPGJ2", "uGCKneXzbybyeZczI0dLZnzywTH3", "5B3IVCQFaCavZY5frbIcdK48UJE2"] follows 11
[Wed Jun 16 2021 21:34:37.265]  LOG      94c19d0be742ce6ab01ea2545fb2a5518c1dcac3044f62ca666ae9cdb8b6eaba voip token
[Wed Jun 16 2021 21:34:37.270]  LOG      Authorization status: 1
[Wed Jun 16 2021 21:34:37.439]  LOG      ["iYgpFUtiGDU6pMpTzAVUaO8BPGJ2", "uGCKneXzbybyeZczI0dLZnzywTH3", "5B3IVCQFaCavZY5frbIcdK48UJE2"] follows 11
[Wed Jun 16 2021 21:34:37.479]  LOG      ["iYgpFUtiGDU6pMpTzAVUaO8BPGJ2", "uGCKneXzbybyeZczI0dLZnzywTH3", "5B3IVCQFaCavZY5frbIcdK48UJE2"] follows 11
[Wed Jun 16 2021 21:34:37.483]  LOG      [{"subscription": {"_id": "60926200f8550e007e1bea19", "bundle_identifier": "com.supernova.teleconn", "client_identification_sequence": "94c19d0be742ce6ab01ea2545fb2a5518c1dcac3044f62ca666ae9cdb8b6eaba", "device": [Object], "environment": "development", "id": 1464668, "notification_channel": [Object], "notification_channel_id": 6, "platform_id": 1, "udid": "A48A707D-176D-4652-A3E9-BC08329EE533", "user_id": 1229213}}]
[Wed Jun 16 2021 21:34:38.489]  LOG      [VideoChat]: _dialingCallback, answerTimeInterval: 10000
[Wed Jun 16 2021 21:34:38.839]  LOG      [VideoChat]: onCall. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1. extension: 
[Wed Jun 16 2021 21:34:38.850]  LOG      [VideoChat]: onCall. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1. extension: 
[Wed Jun 16 2021 21:34:38.853]  LOG      [VideoChat]: _createPeer, iceServers: {"iceServers":[{"urls":"stun:stun.l.google.com:19302","url":"stun:stun.l.google.com:19302"},{"urls":"stun:turn.connectycube.com","url":"stun:turn.connectycube.com"},{"urls":"turn:turn.connectycube.com:5349?transport=udp","username":"connectycube","credential":"4c29501ca9207b7fb9c4b4b6b04faeb1","url":"turn:turn.connectycube.com:5349?transport=udp"},{"urls":"turn:turn.connectycube.com:5349?transport=tcp","username":"connectycube","credential":"4c29501ca9207b7fb9c4b4b6b04faeb1","url":"turn:turn.connectycube.com:5349?transport=tcp"}]}
[Wed Jun 16 2021 21:34:38.855]  LOG      [VideoChat]: RTCPeerConnection init. userID: 935323, sessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1, type: offer
[Wed Jun 16 2021 21:34:40.742]  LOG      [VideoChat]: onReject. UserID:935323. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1
[Wed Jun 16 2021 21:34:40.743]  LOG      onRejectCallListener {} {"ID": "87dd8a0f-4502-4ce5-a8ab-41dfe388eac1", "acceptCallTime": 0, "answerTimer": null, "bandwidth": 0, "callType": 2, "currentUserID": 1229213, "initiatorID": 1229213, "localStream": null, "mediaParams": null, "onCallStatsReport": undefined, "onRemoteStreamListener": [Function onRemoteStreamListener], "onSessionCloseListener": undefined, "onSessionConnectionStateChangedListener": [Function onSessionConnectionStateChangedListener], "onUserNotAnswerListener": [Function onUserNotAnswerListener], "opponentsIDs": [935323], "peerConnections": {"935323": {"_dataChannelIds": [Set], "_localStreams": [Array], "_peerConnectionId": 2, "_remoteStreams": [Array], "_subscriptions": [Array], "answerTimeInterval": 0, "connectionState": "new", "delegate": [Circular], "dialingTimer": null, "iceCandidates": [Array], "iceConnectionState": "closed", "iceGatheringState": "new", "released": true, "remoteSDP": null, "remoteStream": null, "sessionID": "87dd8a0f-4502-4ce5-a8ab-41dfe388eac1", "signalingState": "stable", "state": 7, "statsReportTimer": null, "type": "offer", "userID": 935323}}, "signalingProvider": {"signalingConnection": {"Parser": [Function FramedParser], "Socket": [Function Socket], "Transport": [Function ConnectionWebSocket], "_events": [Object], "_eventsCount": 10, "_maxListeners": undefined, "connect": [Function connect], "entity": [Circular], "hookOutgoing": [Function anonymous], "iqCallee": [Object], "iqCaller": [IQCaller], "jid": [JID], "mechanisms": [Array], "middleware": [Object], "options": [Object], "parser": [FramedParser], "parserListeners": [Object], "reconnect": [Reconnect], "resolve": undefined, "resourceBinding": undefined, "root": [Element], "sasl": [Object], "sessionEstablishment": undefined, "socket": [Socket], "socketListeners": [Object], "status": "online", "streamFeatures": [Object], "timeout": 2000, "transports": [Array], "websocket": undefined}}, "startCallTime": 2021-06-16T18:34:27.400Z, "state": 5}
[Wed Jun 16 2021 21:34:40.743]  LOG      [VideoChat]: All peer connections closed: true
[Wed Jun 16 2021 21:34:40.786]  LOG      [VideoChat]: onStop. UserID:935323. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1
[Wed Jun 16 2021 21:34:40.789]  WARN     [VideoChat]: Ignore 'onStop', there is no information about session 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1 by some reason.
[Wed Jun 16 2021 21:34:40.789]  LOG      [VideoChat]: onReject. UserID:935323. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1
[Wed Jun 16 2021 21:34:40.789]  WARN     [VideoChat]: Ignore 'onReject', there is no information about session 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1
[Wed Jun 16 2021 21:34:40.790]  LOG      [VideoChat]: onStop. UserID:935323. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1
[Wed Jun 16 2021 21:34:40.790]  WARN     [VideoChat]: Ignore 'onStop', there is no information about session 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1 by some reason.
[Wed Jun 16 2021 21:34:40.791]  LOG      [VideoChat]: onReject. UserID:935323. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1
[Wed Jun 16 2021 21:34:40.791]  WARN     [VideoChat]: Ignore 'onReject', there is no information about session 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1
[Wed Jun 16 2021 21:34:40.793]  LOG      [VideoChat]: onStop. UserID:935323. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1
[Wed Jun 16 2021 21:34:40.794]  WARN     [VideoChat]: Ignore 'onStop', there is no information about session 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1 by some reason.
[Wed Jun 16 2021 21:34:40.825]  LOG      User data:  null
[Wed Jun 16 2021 21:34:43.506]  LOG      [VideoChat]: _dialingCallback, answerTimeInterval: 15000
[Wed Jun 16 2021 21:34:43.851]  LOG      [VideoChat]: onCall. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1. extension: 
[Wed Jun 16 2021 21:34:43.856]  LOG      [VideoChat]: onCall. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1. extension: 
[Wed Jun 16 2021 21:34:43.864]  LOG      [VideoChat]: _createPeer, iceServers: {"iceServers":[{"urls":"stun:stun.l.google.com:19302","url":"stun:stun.l.google.com:19302"},{"urls":"stun:turn.connectycube.com","url":"stun:turn.connectycube.com"},{"urls":"turn:turn.connectycube.com:5349?transport=udp","username":"connectycube","credential":"4c29501ca9207b7fb9c4b4b6b04faeb1","url":"turn:turn.connectycube.com:5349?transport=udp"},{"urls":"turn:turn.connectycube.com:5349?transport=tcp","username":"connectycube","credential":"4c29501ca9207b7fb9c4b4b6b04faeb1","url":"turn:turn.connectycube.com:5349?transport=tcp"}]}
[Wed Jun 16 2021 21:34:43.866]  LOG      [VideoChat]: RTCPeerConnection init. userID: 935323, sessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1, type: offer
[Wed Jun 16 2021 21:34:48.421]  LOG      [VideoChat]: _dialingCallback, answerTimeInterval: 20000
[Wed Jun 16 2021 21:34:48.847]  LOG      [VideoChat]: onCall. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1. extension: 
[Wed Jun 16 2021 21:34:48.854]  LOG      [VideoChat]: onCall. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1. extension: 
[Wed Jun 16 2021 21:34:53.438]  LOG      [VideoChat]: _dialingCallback, answerTimeInterval: 25000
[Wed Jun 16 2021 21:34:53.950]  LOG      [VideoChat]: onCall. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1. extension: 
[Wed Jun 16 2021 21:34:53.955]  LOG      [VideoChat]: onCall. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1. extension: 
[Wed Jun 16 2021 21:34:58.457]  LOG      [VideoChat]: _dialingCallback, answerTimeInterval: 30000
[Wed Jun 16 2021 21:34:58.856]  LOG      [VideoChat]: onCall. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1. extension: 
[Wed Jun 16 2021 21:34:58.863]  LOG      [VideoChat]: onCall. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1. extension: 
[Wed Jun 16 2021 21:35:03.473]  LOG      [VideoChat]: _dialingCallback, answerTimeInterval: 35000
[Wed Jun 16 2021 21:35:03.852]  LOG      [VideoChat]: onCall. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1. extension: 
[Wed Jun 16 2021 21:35:03.858]  LOG      [VideoChat]: onCall. UserID:1229213. SessionID: 87dd8a0f-4502-4ce5-a8ab-41dfe388eac1. extension: 
ccvlad commented 3 years ago

The session was stopped:

[Wed Jun 16 2021 21:34:32.494]  LOG      [VideoChat]: onIceConnectionStateCallback: closed
[Wed Jun 16 2021 21:34:32.496]  LOG      [VideoChat]: Stop, extension: {}
[Wed Jun 16 2021 21:34:32.515]  LOG      [VideoChat]: _close

The log Ignore 'onStop'|'onReject'... shows up after you call session's methods to session that was already closed (inactive) or absents.

CMLCNL commented 3 years ago

I even looked at the logs. But unable to end call from ios to android. There is a problem here. Could you please review.

ccvlad commented 3 years ago

Please compare with your logic:

*Use session.reject() only for incomings calls (inside ConnectyCube.videochat.onCallListener).

You can check our RNVideoChat sample.

Describe your steps to clarify if I misunderstood you.

ccvlad commented 2 years ago

Closed due to inactivity. Please create a new issue if needed.