flutter-webrtc / dart-sip-ua

A dart-lang version of the SIP UA stack.
MIT License
339 stars 269 forks source link

IceRestarts: true with mandatory offer, send invalid reinvites: #487

Closed reduxdj closed 1 month ago

reduxdj commented 1 month ago

Describe the bug Noticed several issues about the SDP body, the SDP body is invalid for reinvites (holds and unholds), the problem is that the audio stops working after hold is removed:

The failed calls are experiencing audio issues because the initial INVITE for hold:

Uses c=IN IP4 0.0.0.0 and m=audio 9, which prevents proper ICE negotiation. Omits ICE candidates, making it impossible for the remote endpoint to establish or maintain the media path. The successful calls avoid this issue by:

Maintaining valid media IP and port in the SDP even during hold (a=sendonly). Including all necessary ICE candidates, allowing seamless ICE negotiation and media path establishment upon resuming the call. Action Steps:

Modify the SIP client or server behavior to avoid using c=IN IP4 0.0.0.0 and m=audio 9. Ensure that ICE candidates are always included in the SDP, even when the call is on hold. Use a=sendonly or a=inactive to indicate hold status without altering the media address and port. By implementing these changes, you should resolve the audio failures after the last INVITE and ensure that calls resume successfully with proper audio negotiation.

System Infomation() [✓] Flutter (Channel stable, 3.22.2, on macOS 14.3 23D56 darwin-arm64, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.4) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.1) [✓] VS Code (version 1.94.2)