Outgoing call from mobile device to web

I have trouble with connecting between browser and mobile device. When I make a call from the web to the phone, everything works well. But when I call from device to Web, I can’t get connect.
iceconnectionstatechange listener detected peerConnection.iceConnectionState === 'checking' (or failed)
“react-native-webrtc”: “^1.75.3”,
“react-native”: “0.62.2”,

export function* initConnectionSaga(action) {
  const stream = yield select(state => state.rtc.localStream);
  const user = yield select(state => state.user);
  const sender = getSelf(user);

  socket.emit('rtc', { event: 'peer-video', sender, user: action.peer });

  const peerConnection = new RTCPeerConnection(configuration);
  peerConnection.addStream(stream);
  yield put({ type: Actions.RTC_SETUP_LISTENERS, peerConnection, peer: action.peer, sender });
  yield call(sendOffer, peerConnection, action.peer, sender, stream);
  yield put({ type: Actions.RTC_PEER_CONNECTION, peerConnection, peer: action.peer });
}


const sendOffer = (peerConnection, user, sender, stream) => {
  peerConnection.createOffer()
    .then(desc => {
      peerConnection.setLocalDescription(desc).then(() => {
        socket.emit('rtc', { event: 'offer', offer: peerConnection.localDescription, user, sender })
      });
    });
};

const sendAnswer = (peerConnection, user, sender, offer) => {
  peerConnection.setRemoteDescription(new RTCSessionDescription(offer))
    .then(() => peerConnection.createAnswer()
      .then(desc => {
        peerConnection.setLocalDescription(desc).then(() => {
          socket.emit('rtc', { event: 'answer', answer: peerConnection.localDescription, user, sender });
        });
      }));
};

const setRemoteDescription = (peerConnection, answer) => {
  const remoteDesc = new RTCSessionDescription(answer);
  peerConnection.setRemoteDescription(remoteDesc);
  return peerConnection;
};

Please, help. I sat on this problem for a week, but nothing worked out.

