In Android, if user has not granted microphone permission then during a call audio can only be received, not sent, and the app does not have access to microphone as audio source device.
When such a user makes a call, my baresip makes API call:
ua_connect_dir(ua, &call, uri, VIDMODE_OFF, SDP_RECVONLY, SDP_INACTIVE);
Thus audio dir is SDP_RECVONLY and INVITE's sdp has attribute
a=recvonly
The callee answers and 200 OK has attribute
a=sendonly
When caller receives the 200 OK, I get to log:
call: update media
stream: update 'audio'
audio: update
audio: start
opensles: opening player 16000Hz, 1channels
audio: player started with sample format S16LE
audio: Set audio encoder: AMR-WB 16000Hz 1ch
audio: start
webrtc_aecm: creating shared state: [16000 Hz, 1 channels, subframe 160 samples, num_bands 1]
opensles: opening recorder 16000Hz, 1channels
audio: start_source failed (opensles.nil): No such device
Why is baresip trying to start audio source even when it is only supposed to receive audio?
Is there a way to prevent access to the audio source device?