@php $disabled = $isAjax ? '' : 'disabled'; $paddingClass = $isAjax ? "py-3" : "pb-3"; // $loadMoreDataAttr = $isAjax ? 'onloadeddata="displayDuration(this)"' : ''; $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'; $callTypeText = 'Incoming Call'; $callBoxColor = 'call-incoming-box-color'; if($callDetails['Direction'] !== 'inbound') { $callTypeText = 'Outgoing Call'; $numberToDisplay = $callDetails['To']; $inOutCallImage = 'images/svg/call-outgoing.svg'; $callBoxColor = 'call-outgoing-box-color'; } $audioType = $audioSrc = $recordingDuration = $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; $audioType = ''; if(empty($token)) { $audioSrc = route('play-recording', ['recordingSid' => $recordingSid, 'ext' => 'mp3', 'type' => 'mpeg']); } else { $audioSrc = route('frontend.play-recording', ['token' => $token, 'recordingSid' => $recordingSid, 'ext' => 'mp3', 'type' => 'mpeg']); } } elseif(!empty($callDetails['missedCall'])) { $callTypeText = 'Missed Call'; $callImageClass = 'call-missed-img'; $inOutCallImage = 'images/svg/call-missed.svg'; $callBoxColor = 'call-missed-box-color'; } @endphp
{{$callTypeText}}
{{--