feat: switch outbound dial to Kookoo API — outbound calls now work

- Replace CloudAgent V3 tbManualDial with Kookoo outbound.php
- Simple HTTP GET with api_key — no auth issues
- Kookoo callback endpoint: POST /webhooks/kookoo/callback
  - Creates Call record in platform
  - Matches caller to Lead by phone
- Remove agent login requirement before dial
- Tested: call queued successfully, phone rang

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 18:03:44 +05:30
parent ea482d0fed
commit 6812006b53
4 changed files with 131 additions and 37 deletions

View File

@@ -64,16 +64,7 @@ export class OzonetelAgentController {
this.logger.log(`Dial request: ${body.phoneNumber} (lead: ${body.leadId ?? 'none'})`);
try {
// Ensure agent is logged in before dialing
await this.ozonetelAgent.loginAgent({
agentId: this.defaultAgentId,
password: this.defaultAgentPassword,
phoneNumber: this.defaultSipId,
mode: 'blended',
});
const result = await this.ozonetelAgent.dialCustomer({
agentId: this.defaultAgentId,
customerNumber: body.phoneNumber,
});
return result;