Skip to content

fix: contact uri dropped in config load - #590

Open
ftsef wants to merge 4 commits into
flutter-webrtc:mainfrom
ftsef:fix-contact-uri-dropped-in-config-load
Open

fix: contact uri dropped in config load#590
ftsef wants to merge 4 commits into
flutter-webrtc:mainfrom
ftsef:fix-contact-uri-dropped-in-config-load

Conversation

@ftsef

@ftsef ftsef commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

The following changes fix an issue where setting the UaSettings.contact_uri had no effect anymore.

In an older version of this library contact_uri was a String

'contact_uri': (Settings src, Settings? dst) {
      dynamic contact_uri = src.contact_uri;
      if (contact_uri == null) return;
      if (contact_uri is String) {
        dynamic uri = Grammar.parse(contact_uri, 'SIP_URI');
        if (uri != -1) {
          dst!.contact_uri = uri;
        }
      }

In the latest version src.contact_uri is an URI?. Therefore checking for a String doesn't make sense anymore and leads to dst.contact_uri being always null.

ftsef and others added 4 commits August 11, 2026 13:31
SIPUAHelper.start() converts UaSettings.contact_uri (String) into a URI
via Utils.normalizeTarget before the config checks run, but the
contact_uri check only handled String values. The configured value was
silently dropped and the UA registered with a random contact user
(createRandomToken) instead of the configured one. This also made
via_host fall back to <random>.invalid instead of the contact host.

Accept URI instances in the contact_uri check and add config tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The contact_uri check only handled String values, but the field is typed
URI? and SIPUAHelper.start() already converts it via normalizeTarget.
The value was silently dropped and the UA registered with a random
contact user. Copy the URI directly and add config tests.
@ftsef ftsef changed the title Fix contact uri dropped in config load fix: contact uri dropped in config load Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant