Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve robustness of call log processing #213

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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