Skip to content

CallRex WCF proxy operations

CallRecordingSystem (the sole IRecordingSystem implementation) composes two WCF client wrappers — CallRexServiceProxy and CallRexStateServiceProxy — that talk to the third-party CallRex call-recording system's ClientService and AgentStateService endpoints. This page documents both proxies as one cross-cutting integration operation because they are always used together by CallRecordingSystem and share the same authentication pattern.

Field Value
Operation ID OP-AV-CALLREX-PROXY
Trigger Any IRecordingSystem member call routed through CallRecordingSystem (GetRecording, GetRecordings, GetCallUsers, GetAllUsersCurrentCallState, GetCallUser, MarkInvalid, DeleteRecording, StartRecording, StopRecording, PauseRecording, ResumeRecording, StartMonitoring, StopMonitoring)
Inputs Varies by member: Guid recording/user identifiers, CallUser, RealtimeUserState (from the agent-state callback)
Outputs CallRecording/CallUser collections, bool success flags, and CallMonitorState events raised through OnCallStateChanged
Primary components CallRecordingSystem, CallRexServiceProxy, CallRexStateServiceProxy, AgentStateCallback
Entry point Application\SAIF.Application.Services.AudioVideo\Services\Utilities\AudioVideo\RecordingSystem.cs

Steps

  1. CallRexServiceProxy wraps Core.ThirdParty.CallRex.ClientServiceClient (WCF, endpoint address resolved at runtime from AudioImportService.callRexServiceUrl; design-time app.config address is http://localhost:8002/ClientService, SPN identity qmssvc@corp.saif.com).
  2. On construction, eagerly calls _webService.Login("AI", "AudioImporter") — a hard-coded service-account credential pair.
  3. All state-changing calls (MarkInvalid, DeleteRecording, StartRecording, StopRecording, PauseRecording, ResumeRecording) are wrapped in AuthorizeClientServiceCall, which adds custom SOAP headers Username/Password (same hard-coded credentials) to every outgoing message via OperationContextScope.
  4. CallRexStateServiceProxy wraps Core.ThirdParty.CallRexAgentState.AgentStateServiceClient (dual/duplex WCF binding, endpoint resolved at runtime from AudioImportService.callRexStateServiceUrl; design-time app.config addresses are net.tcp://localhost:8015/AgentStateService or http://localhost:8003/AgentStateService2).
  5. CallRexStateServiceProxy pushes real-time agent call-state callbacks through AgentStateCallback.ReceiveState, which converts the incoming RealtimeUserState and raises CallStateChanged.
  6. CallRecordingSystem.CallState_Changed handles that delegate and re-raises it as the OnCallStateChanged event exposed to CallRecordingSystem callers.
  7. CallRecordingSystem.GetRecordings(string userId) resolves a CallUser first via GetCallUser (case-insensitive UserId match), then delegates to GetRecordings(CallUser) — a two-step lookup rather than a single direct query.

Process flow

The following diagram visualizes the recording-control and agent-state-monitoring call paths.

flowchart TD
    Consumer[AudioVideoService / IRecordingSystem consumer] --> RS[CallRecordingSystem]
    RS -->|Recording retrieval/control| Proxy1[CallRexServiceProxy]
    Proxy1 -->|Login once, auth header per call| ClientService["CallRex ClientService (WCF)"]
    RS -->|Agent-state monitoring| Proxy2[CallRexStateServiceProxy]
    Proxy2 -->|Duplex/callback| AgentStateService["CallRex AgentStateService (WCF)"]
    AgentStateService -.->|RealtimeUserState| Callback[AgentStateCallback]
    Callback --> RS
    RS -->|OnCallStateChanged| Consumer

Failure and edge-case behavior

  • A failed Login at CallRexServiceProxy construction leaves the proxy unable to authorize any subsequent state-changing call.
  • GetRecordings(string userId) returns no recordings if GetCallUser cannot resolve a matching CallUser for the given userId.
  • The hard-coded CallRex credentials ("AI" / "AudioImporter") are compiled directly into CallRexServiceProxy rather than retrieved via IEnvironmentService.GetSecureConfigSetting — see Configuration for the associated configuration/secrets-management risk.

Sources

  • 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
  • Application\SAIF.Application.Services.AudioVideo\Services\ClientProxies\ThirdParty\AgentStateCallback.cs
  • Application\SAIF.Application.Services.AudioVideo.32\app.config