@php $recovered = ($info['event'] ?? 'down') === 'recovered'; $host = $info['hostname'] ?? 'PBX'; $trunk = $info['trunk_id'] ?? 'trunk'; $endpoint = $info['endpoint_id'] ?? $trunk; $aor = $info['aor_id'] ?? $endpoint; $fault = $info['fault'] ?? 'registration'; $reason = $info['reason'] ?? 'trunk unhealthy'; $attempts = (int) ($info['attempts'] ?? 0); $accent = $recovered ? '#16a34a' : '#dc2626'; $panelBg = $recovered ? '#f0fdf4' : '#fef2f2'; $panelBorder= $recovered ? '#bbf7d0' : '#fecaca'; $faultLabel = $fault === 'contact' ? 'No usable SIP contact on the trunk’s AOR' : 'Registration not active'; @endphp @extends('emails.layouts.base', [ 'subject' => $recovered ? ("SIP trunk recovered — " . $host) : ("SIP trunk DOWN — " . $host), 'title' => $recovered ? ("Recovered: SIP trunk '" . $trunk . "' is back") : ("Critical: SIP trunk '" . $trunk . "' is down"), 'subtitle' => $recovered ? ($host . " can route calls through this trunk again.") : ($host . " cannot route calls through this trunk — inbound and outbound via it are failing."), 'icon' => $recovered ? '✅' : '☎️', 'iconColor' => $accent, ]) @section('content')
|
{{ $recovered ? 'Service restored' : 'Immediate attention — calls are failing on this trunk' }}
{{ $faultLabel }}
|
|
|
What to check
• The PBX is already auto-retrying this trunk every minute; if it hasn't recovered, the provider or the site's internet is likely the problem.
• Confirm the provider link is up and the site has internet. • Live check: asterisk -rx "pjsip show registrations" and asterisk -rx "pjsip show aor {{ $aor }}" • Force a re-arm if needed: php artisan pbx:trunk-register-watchdog --force |
Sent by the trunk watchdog. You get one alert when a trunk goes down and one when it recovers — not a stream.
@endsection