mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 19:53:56 +00:00
Wait until event socket is ready then connect to it.
If FreeSWITCH is not started yet then wait to connect to it then
This commit is contained in:
@@ -143,14 +143,18 @@
|
||||
*/
|
||||
|
||||
//reconnect to event socket
|
||||
if (!$socket) {
|
||||
echo "Not connected to even socket\n";
|
||||
if (!$socket->connected()) {
|
||||
//echo "Not connected to even socket\n";
|
||||
if ($socket->connect($event_socket_ip_address, $event_socket_port, $event_socket_password)) {
|
||||
$cmd = "event json ALL";
|
||||
$result = $socket->request($cmd);
|
||||
echo "Re-connected to event socket\n";
|
||||
|
||||
}
|
||||
else {
|
||||
echo "Unable to connect to event socket\n";
|
||||
break;
|
||||
//sleep and then attempt to reconnect
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user