This is my answer sdp

 {"answer": {"sdp": "v=0

o=- 2231160617262562676 2 IN IP4 127.0.0.1

s=-

t=0 0

a=group:BUNDLE audio video

a=msid-semantic: WMS

m=audio 9 UDP/TLS/RTP/SAVPF 111 103 9 0 8 105 13 110 113 126

c=IN IP4 0.0.0.0

a=rtcp:9 IN IP4 0.0.0.0

a=ice-ufrag:UsMt

a=ice-pwd:9kmfIIyobDuj9OPKE9eHQeUK

a=ice-options:trickle

a=fingerprint:sha-256 69:CD:19:F1:4F:B7:B7:B0:D2:03:3C:51:A3:AE:72:62:B7:A7:50:D4:EC:24:13:40:E2:FB:62:4C:53:EE:D4:01

a=setup:active

a=mid:audio

a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level

a=extmap:2 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01

a=sendrecv

a=rtcp-mux

a=rtpmap:111 opus/48000/2

a=rtcp-fb:111 transport-cc

a=fmtp:111 minptime=10;useinbandfec=1

a=rtpmap:103 ISAC/16000

a=rtpmap:9 G722/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:105 CN/16000

a=rtpmap:13 CN/8000

a=rtpmap:110 telephone-event/48000

a=rtpmap:113 telephone-event/16000

a=rtpmap:126 telephone-event/8000

a=ssrc:3150712744 cname:x60BatSimjWs7UwJ

a=ssrc:3150712744 msid:- 28b4fc64-3c70-4177-b287-6c21ab642e84

a=ssrc:3150712744 mslabel:-

a=ssrc:3150712744 label:28b4fc64-3c70-4177-b287-6c21ab642e84

m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 127 125 104

c=IN IP4 0.0.0.0

a=rtcp:9 IN IP4 0.0.0.0

a=ice-ufrag:UsMt

a=ice-pwd:9kmfIIyobDuj9OPKE9eHQeUK

a=ice-options:trickle

a=fingerprint:sha-256 69:CD:19:F1:4F:B7:B7:B0:D2:03:3C:51:A3:AE:72:62:B7:A7:50:D4:EC:24:13:40:E2:FB:62:4C:53:EE:D4:01

a=setup:active

a=mid:video

a=extmap:14 urn:ietf:params:rtp-hdrext:toffset

a=extmap:13 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time

a=extmap:3 urn:3gpp:video-orientation

a=extmap:2 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01

a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay

a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type

a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing

a=extmap:8 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07

a=extmap:9 http://www.webrtc.org/experiments/rtp-hdrext/color-space

a=sendrecv

a=rtcp-mux

a=rtcp-rsize

a=rtpmap:96 VP8/90000

a=rtcp-fb:96 goog-remb

a=rtcp-fb:96 transport-cc

a=rtcp-fb:96 ccm fir

a=rtcp-fb:96 nack

a=rtcp-fb:96 nack pli

a=rtpmap:97 rtx/90000

a=fmtp:97 apt=96

a=rtpmap:98 VP9/90000

a=rtcp-fb:98 goog-remb

a=rtcp-fb:98 transport-cc

a=rtcp-fb:98 ccm fir

a=rtcp-fb:98 nack

a=rtcp-fb:98 nack pli

a=fmtp:98 profile-id=0

a=rtpmap:99 rtx/90000

a=fmtp:99 apt=98

a=rtpmap:100 H264/90000

a=rtcp-fb:100 goog-remb

a=rtcp-fb:100 transport-cc

a=rtcp-fb:100 ccm fir

a=rtcp-fb:100 nack

a=rtcp-fb:100 nack pli

a=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f

a=rtpmap:101 rtx/90000

a=fmtp:101 apt=100

a=rtpmap:127 red/90000

a=rtpmap:125 rtx/90000

a=fmtp:125 apt=127

a=rtpmap:104 ulpfec/90000

a=ssrc-group:FID 4038384048 284955246

a=ssrc:4038384048 cname:x60BatSimjWs7UwJ

a=ssrc:4038384048 msid:- a7319e7c-1422-4038-8ce5-fbf5305ff2ed

a=ssrc:4038384048 mslabel:-

a=ssrc:4038384048 label:a7319e7c-1422-4038-8ce5-fbf5305ff2ed

a=ssrc:284955246 cname:x60BatSimjWs7UwJ

a=ssrc:284955246 msid:- a7319e7c-1422-4038-8ce5-fbf5305ff2ed

a=ssrc:284955246 mslabel:-

a=ssrc:284955246 label:a7319e7c-1422-4038-8ce5-fbf5305ff2ed

", "type": "answer"}, "event": "answer", "sender": {"_id": "5ebe69f31b90311523a847f3", "firstName": "test", "lastName": "user", "username": "testuser1"}, "user": {"_id": "5ecd1c0dda5f42049bc592bf", "firstName": "R", "lastName": "S", "username": "u3"}}

These logs show ice-candidates (from ‘web’ to ‘android’)

rtc {"candidate": {"candidate": "candidate:3408252663 1 udp 2122260223 192.168.68.105 54489 typ host generation 0 ufrag UsMt network-id 1 network-cost 10", "sdpMLineIndex": 0, "sdpMid": "audio"}, "event": "ice-candidate", "sender": {"_id": "5ebe69f31b90311523a847f3", "firstName": "test", "lastName": "user", "username": "testuser1"}, "user": {"_id": "5ecd1c0dda5f42049bc592bf", "firstName": "R", "lastName": "S", "username": "u3"}}

[Tue Jun 02 2020 23:30:27.609]  **LOG**  ON ice-candidate

[Tue Jun 02 2020 23:30:27.612]  **LOG**  rtc {"candidate": {"candidate": "candidate:128512356 1 udp 1686052607 195.69.85.97 54489 typ srflx raddr 192.168.68.105 rport 54489 generation 0 ufrag UsMt network-id 1 network-cost 10", "sdpMLineIndex": 0, "sdpMid": "audio"}, "event": "ice-candidate", "sender": {"_id": "5ebe69f31b90311523a847f3", "firstName": "test", "lastName": "user", "username": "testuser1"}, "user": {"_id": "5ecd1c0dda5f42049bc592bf", "firstName": "R", "lastName": "S", "username": "u3"}}

[Tue Jun 02 2020 23:30:27.616]  **LOG**  ON ice-candidate

[Tue Jun 02 2020 23:30:27.621]  **LOG**  rtc {"candidate": {"candidate": "candidate:2242261511 1 tcp 1518280447 192.168.68.105 9 typ host tcptype active generation 0 ufrag UsMt network-id 1 network-cost 10", "sdpMLineIndex": 0, "sdpMid": "audio"}, "event": "ice-candidate", "sender": {"_id": "5ebe69f31b90311523a847f3", "firstName": "test", "lastName": "user", "username": "testuser1"}, "user": {"_id": "5ecd1c0dda5f42049bc592bf", "firstName": "R", "lastName": "S", "username": "u3"}}

[Tue Jun 02 2020 23:30:27.625]  **LOG**  ON ice-candidate

[Tue Jun 02 2020 23:30:27.631]  **LOG**  rtc {"candidate": {"candidate": "candidate:3503072074 1 udp 41885439 51.77.213.241 50283 typ relay raddr 195.69.85.97 rport 54489 generation 0 ufrag UsMt network-id 1 network-cost 10", "sdpMLineIndex": 0, "sdpMid": "audio"}, "event": "ice-candidate", "sender": {"_id": "5ebe69f31b90311523a847f3", "firstName": "test", "lastName": "user", "username": "testuser1"}, "user": {"_id": "5ecd1c0dda5f42049bc592bf", "firstName": "R", "lastName": "S", "username": "u3"}}

[Tue Jun 02 2020 23:30:27.647]  **LOG**  ON ice-candidate

[Tue Jun 02 2020 23:30:27.654]  **LOG**  iceconnectionstatechange event "checing"

[Tue Jun 02 2020 23:30:27.659]  **LOG**  addstream

Please, guys!
Maybe one of you has this problem and you were able to find its cause or (in the ideal case) its solution :exploding_head: :exploding_head: :exploding_head:

I can give you any logs, package versions, code snippets and other))

Hello.
I have same issue.
I’m realising connection between my react-native application and peer-calls web service that uses webrtc too. When call started from browser and then I connect to this from phone it not working.
Tested on ios

Try adding these options in createOffer:

peerConnection.createOffer({
      offerToReceiveAudio: true,
      offerToReceiveVideo: true,
    });