mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53: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';
|
||||
$password = $password ?? $conf['switch.event_socket.password'] ?? $conf['event_socket.password'] ?? 'ClueCon';
|
||||
|
||||
//open the socket connection
|
||||
$this->fp = @fsockopen($host, $port, $errno, $errdesc, 3);
|
||||
//if a socket was provided in the constructor then don't create a new one
|
||||
if ($this->fp === false) {
|
||||
//open the socket connection
|
||||
$this->fp = @fsockopen($host, $port, $errno, $errdesc, 3);
|
||||
}
|
||||
|
||||
if (!$this->connected()) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user