Skip to content

SAIF.Application.Services.AudioVideo.32 operations and processes

This page is the operation catalog and cross-operation hub for this library. Each operation's detailed, step-by-step logic lives in its own page under operations/.

Operation catalog

Operation Intent Trigger Inputs Outputs Rules
Import call recording Imports a CallRex call recording into the SAIF data model: validates the request, creates/reuses the Recording row, backs up and converts the audio file, verifies the result, and deletes the source from CallRex. Host application calls IAudioVideoService.ImportRecording(ImportAudioRequest) ImportAudioRequest RecordingInfo, or a thrown exception on failure BR-AV-01–BR-AV-05, BR-AV-06–BR-AV-17, BR-AV-19
Validate import request Applies FluentValidation rules to an ImportAudioRequest before any persistence or file operation occurs. Invoked as step 1 of AudioVideoService.ImportRecording ImportAudioRequest FluentValidation.Results.ValidationResult BR-AV-01–BR-AV-05
Retrieve recording status Looks up recording metadata and/or import status for a given call recording. Caller invokes AudioVideoService.GetRecordingInfo or ImportStatusManager.GetStatus Guid callRecordingId RecordingInfo (or null) / AudioImportStatusInfo BR-AV-18
Invalidate or cancel a recording Marks a recording invalid in the CallRex system and/or removes its local import-status tracking. Caller invokes AudioVideoService.InvalidateRecording or CancelImport CallRecording / Guid callRecordingId No return value (side effects only) BR-AV-19
Check claim media presence Reports whether a claim has any associated recordings, without requiring the full service dependency set. Caller invokes AudioVideoService.HasMedia(long claimId) long claimId bool —
CallRex WCF proxy operations Wraps the third-party CallRex ClientService and AgentStateService WCF endpoints for recording retrieval/control and real-time agent call-state monitoring. Invoked internally by CallRecordingSystem on behalf of AudioVideoService and other IRecordingSystem consumers Various (Guid, CallUser, RealtimeUserState) CallRecording/CallUser collections, bool success flags, CallMonitorState callbacks —

Process flow diagram

The following diagram visualizes the primary operational flow for importing a call recording.

flowchart TD
    Start([ImportRecording called]) --> Validate[Validate import request]
    Validate -->|Invalid| Fail1([Throw SaifValidationException])
    Validate -->|Valid| FindOrCreate[Find or create Recording row]
    FindOrCreate --> Backup[Backup + MD5 verify + convert audio]
    Backup --> VerifyImport[Verify import output]
    VerifyImport -->|Fails| Cleanup[Delete Recording row, set status Errored]
    Cleanup --> Fail2([Re-throw original exception])
    VerifyImport -->|Passes| DeleteSource[Delete source recording from CallRex]
    DeleteSource -->|Fails| SetErrored[Set status Errored]
    SetErrored --> Fail3([Throw ApplicationException])
    DeleteSource -->|Succeeds| Complete[Set status Completed]
    Complete --> End([Return RecordingInfo])

Failure and edge-case behavior

  • Validation failure (any of BR-AV-01–BR-AV-05) stops ImportRecording before any persistence or file operation occurs, and throws SaifValidationException.
  • If the local backup copy's MD5 hash does not match the source file (BR-AV-11), the mismatched backup is deleted and the audio conversion step is skipped for that attempt.
  • If ffmpeg conversion fails to produce a .wma file, the original recording file is copied through unconverted with no error raised (BR-AV-12).
  • If VerifyImport fails for any reason (BR-AV-13–BR-AV-15) or any other exception occurs after the Recording row was created/found, the row is deleted and import status is set to Errored before the original exception is re-thrown (BR-AV-16).
  • If the CallRex source-recording deletion fails after local processing already succeeded, import status is set to Errored and an ApplicationException is thrown, even though the local Recording row and converted file already exist (BR-AV-17).
  • Calling any AudioVideoService operation other than HasMedia on an instance constructed via the reduced (IUnitOfWork-only) constructor throws NotImplementedException (BR-AV-19).
  • GetRecordingInfo returns null (not an exception) when no matching Recording row exists.
  • ImportStatusManager.GetStatus returns a synthetic "Missing" status (not an exception) when no AudioImportStatus row exists (BR-AV-18).

Sources

  • Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoService.cs
  • Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoValidator.cs
  • Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\ImportStatusManager.cs
  • Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\RecordingSystem.cs
  • Application\SAIF.Application.Services.AudioVideo\Services\ClientProxies\ThirdParty\CallRexServiceProxy.cs
  • Application\SAIF.Application.Services.AudioVideo\Services\ClientProxies\ThirdParty\CallRexStateServiceProxy.cs