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

SIP Trunks

Add Trunk
@if (session('success')) @endif @php // Accept both $trunks (preferred) or $endpoints (legacy) $trunks = $trunks ?? $endpoints ?? collect(); @endphp
@forelse ($trunks as $t) @php // Status fields are optional; default to UNKNOWN until you wire provider/CLI checks. $s = strtoupper($t->status ?? 'UNKNOWN'); $badge = match($s) { 'REGISTERED', 'REACHABLE' => 'bg-success', 'REJECTED', 'FAILED', 'UNAVAILABLE' => 'bg-danger', 'UNKNOWN' => 'bg-secondary', default => 'bg-warning', }; $code = null; if (!empty($t->status_detail ?? null) && preg_match('/\b(\d{3})\b/', $t->status_detail, $m)) { $code = $m[1]; } $allow = $t->allow ?? null; $rtt = $t->rtt ?? null; if (is_null($rtt) && !empty($t->status_detail ?? null) && preg_match('/RTT\s+([0-9]+(?:\.[0-9]+)?)/i', $t->status_detail, $m)) { $rtt = $m[1]; } @endphp @empty @endforelse
Trunk ID Context Transport Codecs Status RTT (ms) Actions
{{ $t->id }} {{ $t->context ?? 'from-trunk' }} {{ $t->transport ?? 'transport-udp' }} @if ($allow) {{ $allow }} @else ulaw,alaw @endif {{ $s }} @if($code) • {{ $code }} @endif {{ $rtt ? $rtt : '—' }}
Edit
@csrf @method('DELETE')
No trunks found. Create your first trunk.
@endsection