fix: await Ozonetel logout + per-agent sipPassword + campaign name on missed calls

Three changes:

1. Await Ozonetel logout in /auth/logout — prevents race condition when
   agent re-logs in quickly via "Remember me". The fire-and-forget
   logoutAgent() left a window where the next loginAgent() arrived
   while Ozonetel was still processing the previous logout, leaving
   the agent stuck in "Telephony Unavailable". (#559)

2. Use agentConfig.sipPassword (from Agent entity) instead of
   OZONETEL_AGENT_PASSWORD env var for login/logout/force-ready.
   The env var was a single shared credential that ignored per-agent
   passwords. Removed hardcoded "Test123$" fallback. Force-ready
   now looks up the Agent entity by ozonetelAgentId to get the
   correct sipPassword + sipExtension.

3. Missed-calls worklist query now fetches campaign { id campaignName }
   so the frontend Branch column can show the campaign name instead
   of the raw DID phone number.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-16 16:54:08 +05:30
parent a00668c517
commit 2666a10f48
3 changed files with 28 additions and 10 deletions

View File

@@ -177,6 +177,7 @@ export class WorklistService {
startedAt endedAt durationSec
disposition leadId leadName
callbackStatus callSourceNumber missedCallCount callbackAttemptedAt
campaign { id campaignName }
} } pageInfo { hasNextPage endCursor } } }`,
'calls',
authHeader,