Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:mikopbx/Core into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jorikfon committed Nov 8, 2024
2 parents 1074f69 + 8f3f67f commit e0dde92
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Core/Asterisk/AsteriskManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1399,13 +1399,15 @@ public function getPjSipPeers(): array
$peers = [];
$result = $this->sendRequestTimeout('PJSIPShowEndpoints');
$endpoints = $result['data']['EndpointList'] ?? [];
print_r($endpoints);
foreach ($endpoints as $peer) {
if ($peer['ObjectName'] === 'anonymous') {
continue;
}
$state_array = [
'Not in use' => 'OK',
'Busy' => 'OK',
'Ringing' => 'OK'
];
$state = $state_array[$peer['DeviceState']] ?? 'UNKNOWN';
$oldAState = $peers[$peer['Auths']]['state'] ?? '';
Expand All @@ -1415,8 +1417,9 @@ public function getPjSipPeers(): array
}

$peers[$peer['Auths']] = [
'id' => $peer['Auths'],
'state' => strtoupper($state)
'id' => $peer['Auths'],
'state' => strtoupper($state),
'detailed-state' => $peer['DeviceState']
];
}
return array_values($peers);
Expand Down

0 comments on commit e0dde92

Please sign in to comment.