138 if (artifact ==
null) {
142 BlackboardAttribute directionAttr = artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DIRECTION));
143 BlackboardAttribute toAccountAttr =
null;
144 BlackboardAttribute fromAccountAttr =
null;
145 BlackboardAttribute localAccountAttr =
null;
147 CallLogViewData callLogViewData =
null;
149 String direction =
null;
150 String fromAccountIdentifier =
null;
151 String toAccountIdentifier =
null;
152 List<String> otherParties =
null;
153 List<String> toContactNames =
null;
154 List<String> fromContactNames =
null;
156 Content dataSource = artifact.getDataSource();
157 String deviceId = ((DataSource) dataSource).getDeviceId();
159 if (directionAttr !=
null) {
160 direction = directionAttr.getValueString();
161 if (direction.equalsIgnoreCase(
"Incoming")) {
162 fromAccountAttr = ObjectUtils.firstNonNull(
163 artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_FROM)),
164 artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER)),
165 artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ID))
168 toAccountAttr = artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO));
169 localAccountAttr = artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO));
170 }
else if (direction.equalsIgnoreCase(
"Outgoing")) {
171 toAccountAttr = ObjectUtils.firstNonNull(
172 artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO)),
173 artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER)),
174 artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ID))
177 fromAccountAttr = artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_FROM));
178 localAccountAttr = artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_FROM));
183 if (fromAccountAttr ==
null) {
184 fromAccountAttr = ObjectUtils.firstNonNull(
185 artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_FROM)),
186 artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO)),
187 artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER)),
188 artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ID))
194 if (fromAccountAttr !=
null) {
195 String fromAccountAttrValue = fromAccountAttr.getValueString();
196 if (fromAccountAttrValue.equalsIgnoreCase(deviceId) ==
false) {
197 fromAccountIdentifier = fromAccountAttrValue;
202 if (toAccountAttr !=
null) {
204 String[] numbers = toAccountAttr.getValueString().split(
",");
205 String toAccountAttrValue = StringUtils.trim(numbers[0]);
206 if (toAccountAttrValue.equalsIgnoreCase(deviceId) ==
false) {
207 toAccountIdentifier = toAccountAttrValue;
213 if (numbers.length > 1) {
214 otherParties =
new ArrayList<>();
215 for (
int i = 1; i < numbers.length; i++) {
216 otherParties.add(StringUtils.trim(numbers[i]));
222 if (
null != fromAccountAttr ||
null != toAccountAttr) {
223 callLogViewData =
new CallLogViewData(fromAccountIdentifier, toAccountIdentifier);
224 callLogViewData.setDirection(direction);
226 callLogViewData.setOtherParties(otherParties);
230 callLogViewData.setDataSourceName(dataSource.getName());
233 if (localAccountAttr !=
null) {
234 String attrValue = localAccountAttr.getValueString();
236 if (attrValue.equalsIgnoreCase(deviceId) ==
false && attrValue.contains(
",") ==
false) {
237 callLogViewData.setLocalAccountId(attrValue);
243 callLogViewData.setFromContactNameList(fromContactNames);
244 callLogViewData.setToContactNameList(toContactNames);
247 .map(h -> h.getName())
250 callLogViewData.setHostName(hostName);
253 return callLogViewData;
266 private void extractTimeAndDuration(BlackboardArtifact artifact, CallLogViewData callLogViewData)
throws TskCoreException {
268 BlackboardAttribute startTimeAttr = artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START));
269 if (startTimeAttr ==
null) {
270 startTimeAttr = artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME));
272 if (startTimeAttr !=
null) {
273 long startTime = startTimeAttr.getValueLong();
274 callLogViewData.setDateTimeStr(startTimeAttr.getDisplayString());
276 BlackboardAttribute endTimeAttr = artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_END));
277 if (endTimeAttr !=
null) {
278 long endTime = endTimeAttr.getValueLong();
279 if (endTime > 0 && (endTime - startTime) > 0) {
280 callLogViewData.setDuration(String.format(
"%d seconds", (endTime - startTime)));
322 private List<AccountPersonaSearcherData>
updateView(CallLogViewData callLogViewData) {
324 CommunicationArtifactViewerHelper.addHeader(
this,
m_gridBagLayout, this.m_constraints, 0, Bundle.CallLogArtifactViewer_heading_parties());
326 List<AccountPersonaSearcherData> dataList =
new ArrayList<>();
328 if (callLogViewData.getFromAccount() !=
null) {
329 CommunicationArtifactViewerHelper.addKey(
this,
m_gridBagLayout, this.m_constraints, Bundle.CallLogArtifactViewer_label_from());
333 CommunicationArtifactViewerHelper.addValue(
this,
m_gridBagLayout, this.m_constraints, accountDisplayString);
335 List<String> contactNames = callLogViewData.getFromContactNameList();
336 for (String name : contactNames) {
341 dataList.addAll(CommunicationArtifactViewerHelper.addPersonaRow(
this,
m_gridBagLayout,
this.m_constraints, callLogViewData.getFromAccount()));
345 if (callLogViewData.getToAccount() !=
null) {
346 CommunicationArtifactViewerHelper.addKey(
this,
m_gridBagLayout, this.m_constraints, Bundle.CallLogArtifactViewer_label_to());
348 CommunicationArtifactViewerHelper.addValue(
this,
m_gridBagLayout, this.m_constraints, accountDisplayString);
350 List<String> contactNames = callLogViewData.getToContactNameList();
351 for (String name : contactNames) {
355 dataList.addAll(CommunicationArtifactViewerHelper.addPersonaRow(
this,
m_gridBagLayout,
this.m_constraints, callLogViewData.getToAccount()));
360 for (String otherParty : callLogViewData.getOtherParties()) {
361 CommunicationArtifactViewerHelper.addKey(
this,
m_gridBagLayout, this.m_constraints, Bundle.CallLogArtifactViewer_label_to());
362 CommunicationArtifactViewerHelper.addValue(
this,
m_gridBagLayout, this.m_constraints, otherParty);
364 dataList.addAll(CommunicationArtifactViewerHelper.addPersonaRow(
this,
m_gridBagLayout,
this.m_constraints, otherParty));
377 CommunicationArtifactViewerHelper.addPageEndGlue(
this,
m_gridBagLayout, this.m_constraints);
399 CommunicationArtifactViewerHelper.addKey(
this,
m_gridBagLayout, this.m_constraints, Bundle.CallLogArtifactViewer_label_direction());
400 if (callLogViewData.getDirection() !=
null) {
401 CommunicationArtifactViewerHelper.addValue(
this,
m_gridBagLayout, this.m_constraints, callLogViewData.getDirection());
403 CommunicationArtifactViewerHelper.addValue(
this,
m_gridBagLayout, this.m_constraints, Bundle.CallLogArtifactViewer_value_unknown());
406 if (callLogViewData.getDateTimeStr() !=
null) {
407 CommunicationArtifactViewerHelper.addKey(
this,
m_gridBagLayout, this.m_constraints, Bundle.CallLogArtifactViewer_label_date());
408 CommunicationArtifactViewerHelper.addValue(
this,
m_gridBagLayout, this.m_constraints, callLogViewData.getDateTimeStr());
411 if (callLogViewData.getDuration() !=
null) {
412 CommunicationArtifactViewerHelper.addKey(
this,
m_gridBagLayout, this.m_constraints, Bundle.CallLogArtifactViewer_label_duration());
413 CommunicationArtifactViewerHelper.addValue(
this,
m_gridBagLayout, this.m_constraints, callLogViewData.getDuration());
430 CommunicationArtifactViewerHelper.addKey(
this,
m_gridBagLayout, this.m_constraints, Bundle.CallLogArtifactViewer_label_hostName());
431 CommunicationArtifactViewerHelper.addValue(
this,
m_gridBagLayout, this.m_constraints, StringUtils.defaultString(callLogViewData.getHostName()));
433 CommunicationArtifactViewerHelper.addKey(
this,
m_gridBagLayout, this.m_constraints, Bundle.CallLogArtifactViewer_label_datasource());
434 CommunicationArtifactViewerHelper.addValue(
this,
m_gridBagLayout, this.m_constraints, callLogViewData.getDataSourceName());