Vereenvoudiging reconnect mechanisme
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-10-15 19:21:39 +02:00
parent 4422dd4fe5
commit 872f77037b
2 changed files with 11 additions and 14 deletions

View File

@@ -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)

View File

@@ -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",