---
title: SAIF.Application.Services.AudioVideo.32 operations and processes
summary: Business and technical operations supported by this library.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-15
library: SAIF.Application.Services.AudioVideo.32
reference_type: package
---

# 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](operations/import-call-recording.md) | 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](business-rules.md#br-av-01-required-current-user-id)–[BR-AV-05](business-rules.md#br-av-05-description-length-limit), [BR-AV-06](business-rules.md#br-av-06-default-purge-horizon-and-recording-system-code)–[BR-AV-17](business-rules.md#br-av-17-callrex-deletion-required-for-import-completion), [BR-AV-19](business-rules.md#br-av-19-reduced-constructor-operation-restriction) |
| [Validate import request](operations/validate-import-request.md) | 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](business-rules.md#br-av-01-required-current-user-id)–[BR-AV-05](business-rules.md#br-av-05-description-length-limit) |
| [Retrieve recording status](operations/retrieve-recording-status.md) | 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](business-rules.md#br-av-18-missing-import-status-default) |
| [Invalidate or cancel a recording](operations/invalidate-or-cancel-a-recording.md) | 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](business-rules.md#br-av-19-reduced-constructor-operation-restriction) |
| [Check claim media presence](operations/check-claim-media-presence.md) | 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](operations/callrex-wcf-proxy-operations.md) | 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 | — |

<!--
  STRICT: The Operation name in each catalog row MUST link to that operation's
  detail page at operations/<operation-slug>.md (never an on-page anchor). The
  step-by-step logic, per-step rule/SQL citations, and embedded dependency logic
  live in the per-operation document (see templates/operation-document.md), not
  on this hub page. The Rules column lists the primary business rules the
  operation enforces, each as a link to business-rules.md.
-->

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

```mermaid
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](business-rules.md#br-av-01-required-current-user-id)–[BR-AV-05](business-rules.md#br-av-05-description-length-limit)) 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](business-rules.md#br-av-11-backup-file-integrity-check)), 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](business-rules.md#br-av-12-audio-conversion-format)).
- If `VerifyImport` fails for any reason ([BR-AV-13](business-rules.md#br-av-13-import-verification-null-recording-check)–[BR-AV-15](business-rules.md#br-av-15-import-verification-zero-length-file-check)) 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](business-rules.md#br-av-16-import-failure-cleanup)).
- 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](business-rules.md#br-av-17-callrex-deletion-required-for-import-completion)).
- Calling any `AudioVideoService` operation other than `HasMedia` on an instance constructed via the reduced (`IUnitOfWork`-only) constructor throws `NotImplementedException` ([BR-AV-19](business-rules.md#br-av-19-reduced-constructor-operation-restriction)).
- `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](business-rules.md#br-av-18-missing-import-status-default)).

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Configuration](configuration.md)
- [Business rules](business-rules.md)
- [API reference](api/index.md)

## 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`
