diff --git a/lmwsip.py b/lmwsip.py index b580065..d09def2 100644 --- a/lmwsip.py +++ b/lmwsip.py @@ -137,7 +137,10 @@ send a sip command to the server """ if self._socket != None: try: - self.log.debug("LmwSip.send(%s)" % sipcmd) + logcmd = sipcmd.strip('\r') + if re.match("^LI", logcmd, re.IGNORECASE): + logcmd = re.sub(",.*", ", ******", logcmd) + self.log.debug("LmwSip.send(%s)" % logcmd) self._socket.sendall(sipcmd.encode('ascii')) except Exception as e: self.log.error("LmwSip.send(%s) failed: %s", sipcmd, e) @@ -169,9 +172,9 @@ recieve a answer from the sip server if self._socket == None: self.log.warn("LmwSip.recv: No connection") elif buf[0] != '!': - self.log.warn("LmwSip.recv: Sip error: %s" % buf) + self.log.warn("LmwSip.recv: Sip error: %s" % buf.strip('\r')) else: - self.log.debug("LmwSip.recv: result: %s" % buf) + self.log.debug("LmwSip.recv: result: %s" % buf.strip('\r')) return(buf) def login(self):