Skip to content

NethVoice CTI: WebRTC registration fails when the user display name starts with * #8160

Description

@edospadoni

The NethVoice CTI phone (phone-island) registers its WebRTC extension through Janus. The user's display name, taken from /user/me, is sent as display_name in the Janus SIP register request. Janus hands it to sofia-sip, which puts it in the Contact header unquoted when it only contains SIP token characters. If the name starts with *, Asterisk (PJSIP) parses the header as the wildcard contact (Contact: *), drops the whole message and never answers: the REGISTER times out after 32 seconds (408), phone-island raises the webrtc_down alert ("Connection error"), reloads and loops every 30-40 seconds. The CTI is unusable for that user. Names containing " make sofia-sip fail immediately with error 900.

Some customers name their users *<extension> - Name to show the extension in the CTI, so every user of the tenant is affected.

Steps to reproduce:

  1. In the user domain, set a user's display name to *140 - John Doe.
  2. Apply the configuration in the NethVoice admin, so that FreePBX regenerates users.json for nethcti-server (the new name reaches the CTI only after this step).
  3. Log in to NethVoice CTI with that user.

Expected behavior:
The WebRTC extension registers regardless of the characters in the display name. The display name is cosmetic: Asterisk uses the caller id configured on the endpoint, so it has no functional value.

Actual behavior:
"Connection error" is shown every ~30 seconds and the phone-island reloads in a loop. Browser console:

[REGISTER] Sending registration request {sipExten: '92140', ...}
[JANUS-GUARD] Initialization timeout (30s) - resetting isInitializing flag
Alert detected (webrtc_down or socket_down), triggering automatic reload

Janus log:

Registering user sip:92140@127.0.0.1 (auth=..., secret 127.0.0.1) @ sip:92140@127.0.0.1 through sip:127.0.0.1:20221
[92140][nua_r_register]: 408 Request Timeout

Asterisk full log (11 lines per attempt, one per retransmission):

WARNING[144] pjproject: sip_transport.c Dropping 538 bytes packet from UDP 172.16.10.70:42308 : PJSIP syntax error exception when parsing 'Contact' header on line 8 col 1

REGISTER captured on the loopback interface:

Contact: *140 - John Doe <sip:92140@172.16.10.70:54993;transport=udp>

The same happens with the Janus HTTP API alone: a register request with display_name: "*140 - John Doe" ends with registration_failed 408, the same request with display_name: "John Doe" ends with registered in less than a second. Quoting the name on the client side does not work: sofia-sip does not escape double quotes and fails with registration_failed 900.

Only the web CTI and NethLink are affected, since both embed phone-island. The mobile app registers directly through the SIP proxy and never goes through Janus.

Suggested fix:
Sanitize the display name in phone-island before sending it to Janus: strip ", \, control characters and any leading *. Workaround for affected tenants: remove the leading * from the users' display names and apply the configuration in the NethVoice admin.

Components:

  • nethesis/phone-island 1.0.14, src/lib/webrtc/messages.ts (register() sends display_name: name || '')
  • NethVoice 1.7.8 (nethvoice-cti 0.15.28), Janus 1.4.2, Asterisk 18.26.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

nethvoiceBug or features releted to the NethVoice projectnethvoice-ctiThe issue is related to NethLink (NethVoice Web client)

Type

Projects

  • Status
    In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions