@@ -579,6 +579,13 @@ class OutboundClient:
self.server.logger.info("Failed to connect to FreeSWITCH")
except:
traceback.print_exc()
+ finally:
+ try:
+ if self.request.fileno() != -1:
+ self.request.close()
+ except OSError:
+ # Ignore the error if socket is already closed
+ pass
def build_call_info(self, call_id, device_id, new_device_id, destination, bucket_type, **kwargs):
caller = kwargs.get('Channel-Caller-ID-Number')