Skip to content

[mod_sofia] Put uri-parameters before the ?headers part of a URI - #3209

Closed
giavac wants to merge 2 commits into
masterfrom
gv/mod_sofia_uri_add_transport
Closed

giavac wants to merge 2 commits into
masterfrom
gv/mod_sofia_uri_add_transport

Conversation

@giavac

@giavac giavac commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Description

sofia_overcome_sip_uri_weakness() appended ;transport=<proto> and the caller's params to the end of the URI string. When the URI has a ?headers part (RFC 3261 19.1.1), such as sip:test@host?myvar=hello,
the parameters went after the ?. sofia-sip then moved them into a SIP header, which gave myvar: hello;transport=tls, and the Request-URI had no transport parameter. Remove the ?headers part before the function builds the URI, and add it again at the end, inside the closing > for the <...> form. The port= check now sees only the part before the ?, so a header that contains port= no longer stops the transport
from being added. URIs without ? give the same output as before.

Add test_sofia_overcome_sip_uri_weakness_uri_headers to test_sofia_funcs.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Code cleanup / refactor

Related Issues

Testing

  • Added/updated unit tests
  • Tested manually
  • Tested with live SignalWire credentials (if applicable)

Checklist

  • I have read the CONTRIBUTING guidelines
  • My code follows the project's style guidelines
  • I have added tests for my changes (if applicable)
  • I have updated documentation (if applicable)
  • All existing tests pass

Additional Notes

@giavac giavac closed this Oct 2, 2026
@giavac
giavac deleted the gv/mod_sofia_uri_add_transport branch October 2, 2026 13:03
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