Skip to content

fix(console): stop coercing plain SIP queue targets into skill groups#227

Open
v0l wants to merge 1 commit into
restsend:mainfrom
v0l:fix/queue-sip-target-coerced-to-skill-group
Open

fix(console): stop coercing plain SIP queue targets into skill groups#227
v0l wants to merge 1 commit into
restsend:mainfrom
v0l:fix/queue-sip-target-coerced-to-skill-group

Conversation

@v0l

@v0l v0l commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

When opening the queue detail form, reconcileSkillGroupTargets() calls extractSkillGroupId() on every dial target:

const groupId = this.extractSkillGroupId(target.skill_group_id || target.uri);
if (!groupId) return;
target.skill_group_id = groupId;
target.uri = this.toSkillGroupUri(groupId); // adds "skill-group:" prefix

extractSkillGroupId() returns its input unchanged when there is no skill-group: prefix. So a plain SIP target like sip:1000@localhost is rewritten to skill-group:sip:1000@localhost and rendered as a skill-group dropdown on every (re)load — even though it was saved correctly to the DB.

This is especially confusing on deployments without the CC addon: loadSkillGroups() fetches /cc/skill-groups, gets a 404, and the res.ok ? res.json() : null branch still flows into .then(...) which calls reconcileSkillGroupTargets(). The SIP target then renders as an unresolvable skill-group, and at call time the queue logs No agent registry available to resolve custom target and immediately falls through to the fallback.

Fix

Guard the reconciliation so it only applies to targets that are actually skill groups (a skill-group: URI prefix or an explicit skill_group_id). Plain SIP targets are left untouched.

Repro

  1. Build without the CC addon (no skill-group API).
  2. Create a queue with a sequential dial target sip:1000@localhost.
  3. Reopen the queue in the console → the SIP target shows as a "Skill group" dropdown ("Select a skill group"), and inbound calls never ring the extension.

After

The SIP target renders as a SIP URI field and rings the registered extension as configured.

reconcileSkillGroupTargets() ran extractSkillGroupId() on every dial
target, but that helper returns its input unchanged when there is no
"skill-group:" prefix. As a result a plain SIP target such as
"sip:1000@localhost" was rewritten to "skill-group:sip:1000@localhost"
and rendered as a skill-group dropdown on every (re)load of the queue
detail form — even on deployments without the CC addon, where
/cc/skill-groups returns 404 and the target can never resolve.

Guard the reconciliation so it only applies to targets that are already
skill groups (skill-group: URI prefix or an explicit skill_group_id),
leaving SIP targets untouched.
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