diff --git a/lmwsip/__init__.py b/lmwsip/__init__.py index b8fad89..3ec217a 100644 --- a/lmwsip/__init__.py +++ b/lmwsip/__init__.py @@ -147,19 +147,16 @@ connects to lmw with tcp using the values of the object creation. After this time a logout is sent and a new connection is created. This prevents the 10 minute server timeout""" - if self.reconnecttime > 0: - ct = time.time() - self._connecttime - if ct > self.reconnecttime: - self.log.debug("LmwSip.reconnectcheck: reconnect after %i seconds" % ct) - # - # Disable check for the reconnect - # - self.reconnecttime = - self.reconnecttime - self.logout() - time.sleep(1) - self.connect() - self.login() - self.reconnecttime = - self.reconnecttime + if ct > self.reconnecttime: + self.log.debug("LmwSip.reconnectcheck: reconnect after %i seconds" % ct) + # + # Reset connect time to prevent reconnects + # + self._connecttime = time.time() + self.logout() + time.sleep(1) + self.connect() + self.login() def send(self, sipcmd): """send(sipcmd) diff --git a/setup.py b/setup.py index 303c5e6..4baa633 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md", "r") as fh: setuptools.setup( name="lmwsip", # Replace with your own username - version="0.0.7", + version="0.0.8", author="Marcel Nijenhof", author_email="pip@pion.xs4all.nl", description="Interface for the lmw sip protocol",