Skip to content

Commit

Permalink
Improve robustness by isolating cel interpretation errors from differ…
Browse files Browse the repository at this point in the history
…ent linkedid groups
  • Loading branch information
DrPyser committed Dec 9, 2024
1 parent bf4da52 commit 0d0d7f3
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions wazo_call_logd/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,20 +249,28 @@ def call_logs_from_cel(self, cels: list[CEL]) -> list[CallLog]:

interpretor = self._get_interpretor(cels_by_call)
logger.debug('interpreting cels using %s', interpretor.__class__.__name__)
call_log = interpretor.interpret_cels(cels_by_call, call_log)

self._remove_duplicate_participants(call_log)
self._fetch_participants(call_log)
self._ensure_tenant_uuid_is_set(call_log)
self._fill_extensions_from_participants(call_log)
self._remove_incomplete_recordings(call_log)

try:
result.append(call_log.to_call_log())
except InvalidCallLogException as e:
logger.debug(
'Invalid call log detected(linkedids %s): %s', linkedids, e
call_log = interpretor.interpret_cels(cels_by_call, call_log)

self._remove_duplicate_participants(call_log)
self._fetch_participants(call_log)
self._ensure_tenant_uuid_is_set(call_log)
self._fill_extensions_from_participants(call_log)
self._remove_incomplete_recordings(call_log)

try:
result.append(call_log.to_call_log())
except InvalidCallLogException as e:
logger.debug(
'Invalid call log detected(linkedids %s): %s', linkedids, e
)
except Exception as e:
logger.exception(
'CEL interpretation failure for linkedid group %s: %s', linkedids, e
)
# this CEL sequence failed to be interpreted,
# but the next one should be given a chance
continue

return result

Expand Down

0 comments on commit 0d0d7f3

Please sign in to comment.