Skip to content

Commit

Permalink
Fix to make mypy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
jaminh committed Aug 27, 2024
1 parent 65f540a commit ef90520
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions voip_utils/sip.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ def datagram_received(self, data: bytes, addr):
caller_endpoint = None
# The From header should give us the URI used for sending SIP messages to the device
if headers.get("from") is not None:
caller_endpoint = SipEndpoint(headers.get("from"))
caller_endpoint = SipEndpoint(headers.get("from") or "")
# We can try using the Contact header as a fallback
elif headers.get("contact") is not None:
caller_endpoint = SipEndpoint(headers.get("contact"))
caller_endpoint = SipEndpoint(headers.get("contact") or "")
# If all else fails try to generate a URI based on the IP and port from the address the message came from
else:
caller_endpoint = get_sip_endpoint(caller_ip, port=caller_sip_port)
Expand Down

0 comments on commit ef90520

Please sign in to comment.