Skip to content

fix: accept sips: URIs when extracting caller info - #241

Open
darwvin-dev wants to merge 2 commits into
VoiSmart:developfrom
darwvin-dev:fix/sips-caller-info
Open

darwvin-dev wants to merge 2 commits into
VoiSmart:developfrom
darwvin-dev:fix/sips-caller-info

Conversation

@darwvin-dev

@darwvin-dev darwvin-dev commented Sep 2, 2026 •

Copy link
Copy Markdown

Problem

CallerInfo extracts the display name and remote URI from CallInfo.getRemoteUri() using two patterns, and both require a literal sip::

Pattern.compile("^\"([^\"]+).*?sip:(.*?)>$");
Pattern.compile("^.*?sip:(.*?)>$");

The string sips: does not contain the substring sip: — the characters are s, i, p, s, : — so a remote party using a SIPS URI matches neither pattern and falls into the final branch, where both displayName and remoteUri become "Unknown".

For an app registered over SIPS this means incoming calls arrive with no caller ID, and because remoteUri is also "Unknown" there is no address left to call back with. The information is lost inside the library, so consumers cannot recover it from the broadcast.

Fix

Accept either scheme with sips?:. Two characters, no behaviour change for sip: URIs.

Checked against both schemes, with and without a display name:

input displayName remoteUri
"Alice" <sip:1001@pbx.example.com> Alice 1001@pbx.example.com
"Alice" <sips:1001@pbx.example.com> Alice 1001@pbx.example.com
<sip:1001@pbx.example.com> 1001@pbx.example.com 1001@pbx.example.com
<sips:1001@pbx.example.com> 1001@pbx.example.com 1001@pbx.example.com

The first two rows and last two rows previously differed: the sips: cases returned "Unknown".

Branched from current develop.

Regression tests

Added unit coverage for all four caller-info cases described above:

  • sip: with a display name
  • sips: with a display name
  • sip: without a display name
  • sips: without a display name

The tests use a lightweight CallInfo subclass, so no native PJSIP runtime is required for the parser cases themselves.

darwvin-dev and others added 2 commits September 30, 2026 13:37
The two remote-URI patterns required a literal "sip:". The string
"sips:" does not contain "sip:", so a SIPS remote party matched
neither pattern and both the display name and the remote URI fell back
to "Unknown" -- losing caller ID and the number needed to call back.

Accept both schemes with sips?:. Behaviour for sip: URIs is unchanged.
@darwvin-dev

Copy link
Copy Markdown
Author

Hi, a gentle ping on this one when you have a moment. It's a small fix so sips: caller URIs are parsed like sip: ones, with tests for both. The Tests workflow is waiting for approval to run on this fork PR. Happy to adjust anything. Thanks!

@aenonGit

aenonGit commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

hi @darwvin-dev I will likely take it into account in the v2.20.0 while I'm currently working on the v2.19.0

This branch has not been deployed

No deployments
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.

2 participants