SAIF.Application.Services.AudioVideo.32 architecture¶
SAIF.Application.Services.AudioVideo.32 is the x86 build variant of the audio/video call-recording import library: it compiles the identical linked source tree as the sibling SAIF.Application.Services.AudioVideo project, orchestrating recording import, third-party CallRex integration, and NHibernate-backed persistence of import status and recording metadata for a 32-bit host process.
Responsibilities¶
- Import call recordings raised by the third-party CallRex call-recording system into the SAIF data model, including validation, local backup, audio-format conversion, and verification (
AudioVideoService.ImportRecording). - Track per-recording import status (
InProgress/Completed/Errored/Missing) viaImportStatusManager, backed by theaudio_import_statustable. - Provide a façade (
CallRecordingSystem) over two WCF client proxies (CallRexServiceProxy,CallRexStateServiceProxy) that talk to the third-party CallRexClientServiceandAgentStateServiceendpoints for recording retrieval, control (start/stop/pause/resume), invalidation/deletion, and real-time agent call-state monitoring. - Validate import requests against business rules (required claim/case numbers, description length) via
AudioVideoValidator. - Expose a lightweight, always-available query (
AudioVideoService.HasMedia) for checking whether a claim has associated recordings, usable even when the service is constructed without the full dependency set. - Provide the identical business logic and data-access surface as
SAIF.Application.Services.AudioVideo, but packaged and compiled specifically to run inside 32-bit (x86) host processes.
Component boundaries¶
Core.Contracts.AudioVideo: DTOs, event-arg classes, and enums (CallRecording,CallUser,ImportAudioRequest,RecordingInfo,CallMonitorState, etc.) — no behavior, pure data contracts consumed across all other components.Core.Services.IAudioVideoService: the public service contract implemented byAudioVideoService; defines the orchestration boundary consumed by host applications.Services.Utilities.AudioVideo.AudioVideoService: the orchestration/business-logic entry point. ComposesIUnitOfWork(persistence),IEnvironmentService(configuration),IImportStatusManager(status tracking),IRecordingSystem(third-party recording system abstraction), andIConsoleLogService(logging).Services.Utilities.AudioVideo.AudioVideoValidator: a FluentValidation validator invoked synchronously at the start ofImportRecording, isolating input-validation rules from orchestration logic.Services.Utilities.AudioVideo.CallRecordingExtensions: centralizes two small pure-function business rules (IsDiscoverable,GetDescription) shared between the validator and the service, avoiding duplicated rule logic.Services.Utilities.AudioVideo.ImportStatusManager: a small NHibernate-repository-backed implementation ofIImportStatusManager, isolated fromAudioVideoServiceso import-status tracking can be reasoned about independently.Services.Utilities.AudioVideo.CallRecordingSystem(implementsIRecordingSystem): the sole third-party integration façade; composesCallRexServiceProxyandCallRexStateServiceProxyand hides WCF proxy/channel details fromAudioVideoService.Services.ClientProxies.ThirdParty.CallRexServiceProxy/CallRexStateServiceProxy/AgentStateCallback: thin wrappers around the generated WCF service-reference proxies (Core.ThirdParty.CallRex,Core.ThirdParty.CallRexAgentState), isolating SOAP/WCF plumbing (custom auth headers, duplex callbacks) from the rest of the library.Data.Model.AudioVideo/Data.NHibernate.Mappings.AudioVideo: NHibernate entities (AudioImportStatus,Recording, both extendingEntityBase<T>fromSAIF.Framework.Common) and their FluentNHibernateClassMap<T>mappings, forming the persistence boundary consumed only throughIUnitOfWork/IRepository<T>.
Interaction model¶
- A host application (batch job, service, or console process) resolves
IAudioVideoServiceand callsImportRecording(ImportAudioRequest).AudioVideoServicefirst delegates validation toAudioVideoValidator, then coordinates persistence (IUnitOfWork/IRepository<Recording>), local file operations (backup copy, MD5 verification, ffmpeg-based conversion via the vendoredMediaToolkitpackage), and third-party deletion (IRecordingSystem.DeleteRecording) before reporting status throughIImportStatusManager. CallRecordingSystemis called byAudioVideoService(and otherIRecordingSystemconsumers) and internally routes each call to eitherCallRexServiceProxy(request/response SOAP operations against the CallRexClientService) orCallRexStateServiceProxy(duplex/callback-based real-time agent-state monitoring against the CallRexAgentStateService).CallRexServiceProxyauthenticates once at construction (Login) and re-attaches the same hard-coded credentials as custom SOAP headers on every subsequent state-changing call viaAuthorizeClientServiceCall.ImportStatusManagerand the entity-mapped repositories (Recording,AudioImportStatus) are called synchronously and transactionally (_uow.Begin()/_uow.Commit()) from withinAudioVideoService.ImportRecording; there is no asynchronous or message-based interaction inside this library.- No consuming application project was found within this repository's scope that references this library directly; it is packaged as a standalone NuGet library consumed by an as-yet-undetermined 32-bit host application elsewhere in the SAIF application estate.
Architecture diagram¶
The following diagram shows the high-level component interactions inside this library and its principal external and framework dependencies.
flowchart TD
Host["Host application<br>(32-bit process)"] --> AVS["AudioVideoService<br>(IAudioVideoService)"]
AVS --> Validator["AudioVideoValidator"]
AVS --> Ext["CallRecordingExtensions"]
AVS --> UOW["IUnitOfWork / IRepository<T><br>(SAIF.Framework.Core)"]
AVS --> ISM["ImportStatusManager<br>(IImportStatusManager)"]
AVS --> RS["CallRecordingSystem<br>(IRecordingSystem)"]
AVS --> MTK["MediaToolkit (ffmpeg)"]
ISM --> UOW
RS --> Proxy1["CallRexServiceProxy"]
RS --> Proxy2["CallRexStateServiceProxy"]
Proxy1 --> CallRex["CallRex ClientService<br>(third-party WCF)"]
Proxy2 --> AgentState["CallRex AgentStateService<br>(third-party WCF, duplex)"]
UOW --> NH32["SAIF.Framework.Data.NHibernate.32<br>(bundles x86 Oracle.DataAccess.dll)"]
NH32 --> Oracle[("Oracle database")]
Sequence diagram¶
The following diagram shows the primary import-recording sequence, including the error-handling branch when the CallRex deletion step fails after local processing has already succeeded.
sequenceDiagram
participant Host as Host application
participant AVS as AudioVideoService
participant Val as AudioVideoValidator
participant UOW as IUnitOfWork/Repository
participant ISM as ImportStatusManager
participant RS as CallRecordingSystem (CallRex)
Host->>AVS: ImportRecording(request)
AVS->>Val: Validate(request)
Val-->>AVS: ValidationResult
AVS->>UOW: Find/create Recording row
UOW-->>AVS: Recording entity
AVS->>AVS: Backup copy + MD5 verify + convert (MediaToolkit)
AVS->>AVS: VerifyImport (file/size checks)
AVS->>RS: DeleteRecording(callRexId)
RS-->>AVS: success/failure
alt CallRex delete fails
AVS->>ISM: SetErrored
AVS-->>Host: throws ApplicationException
else success
AVS->>ISM: SetCompleted
AVS-->>Host: RecordingInfo
end
Design constraints¶
- 32-bit (x86) build variant, not an independently designed library: this project's
.csprojsets<PlatformTarget>x86</PlatformTarget>across all configured build configurations (Debug|AnyCPU,Release|AnyCPU, and the explicitDebug|x86/Release|x86property groups), and it has no source of its own apart fromProperties\AssemblyInfo.csand generated WCF proxy files — every<Compile>item underCore\,Data\, andServices\is a linked file (<Link>) whose physical source lives in the siblingSAIF.Application.Services.AudioVideoproject. Every behavioral, business-rule, and data-access finding is identical to (and traceable to the same source lines as) that sibling library. - 32-bit Oracle client dependency drives the build variant: this project references the 32-bit-specific NuGet package
SAIF.Framework.Data.NHibernate.32(rather than the sibling's AnyCPU/64-bit-capable package), which bundles the x86Oracle.DataAccess.dll(ODP.NET unmanaged) via a<Reference Include="Oracle.DataAccess...processorArchitecture=x86">entry. The unmanaged Oracle client requires bitness-matched hosting, so this variant exists specifically for host processes that only run as x86 (for example, a legacy Windows Service, an IIS application pool running in 32-bit mode, or a batch console executable constrained to x86). - No independent runtime dependency on the sibling assembly: because collaboration with
SAIF.Application.Services.AudioVideosource is via linked.csfiles (not a<ProjectReference>or assembly reference), the.32assembly is self-contained at compile time and carries no runtime dependency on the sibling project's compiled output. - Vendored third-party binaries are not NuGet-restored:
CallRex.Utilities.dllandCallrexAPIUtilities.dllare referenced directly byHintPathfromLibs\ThirdParty\CallRex\, outside the NuGet package-restore pipeline. - No consuming application found in this repository's scope: the library is packaged as a standalone NuGet library (per its
.nuspec) for consumption by an as-yet-undetermined 32-bit host application elsewhere in the SAIF application estate.
Related documentation¶
Sources¶
Application\SAIF.Application.Services.AudioVideo.32\SAIF.Application.Services.AudioVideo.32.csprojApplication\SAIF.Application.Services.AudioVideo.32\app.configApplication\SAIF.Application.Services.AudioVideo\Core\Services\IAudioVideoService.csApplication\SAIF.Application.Services.AudioVideo\Core\Contracts\AudioVideo\IRecordingSystem.csApplication\SAIF.Application.Services.AudioVideo\Core\Contracts\AudioVideo\IImportStatusManager.csApplication\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoService.csApplication\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\AudioVideoValidator.csApplication\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\CallRecordingExtensions.csApplication\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\ImportStatusManager.csApplication\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\RecordingSystem.csApplication\SAIF.Application.Services.AudioVideo\Services\ClientProxies\ThirdParty\CallRexServiceProxy.csApplication\SAIF.Application.Services.AudioVideo\Services\ClientProxies\ThirdParty\CallRexStateServiceProxy.csApplication\SAIF.Application.Services.AudioVideo\Services\ClientProxies\ThirdParty\AgentStateCallback.csApplication\SAIF.Application.Services.AudioVideo\Data\Model\AudioImportStatus.csApplication\SAIF.Application.Services.AudioVideo\Data\Model\Recording.csApplication\SAIF.Application.Services.AudioVideo\Data\Mappings\AudioImportStatusMap.csApplication\SAIF.Application.Services.AudioVideo\Data\Mappings\RecordingMap.cs