Skip to content

Commit

Permalink
Released v1.5.6
Browse files Browse the repository at this point in the history
[FIX] Fixed blank `except:` to be `except Exception:`
[FIX] Fixed trying check timeout
  • Loading branch information
tayler6000 committed Sep 12, 2022
1 parent 090b919 commit 256130c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
author = 'Tayler J Porter'

# The full version, including alpha/beta/rc tags
release = '1.5.5'
release = '1.5.6'

master_doc = 'index'

Expand Down
2 changes: 1 addition & 1 deletion pyVoIP/RTP.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def __init__(self, assoc, inIP, inPort, outIP, outPort, sendrecv, dtmf = None):
debug(f"Selected {assoc[m]}")
self.preference = assoc[m] #Select the first available actual codec to encode with. TODO: will need to change if video codecs are ever implemented.
break
except:
except Exception:
debug(f"{assoc[m]} cannot be selected as an audio codec")

self.inIP = inIP
Expand Down
16 changes: 10 additions & 6 deletions pyVoIP/SIP.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,11 +934,15 @@ def tryingTimeoutCheck(self, response):
# when this happens, the first response you get from the server is
# SIPStatus.TRYING. This while loop tries checks every second for an updated
# response. It times out after 30 seconds.
waitTime = 0
start_time = time.monotonic()
old_timeout = self.s.gettimeout()
while response.status == SIPStatus.TRYING:
time.sleep(1)
waitTime += 1
response = SIPMessage(self.s.recv(8192))
if waitTime >= 30:
self.s.settimeout(1)
try:
response = SIPMessage(self.s.recv(8192))
except TimeoutError:
pass
self.s.settimeout(old_timeout)
if (time.monotonic() - start_time) >= 30:
raise ResponseTimeoutError("Timeout error for response, waited 30 seconds but SIPStatus is still TRYING")
return response
return response
2 changes: 1 addition & 1 deletion pyVoIP/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

__all__ = ['SIP', 'RTP', 'VoIP']

version_info = (1, 5, 5)
version_info = (1, 5, 6)

__version__ = ".".join([str(x) for x in version_info])

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name='pyVoIP',
version='1.5.5.post1',
version='1.5.6',
description='PyVoIP is a pure python VoIP/SIP/RTP library.',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 256130c

Please sign in to comment.