Run it safely / ComplianceAll pages
Run it safely

Compliance: card data, recordings and audit

The controls a bank's, hospital's or university's auditors ask about, how each one works, and what it does not cover. Admins see the state of every control under Organization settings → Compliance.

Card entry
Keypad, never heard or recorded
Recordings
AES-256-GCM + SHA-256 each
Audit trail
Hash-chained, append-only
Transport
TLS 1.2 / 1.3, SRTP

Card numbers and PINs on the keypad (secure capture)

During a call, the agent presses Secure card entry and chooses what to collect (card number, CVV, PIN, OTP, CNIC). The customer types it on their keypad. Until they finish:

  • the customer's keypad tones and voice are blocked towards the agent (rtpengine, on the agent's side of the call);
  • the call recording pauses;
  • the agent sees only progress (•••• ••__ ____ ____), then the last four digits and whether a card number passes its check digit;
  • the digits are kept in memory by the voip-redactor service, sent once to your system (Self-service API, signed with HMAC), then wiped. They are never written to disk or logged.
CustomerCustomerPhone systemPhone systemAgentAgentYour systemYour systemSecure card entry1tones + voice blocked to the agent; recording pausedtypes 16 digits + #3•••• •••• •••• 11114digits, signedHTTPS, once5result: ok6Card ending 1111 activated7
The digits go from the customer's keypad straight to the bank's system.

Keypad tones never reach agents (keypad guard)

Without any button: on every answered call to a person, the other party's keypad tones are blocked towards that person and only counted. When someone types 4 or more digits within 6 seconds, their voice is muted for the agent as well, until 3 seconds after the last key, so nothing typed or read out alongside reaches the agent.

  • Tones sent as sound (old phones, some carriers) are recognised by the phone system and treated the same way.
  • The guard protects the agent's ear. The recording still holds the caller's voice during a burst of digits; use secure capture when card data is expected.
  • Switch it off for the whole installation with KEYPAD_GUARD="no" in config.env.

Masking from your IVR or PBX: X-PCI-Mask

A system in the call path (a bank IVR, a PBX, a payment platform) can mask a caller itself by sending a SIP request inside the call (INFO, re-INVITE or UPDATE) with this header. The sender's side is masked (tones and voice) until it sends off; add ;side=peer to mask the other party instead. The header never travels further, and an INFO that carries nothing else is answered by the phone system.

INFO from your IVRHTTP
1INFO sip:agent@10.0.0.5 SIP/2.02...3X-PCI-Mask: on4Content-Length: 05 6(the customer types or reads the card number)7 8INFO sip:agent@10.0.0.5 SIP/2.09...10X-PCI-Mask: off11Content-Length: 0

Recordings

Encrypted at rest

Asterisk writes each call's recording while it runs; within seconds of the call ending it is encrypted with AES-256-GCM and the plain file is deleted. Playback, downloads and transcription decrypt in memory only. The key lives in /etc/voip-vault/recording.keys, readable by the dashboard only, and is deliberately not in backups: keep an offline copy, because without it the recordings cannot be played.

Fingerprint and integrity check

When a recording is sealed, the SHA-256 of its audio is stored apart from the file. Verify all recordings now (Compliance) decrypts every recording of the organization and compares; an altered or missing file is reported and the check is written to the audit trail.

Key rotation

On the serverShell
1sudo voip-vault-rekey --status        # keys, and how many files each one holds2sudo voip-vault-rekey --add-key       # a new key; new recordings use it3sudo voip-vault-rekey --dry-run       # what re-encryption would do4sudo voip-vault-rekey                 # re-encrypt every file with the newest key5sudo voip-vault-rekey --retire k1     # remove a key once no file needs it

Re-encryption keeps the audio, so each file's SHA-256 stays valid.

Spoken numbers silenced

After a call is transcribed, the stretches where a card number, CNIC, OTP, PIN or CVV was said are replaced by silence in the recording, using the transcript's word timings. The file is re-encrypted and gets a second SHA-256 next to the original; the audit trail notes it. Transcripts never contain those numbers (they are masked before anything is stored).

  • It happens when a call is transcribed: switch on call analysis, or Transcribe every recorded call under Compliance (uses speech minutes).
  • It is after the call, not live: the agent hears what the customer says. Take card data on the keypad.
  • It is as good as the speech service's hearing of the numbers.
  • It changes recordings for good. Switch it off under Compliance if your rules require the original audio.

Encryption on the network

ConnectionSignallingMedia
Browser phoneWSS (TLS)DTLS-SRTP, always
Desk phone on SIP over TLS (5061)TLSSRTP, AES-256 first (SRTP_PHONES)
Desk phone on UDP / TCPPlainPlain RTP
Carrier on TLSTLSSRTP (SRTP_TRUNKS)
Carrier on UDPPlainPlain RTP
Dashboard and APIHTTPS—

config.env

TLS_MODEselfsigned | letsencrypt | custom
custom = your organization's own certificate: TLS_CERT_FILE, TLS_KEY_FILE, TLS_CHAIN_FILE, TLS_CA_FILE. Check it first with sudo scripts/gen-tls.sh --check cert.pem key.pem [chain.pem].
TLS_MIN_VERSION1.2 | 1.3
Oldest TLS accepted for HTTPS, WSS and SIP over TLS. 1.3 may lock out old desk phones.
SRTP_PHONESoptional | required | off
optional: offered, phones without SRTP still work. required: plain-RTP calls from TLS phones are refused (488).
SRTP_TRUNKSoptional | required | off
The same for carriers on TLS (TELNYX_TRANSPORT="tls", or an organization trunk set to TLS).

Audit trail

Sign-ins, setting changes, recording playbacks, downloads, transcript views, exports, captures and integrity checks are written to the audit trail with who, when and from where. Each entry carries a hash of the one before it, per organization, and the database refuses changes and deletions, so a changed, removed or inserted entry shows as a break under Compliance. Export any period as CSV (each row with its hash) for your auditors.

What your organization still has to do

  • Require two-factor sign-in (Organization settings → Security).
  • Keep an offline copy of the recording key, and a copy of the backups away from the server (BACKUP_S3_URI or BACKUP_RSYNC_TARGET in /etc/voip-stack/backup.env).
  • Put the server in a separate network segment, keep it patched, and have it penetration-tested before going live.
  • Train agents to take card data only through secure entry, and write the policies your auditors expect.