Skip to content

Commit efb7b6f

Browse files
committed
fix: add call ID check in error_handler method
- Add a check at the beginning of the error_handler method to ensure it only processes messages for the current call. - This prevents processing errors for unrelated calls, improving the reliability and correctness of error handling in the SIP call. - The change aligns the error_handler with the message_handler, which already had this check in place.
1 parent 6ff7186 commit efb7b6f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

PySIP/sip_call.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,10 @@ async def message_handler(self, msg: SipMessage):
750750
self.dialogue.update_state(msg)
751751

752752
async def error_handler(self, msg: SipMessage):
753+
# If the call id is not same as the current then return
754+
if msg.call_id != self.call_id:
755+
return
756+
753757
if not msg.status:
754758
return
755759

0 commit comments

Comments
 (0)