@php $disabled = $isAjax ? '' : 'disabled'; $key = $skip; $accountSid = config('services.twilio.accountSid'); $authToken = config('services.twilio.auth_token'); @endphp @if($callLogs) @foreach($callLogs as $callLog) @php // $notVoiceCallClass = 'not_voice_call_hide_show'; $callDetails = $callLog->details; $callDate = date_create($callDetails['Timestamp']); $numberToDisplay = $callDetails['From']; $callImageClass = 'call-inout-img'; $inOutCallImage = 'images/svg/call-incoming.svg'; $inOutCallText = 'Incoming Call'; $callBoxColor = 'call-incoming-box-color'; if($callDetails['Direction'] !== 'inbound') { $inOutCallText = 'Outgoing Call'; $numberToDisplay = $callDetails['To']; $inOutCallImage = 'images/svg/call-outgoing.svg'; $callBoxColor = 'call-outgoing-box-color'; } $recordingDuration = 0; $recordingSid = ""; if(!empty($callDetails['RecordingUrl'])) { // $notVoiceCallClass = ''; $callImageClass = 'call-voice-img'; $inOutCallImage = 'images/svg/call-voice-msg.svg'; $callBoxColor = 'call-missed-box-color'; // Parse the URL and extract the path $path = parse_url(urldecode($callDetails['RecordingUrl']), PHP_URL_PATH); // Split the path by slashes and get the last segment (RecordingSid) $pathSegments = explode('/', $path); // Log::info($pathSegments); $recordingSid = end($pathSegments); $recording = getRecordingDetails($recordingSid, $accountSid, $authToken); $recordingDuration = $recording->duration; } if(!($recordingDuration > 0)) { continue; } @endphp
{{-- --}}
{{ $numberToDisplay }}
@if(!empty($recordingDuration) && $recordingDuration > 0)
{{-- --}} 0:00  /  0:00 {{-- --}}
@else {{--
--}}

{{$inOutCallText}}

{{--
--}} @endif
{{$callDetails['Timestamp']}} {{-- {{date('d M Y, H:iA',strtotime($callDetails['Timestamp']))}} --}}
@php $key++; @endphp @endforeach @endif @if(count($callLogs) === 0)
No voice calls yet! Let's give it a spin.
@endif