1

I am implementing VoIP with Native Android WebRTC lib. I have managed to make a call from the Android app to the Browser. I can hear and talk as expected. But when I try to call from the Browser to the Android app, I am not able to hear or talk on the connected line. Creating a peerConnection, setRemoteDescription, setLocalDescription, creating an Answer all happens as expected (theoretically).

PS: I see a little icon on the top of my Android device that the microphone is in use when I make a call. But I do not see anything like this when I am receiving a call.

I was wondering if someone can help me to understand if

  1. The sdp which is set as LocalDescription after creating Answer needs the IP address and ICE candidates included in it? If yes, How do I include them as I see no ICE candidates and the IP address is 0.0.0.0 IP4
  2. Do I have to do anything specific to handle the microphone and speaker apart from using standard native WebRTC lib.
Nik
  • 2,913
  • 7
  • 40
  • 66
  • Audio permission is a Runtime permission . Do you have Audio runtime permission granted ? – ADM Oct 27 '20 at 09:25
  • Yes, I have a check for `RECORD_AUDIO` and `MODIFY_AUDIO_SETTINGS`. and only when they are granted, I start with the process. – Nik Oct 27 '20 at 09:55
  • Well you need to debug the code . Check the Audio configuration in `peerConnectionClient` . If you are unable to find the culprit then You can pick a sample from GitHub and change Searver urls and check with the sample . – ADM Oct 27 '20 at 10:01
  • Thank you. I have tried to debug the code and find the culprit. but I have no success and hence this Question. On the other hand.. can you share a sample github. – Nik Oct 27 '20 at 10:09
  • If you find the culprit then add the code block with Question . Try googling `webrtc android sample github`. – ADM Oct 27 '20 at 10:10

1 Answers1

1

For those who are facing a similar issue, here is the solution I found.

In the SDP which was created after createAnswer() and to be set as LocalDescription, I found that the value was m=audio 0.... This does not sound correct. Also, it was missing a=setup:active in the SDP.

After lots of debugging, I found that the flags options.disableEncryption = true and options.disableNetworkMonitor = true set as options while creating PeerConnectionFactory were stopping the audio. So removing these flags resolved my issue.

Nik
  • 2,913
  • 7
  • 40
  • 66