Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pyVoIP/SIP.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,11 @@ def genCallID(self) -> str:
return self.gen_call_id()

def gen_call_id(self) -> str:
hash = hashlib.sha256(str(self.callID.next()).encode("utf8"))
hhash = hash.hexdigest()
return f"{hhash[0:32]}@{self.myIP}:{self.myPort}"
# UUID4 instead of hashing self.callID's counter: the counter
# restarts at the same value every time a new SIPClient is
# constructed, so short-lived processes generated an identical
# Call-ID on every run. Fixes #316.
return f"{uuid.uuid4().hex}@{self.myIP}:{self.myPort}"

def lastCallID(self) -> str:
warnings.warn(
Expand Down