Skip to content

Commit

Permalink
[FIX] Make SIPClient.stop more reliable. (Implement commit a886c3a)
Browse files Browse the repository at this point in the history
  • Loading branch information
tayler6000 committed Apr 11, 2022
1 parent 5ca5c58 commit b2878a6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pyVoIP/SIP.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,10 +583,16 @@ def start(self):

def stop(self):
self.NSD = False
self.registerThread.cancel()
self.deregister()
self.s.close()
self.out.close()
if self.registerThread:
self.registerThread.cancel()
self.deregister()
self._close_sockets()

def _close_sockets(self):
if self.s:
self.s.close()
if self.out:
self.out.close()

def genCallID(self):
return hashlib.sha256(str(self.callID.next()).encode('utf8')).hexdigest()[0:32]+"@"+self.myIP+":"+str(self.myPort)
Expand Down

0 comments on commit b2878a6

Please sign in to comment.