Types

pyVoIP has several type aliases that it stores in pyVoIP.types.

pyVoIP.types.URI_HEADER = Dict[str, Union[str, int]]

This is for URI Headers (such as To, From, Contact, etc) dictionaries in a SIPMessage.

pyVoIP.types.SOCKETS = Union[socket.socket, ssl.SSLSocket]

This is in a few places in VoIPSocket and VoIPConnection.

pyVoIP.types.KEY_PASSWORD = Union[bytes, bytearray, str, Callable[[], bytes], Callable[[], bytearray], Callable[[], str]]

This is used for TLS settings. See Python’s documentation on load_cert_chain’s password argument for more details.

pyVoIP.types.CREDENTIALS_DICT = Dict[Optional[str], Dict[Optional[str], Dict[Optional[str], Dict[str, str]]]]

This is the format of the CredentialsManager’s internal dictionary.