From 36a24661f8650f342d5b11854a363a95b99b0509 Mon Sep 17 00:00:00 2001 From: hainesdev Date: Fri, 7 Aug 2026 00:11:29 -0400 Subject: [PATCH] Release pyVoIP v1.6.9 Fixes #316 [FIX] Fixed gen_call_id deriving the Call-ID from a hash of an in-process counter, which restarts at the same value every time a new SIPClient is constructed. Short-lived processes (register, place one call, exit) generated an identical Call-ID on every run, which a server still holding a stale dialog under that Call-ID then treated as a malformed retransmission instead of a new call. Switched to uuid.uuid4(), which needs no cross-run state to stay unique. --- pyVoIP/SIP.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyVoIP/SIP.py b/pyVoIP/SIP.py index 633d695..e43e6e4 100644 --- a/pyVoIP/SIP.py +++ b/pyVoIP/SIP.py @@ -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(