Proje: Okul Platform · Hub: Okul Platform — Architecture
Endpoint
POST /webhooks/sonitel/inbound-call — WebhookAuthMiddleware:sonitel
Request Parametreleri
caller_number— Arayan kişinin numarasıcalled_number— Aranan numara (okul inbound numarası)calllog_id— Sonitel arama log ID
handleIncomingB2CCall Akışı
SonitelService::handleIncomingB2CCall(
caller_number, // Arayan
called_number, // Aranan (okul inbound)
calllog_id
)
Döner:
lead— Oluşturulan Leadcall_log— SchoolInboundCallLogschool— Hangi okul (called_number üzerinden)user— Arayan kullanıcı (varsa DB’de)school_contacts_lead_forward— Aramanın yönlendirileceği kişilercallback_url— Sonitel’e geri bildirim URL
Response
{
"user_id": 123,
"caller_number": "05362238422",
"callee": "05332221100", // İlk yönlendirilecek
"callee2": "05332221101", // İkinci yönlendirilecek
"is_transfer": true,
"url": "callback url",
"call_log_id": 456,
"announcement_type": 1,
"is_valid_number": true // Okul bulundu mu
}is_valid_number: Okul bulunamadı → false (geçersiz/bilinmeyen inbound numara)
Test
Tests\Feature\Api\ExternalWebhooks\SonitelWebhookTest — Feature test var.
Related
- api-sonitel-call-integration — SonitelService genel akışı
- api-inbound-number-system — Inbound numara havuzu