We have an Android application that uses webview to handle our webRTC connections. Since the jun-2023 update (to version 114.x) we have been experiencing the dreaded 40 second delay when webRTC goes into ICE candidate selection.
Has anyone else seen this issue?
You are running into https://bugs.chromium.org/p/webrtc/issues/detail?id=7844
The Google STUN server you used has AAAA records for IPv6 and this times out on the machines you are looking at, probably because there is no IPv6 uplink.
Twilio's STUN server only has IPv4 A records (or rather a CNAME pointing to an A record) so no attempt is made to gather a server-reflexive IPv6 candidate.
This timeout is intentional. If you are ok with not supporting server-reflexive IPv6 candidates you should send the offer after gathering a srflx IPv4 candidate instead of waiting for the gathering state change to completed. Or rather jssip should, I'd suggest filing a bug.
Now why that behavior changed in the June 2023 update of Android WebView... possibly something DNS related.