diff --git a/pyVoIP/SIP/client.py b/pyVoIP/SIP/client.py index 71d8ca6..bb4f65c 100644 --- a/pyVoIP/SIP/client.py +++ b/pyVoIP/SIP/client.py @@ -549,9 +549,9 @@ def gen_first_request(self, deregister=False) -> str: regRequest += self.__gen_from_to( "From", self.user, - self.nat.get_host(self.server), + self.server, method=method, - port=self.bind_port, + port=self.port, header_parms=f";tag={tag}", ) regRequest += self.__gen_from_to( @@ -631,9 +631,9 @@ def gen_register(self, request: SIPMessage, deregister=False) -> str: regRequest += self.__gen_from_to( "From", self.user, - self.nat.get_host(self.server), + self.server, method=method, - port=self.bind_port, + port=self.port, header_parms=f";tag={self.tagLibrary['register']}", ) regRequest += self.__gen_from_to( diff --git a/pyVoIP/SIP/message.py b/pyVoIP/SIP/message.py index 868abd1..84b4dc7 100644 --- a/pyVoIP/SIP/message.py +++ b/pyVoIP/SIP/message.py @@ -749,10 +749,8 @@ def parse_body(self, header: str, data: str) -> None: or attribute == "sendonly" or attribute == "inactive" ): - self.body["a"][ - "transmit_type" - ] = pyVoIP.RTP.TransmitType( - attribute + self.body["a"]["transmit_type"] = ( + pyVoIP.RTP.TransmitType(attribute) ) # noqa: E501 else: self.body[header] = data diff --git a/pyVoIP/regex.py b/pyVoIP/regex.py index 7251529..3525e1e 100644 --- a/pyVoIP/regex.py +++ b/pyVoIP/regex.py @@ -5,6 +5,7 @@ each search. This module holds all the compiled regex so it can be compiled once on startup, then used directly later by other modules. """ + import re