Hello,
I've developed a telephony app built on Electron and SIP.js, which connects to a remote webrtc <-> SIP gateway and streams audio via webrtc.
I have a recurring issue with a crash of the entire Electron renderer process due to an error raised within the webrtc audio encoder. The error received is:
# Fatal error in: ..\..\third_party\webrtc\modules\audio_coding\codecs\cng\audio_encoder_cng.cc, line 284
# last system error: 0
# Check failed: info.encoded_bytes == 0 (160 vs. 0)
# Encoder delivered data too early.
The issue occurs when a caller is rapidly reinvited on the far side, such as when a call is redirected between voicemail to an ACD path and back to voicemail. The issue appears timing dependent and will happen about 1 out of 3 times under these conditions.
I've implemented an ugly workaround of disconnecting the remote stream from the local media element as soon as I get notified of the invite, and then reconnecting the stream 1.75 seconds later. This avoids the crash but then rapidly plays back the buffered audio which is not a good user experience.
Any help or suggestions would be greatly appreciated.
Barry