CRM/backend/app/Services/VoIP/MockProvider.php

40 خطوط
982 B
PHP

<?php
namespace App\Services\VoIP;
class MockProvider implements VoIPProviderInterface
{
public function initiateCall(string $phone, string $callerId = null): array
{
return [
'success' => true,
'provider_call_id' => 'mock_' . uniqid(),
'message' => "تماس با {$phone} در حال انجام است",
'status' => 'initiated',
];
}
public function getCallStatus(string $providerCallId): array
{
return [
'status' => 'completed',
'duration' => rand(30, 300),
'answered' => true,
];
}
public function getRecordingUrl(string $providerCallId): ?string
{
return "/recordings/{$providerCallId}.mp3";
}
public function testConnection(): array
{
return [
'ok' => true,
'message' => 'اتصال شبیه‌ساز آماده است.',
'missing' => [],
];
}
}