[Log server history entries to history viewer database Adrian Georgescu **20120604112959 Ignore-this: 46dd92bf83f41a6bc8ad157888ea247e ] hunk ./SIPManager.py 1035 - media_types = call['media'] + media_types = ", ".join(call['media']) or 'audio' hunk ./SIPManager.py 1040 - BlinkLogger().log_info(u"Adding incoming call at %s from %s from server history" % (start_time, remote_uri)) + BlinkLogger().log_info(u"Adding incoming %s call at %s from %s from server history" % (success, start_time, remote_uri)) hunk ./SIPManager.py 1042 - NotificationCenter().post_notification('AudioCallLoggedToHistory', sender=self, data=TimestampedNotificationData(direction=direction, history_entry=False, remote_party=remote_uri, local_party=local_uri, check_contact=True)) + if 'audio' in call['media']: + direction = 'incoming' + status = 'delivered' + cpim_from = remote_uri + cpim_to = local_uri + timestamp = str(Timestamp(datetime.now(tzlocal()))) + if success == 'missed': + message = '

Missed Incoming Audio Call

' + message += '

Technicall Information

Call Id%s
From Tag%s
To Tag%s
' % (call_id, from_tag, to_tag) + media_type = 'missed-call' + else: + duration = self.get_printed_duration(start_time, end_time) + message = '

Incoming Audio Call

' + message += '

The call has been answered elsewhere' + message += '

Call duration: %s' % duration + message += '

Technicall Information

Call Id%s
From Tag%s
To Tag%s
' % (call_id, from_tag, to_tag) + media_type = 'audio' + self.add_to_chat_history(id, media_type, local_uri, remote_uri, direction, cpim_from, cpim_to, timestamp, message, status) + NotificationCenter().post_notification('AudioCallLoggedToHistory', sender=self, data=TimestampedNotificationData(direction=direction, history_entry=False, remote_party=remote_uri, local_party=local_uri, check_contact=True)) hunk ./SIPManager.py 1062 - if success == 'missed' and remote_uri not in growl_notifications.keys(): + if 'audio' in call['media'] and success == 'missed' and remote_uri not in growl_notifications.keys(): hunk ./SIPManager.py 1100 - media_types = call['media'] + media_types = ", ".join(call['media']) or 'audio' hunk ./SIPManager.py 1112 - BlinkLogger().log_info(u"Adding outgoing call at %s to %s from server history" % (start_time, remote_uri)) + BlinkLogger().log_info(u"Adding outgoing %s call at %s to %s from server history" % (success, start_time, remote_uri)) hunk ./SIPManager.py 1114 - NotificationCenter().post_notification('AudioCallLoggedToHistory', sender=self, data=TimestampedNotificationData(direction=direction, history_entry=False, remote_party=remote_uri, local_party=local_uri, check_contact=True)) + if 'audio' in call['media']: + local_uri = local_uri + remote_uri = remote_uri + direction = 'incoming' + status = 'delivered' + cpim_from = remote_uri + cpim_to = local_uri + timestamp = str(Timestamp(datetime.now(tzlocal()))) + media_type = 'audio' + if success == 'failed': + message = '

Failed Outgoing Audio Call

' + message += '

Reason: %s' % status + message += '

Technicall Information

Call Id%s
From Tag%s
To Tag%s
' % (call_id, from_tag, to_tag) + elif success == 'cancelled': + message= '

Cancelled Outgoing Audio Call

' + message += '

Technicall Information

Call Id%s
From Tag%s
To Tag%s
' % (call_id, from_tag, to_tag) + else: + duration = self.get_printed_duration(start_time, end_time) + message= '

Outgoing Audio Call

' + message += '

Call duration: %s' % duration + message += '

Technicall Information

Call Id%s
From Tag%s
To Tag%s
' % (call_id, from_tag, to_tag) + self.add_to_chat_history(id, media_type, local_uri, remote_uri, direction, cpim_from, cpim_to, timestamp, message, status) + NotificationCenter().post_notification('AudioCallLoggedToHistory', sender=self, data=TimestampedNotificationData(direction=direction, history_entry=False, remote_party=remote_uri, local_party=local_uri, check_contact=True))