Commit 27a822ac authored by Adrian Georgescu's avatar Adrian Georgescu

Fixed decoding SIP trace payload

parent b3a8f270
...@@ -166,9 +166,10 @@ class LogManager(object, metaclass=Singleton): ...@@ -166,9 +166,10 @@ class LogManager(object, metaclass=Singleton):
direction = "RECEIVED" direction = "RECEIVED"
else: else:
direction = "SENDING" direction = "SENDING"
data = notification.data.data.decode() if isinstance(notification.data.data, bytes) else notification.data.data
buf = ["%s: Packet %d, +%s" % (direction, self._siptrace_packet_count, (notification.datetime - self._siptrace_start_time)), buf = ["%s: Packet %d, +%s" % (direction, self._siptrace_packet_count, (notification.datetime - self._siptrace_start_time)),
"%(source_ip)s:%(source_port)d -(SIP over %(transport)s)-> %(destination_ip)s:%(destination_port)d" % notification.data.__dict__, "%(source_ip)s:%(source_port)d -(SIP over %(transport)s)-> %(destination_ip)s:%(destination_port)d" % notification.data.__dict__,
notification.data.data, data,
'--'] '--']
message = '\n'.join(buf) message = '\n'.join(buf)
try: try:
...@@ -406,4 +407,4 @@ class LogManager(object, metaclass=Singleton): ...@@ -406,4 +407,4 @@ class LogManager(object, metaclass=Singleton):
message = ("%s XCAP manager client did not initialize: %s" % (notification.datetime, notification.data.error)) message = ("%s XCAP manager client did not initialize: %s" % (notification.datetime, notification.data.error))
self.log_xcap(notification, message) self.log_xcap(notification, message)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment