Skip to content

Can't end calls on web with SIPUAHelper's hangup #537

Open
@IvoB1987

Description

@IvoB1987

Describe the bug
Can't end calls on web

To Reproduce
Steps to reproduce the behavior:

  1. Start a call
  2. Use SIPUAHelper's call.hangup method to end the call

Expected behavior
That it ends the call

System Infomation()
Flutter SDK Version: Flutter (Channel stable, 3.22.2)
sip_ua verisons 1.0.1
Target OS and Version: Chrome Version 135.0.7049.42 (Official Build) (64-bit)
Host OS and Version: Microsoft Windows [Version 10.0.26100.3476]

Stacktrace:

DartError: Unexpected null value.
../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 296:3                       throw_
../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 586:18                  nullCheck
../packages/dart_webrtc/src/rtc_peerconnection_impl.dart 336:68                                      <fn>
../dart-sdk/lib/internal/iterable.dart 425:31                                                        elementAt
../dart-sdk/lib/internal/iterable.dart 354:26                                                        moveNext
../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 918:20                  next
../dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 483:14                                of
../dart-sdk/lib/internal/iterable.dart 224:7                                                         toList
../packages/dart_webrtc/src/rtc_peerconnection_impl.dart 336:64                                      getLocalStreams
../packages/sip_ua/src/sip_ua_helper.dart 562:35                                                     hangup

From what I understand WebRTC's RTCPeerConnection API no longer supports getLocalStreams() on web so it shouldn't be used anymore, but I'm not sure. I was able to workaround it by just calling call.session.terminate(); instead but I'm not sure if that's the best way to do it. The bug seems to be introduced with version 1.0.0 of sip_ua where the if (peerConnection != null) block was introduced in the hangup function

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions