Proje: Okul Platform · Hub: Okul Platform — Architecture

Sonitel Entegrasyonu

packages/Sonitel/ — Custom HTTP client paketi
app/Integrations/Call/Sonitel/Services/SonitelService.php — İş mantığı

SonitelService İşlevleri

Ajan Girişi

$service->login(username, password)
// Döner: ['agentId' => int, 'token' => string]

Çağrı Yönlendirme (Forward)

POST /api/admin/call/b2b/forward → Gelen aramayı ilgili kişiye yönlendir

Çağrıyı Kapat (Hangup)

POST /api/admin/call/b2b/hangup → Aramayı sonlandır

Gelen Arama İşleme

Webhook: POST /webhooks/sonitel/inbound-callWebhookAuthMiddleware:sonitel ile korumalı

Inbound Call Akışı

  1. Veli inbound numarayı arar
  2. Sonitel webhook API’ye bildirim gönderir
  3. SonitelService çağrısı:
    • SchoolInboundCallLogService ile log oluşturur
    • Lead oluşturur: LeadEntryMethodType::CALL, LeadStatusType::CREATED_VIA_INBOUND, LeadRefType::AUTO_CREATED_INBOUND
    • CIO B2B event gönderir (B2BEventService)
  4. Çağrı ajanına veya okul temsilcisine yönlendirilir

İlgili Modeller

  • SchoolInboundCallLog — Arama kayıtları
  • InboundNumberPool — Numara havuzu
  • SchoolContact::inbound_number — Okula atanan inbound numara

Config’den Ajan Bilgileri

Config::SONITEL_CALL_AGENT_INFO_TYPE_KEY = 'sonitel_call_agent_info'
Config::CALL_AGENTS_KEY = 'call_agents'

Bağımlılıklar

  • Sonitel\Client (packages/Sonitel/Client.php)
  • LeadService, SchoolService, UserService, SchoolInboundCallLogService
  • B2BEventService — CIO’ya arama lead bildir