Skip to content

Commit

Permalink
Поправил пропурку запущен ли AMI.
Browse files Browse the repository at this point in the history
  • Loading branch information
boffart committed Jun 14, 2024
1 parent 7bd850d commit 875b3a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Core/Asterisk/AsteriskManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,9 @@ public function connect($server = null, $username = null, $secret = null, $event

$netStatPath = Util::which('netstat');
$busyBoxPath = Util::which('busybox');
$chkCommand = "$netStatPath -ntap | $busyBoxPath grep '$server ' | $busyBoxPath grep ESTABLISHED | $busyBoxPath grep asterisk";

$address = str_replace('127.0.0.1:', '0.0.0.0:', $server);
$chkCommand = "$netStatPath -ntap | $busyBoxPath grep '$address ' | $busyBoxPath grep LISTEN | $busyBoxPath grep asterisk";
if(Processes::mwExec($chkCommand) === 1){
SystemMessages::sysLogMsg('AMI', "Exceptions, Unable to connect to $server: the asterisk process is not running", LOG_ERR);
return false;
Expand Down

0 comments on commit 875b3a2

Please sign in to comment.