<?php

return [
    /*
    |--------------------------------------------------------------------------
    | 3CX Configuration
    |--------------------------------------------------------------------------
    |
    | Static configuration for 3CX Phone System module.
    | Dynamic settings (API credentials, base URL) are stored in the database
    | via the integrations settings interface.
    |
    */
    
    // OAuth2 Protocol Settings
    'oauth2' => [
        'token_endpoint' => '/connect/token',
        'revocation_endpoint' => '/connect/revocation',
        'scopes' => 'call_control',
        'grant_type' => 'client_credentials',
    ],
    
    // WebSocket Protocol Settings
    'websocket' => [
        'endpoint' => '/callcontrol/ws',
        'connection_timeout' => 10, // seconds
        'read_timeout' => 5, // seconds for frame reads
        'verify_ssl' => false, // For self-signed certificates
    ],
    
    // Call Control API Endpoints (3CX v20)
    'endpoints' => [
        'make_call' => 'callcontrol/{extension}/makecall',
        'drop_call' => 'callcontrol/{extension}/drop',
        'answer_call' => 'callcontrol/{extension}/answer',
        'transfer_call' => 'callcontrol/{extension}/transfer',
        'call_status' => 'callcontrol/{extension}',
        'devices' => 'callcontrol/{extension}/devices',
        'device_call' => 'callcontrol/{extension}/devices/{device_id}/makecall',
    ],
    
    // Default Call Settings
    'call' => [
        'timeout' => 30, // seconds to wait for call to connect
        'retry_attempts' => 3,
        'retry_delay' => 1, // seconds between retries
    ],
    
    // Logging
    'logging' => [
        'prefix' => '[3CX]',
        'websocket_channel' => 'threecx_websocket',
    ],
];
