mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Do not create a new socket when one is provided (#7358)
Check that the current socket in the object is false before trying to create a new socket
This commit is contained in:
@@ -144,8 +144,11 @@ class event_socket {
|
|||||||
$port = $port ?? $conf['switch.event_socket.port'] ?? $conf['event_socket.port'] ?? '8021';
|
$port = $port ?? $conf['switch.event_socket.port'] ?? $conf['event_socket.port'] ?? '8021';
|
||||||
$password = $password ?? $conf['switch.event_socket.password'] ?? $conf['event_socket.password'] ?? 'ClueCon';
|
$password = $password ?? $conf['switch.event_socket.password'] ?? $conf['event_socket.password'] ?? 'ClueCon';
|
||||||
|
|
||||||
//open the socket connection
|
//if a socket was provided in the constructor then don't create a new one
|
||||||
$this->fp = @fsockopen($host, $port, $errno, $errdesc, 3);
|
if ($this->fp === false) {
|
||||||
|
//open the socket connection
|
||||||
|
$this->fp = @fsockopen($host, $port, $errno, $errdesc, 3);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$this->connected()) {
|
if (!$this->connected()) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user