@extends('layouts.app') @section('content')

Live CDR Monitor

Real-time call monitoring with auto-refresh
Live
{{-- Today's Summary --}}
Total Calls Today
{{ $today_summary->total_calls ?? 0 }}
Answered
{{ $today_summary->answered_calls ?? 0 }}
Failed
{{ $today_summary->failed_calls ?? 0 }}
Avg Duration
@php $avg_duration = round((float) ($today_summary->avg_duration ?? 0), 0); if ($avg_duration > 0) { $minutes = floor($avg_duration / 60); $seconds = $avg_duration % 60; echo "{$minutes}m {$seconds}s"; } else { echo "0s"; } @endphp
{{-- Active Channels --}}
Active Channels ({{ count($active_channels) }})
Live
Channel Caller ID Called Number State Duration
No active calls
{{-- Recent Calls --}}
Recent Calls (Last 10 minutes)
Auto-refreshing
@forelse($recent_calls as $call) @empty @endforelse
Time Source Destination Duration Disposition Context
{{ \Carbon\Carbon::parse($call->calldate)->format('H:i:s') }}
{{ \Carbon\Carbon::parse($call->calldate)->format('M j') }}
{{ $call->src ?: '—' }}
@if($call->clid && $call->clid !== $call->src)
{{ $call->clid }}
@endif
{{ $call->dst ?: '—' }} @if($call->billsec > 0) {{ $call->billsec }}s
Ring: {{ $call->duration - $call->billsec }}s
@else {{ $call->duration }}s @endif
@php $disposition = strtolower($call->disposition); $badgeClass = 'bg-secondary'; if ($disposition === 'answered') { $badgeClass = 'bg-success'; } elseif (in_array($disposition, ['no answer', 'busy', 'failed'])) { $badgeClass = 'bg-danger'; } @endphp {{ ucfirst($call->disposition) }} {{ $call->dcontext }}
No recent calls in the last 10 minutes
{{-- Live polling: update the active-channels table in place every 2s (no full reload). --}} @endsection