Skip to content

Commit 256130c

Browse files
committed
Released v1.5.6
[FIX] Fixed blank `except:` to be `except Exception:` [FIX] Fixed trying check timeout
1 parent 090b919 commit 256130c

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
author = 'Tayler J Porter'
2525

2626
# The full version, including alpha/beta/rc tags
27-
release = '1.5.5'
27+
release = '1.5.6'
2828

2929
master_doc = 'index'
3030

pyVoIP/RTP.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def __init__(self, assoc, inIP, inPort, outIP, outPort, sendrecv, dtmf = None):
217217
debug(f"Selected {assoc[m]}")
218218
self.preference = assoc[m] #Select the first available actual codec to encode with. TODO: will need to change if video codecs are ever implemented.
219219
break
220-
except:
220+
except Exception:
221221
debug(f"{assoc[m]} cannot be selected as an audio codec")
222222

223223
self.inIP = inIP

pyVoIP/SIP.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -934,11 +934,15 @@ def tryingTimeoutCheck(self, response):
934934
# when this happens, the first response you get from the server is
935935
# SIPStatus.TRYING. This while loop tries checks every second for an updated
936936
# response. It times out after 30 seconds.
937-
waitTime = 0
937+
start_time = time.monotonic()
938+
old_timeout = self.s.gettimeout()
938939
while response.status == SIPStatus.TRYING:
939-
time.sleep(1)
940-
waitTime += 1
941-
response = SIPMessage(self.s.recv(8192))
942-
if waitTime >= 30:
940+
self.s.settimeout(1)
941+
try:
942+
response = SIPMessage(self.s.recv(8192))
943+
except TimeoutError:
944+
pass
945+
self.s.settimeout(old_timeout)
946+
if (time.monotonic() - start_time) >= 30:
943947
raise ResponseTimeoutError("Timeout error for response, waited 30 seconds but SIPStatus is still TRYING")
944-
return response
948+
return response

pyVoIP/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

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

4-
version_info = (1, 5, 5)
4+
version_info = (1, 5, 6)
55

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

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name='pyVoIP',
10-
version='1.5.5.post1',
10+
version='1.5.6',
1111
description='PyVoIP is a pure python VoIP/SIP/RTP library.',
1212
long_description=long_description,
1313
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)