Media Synchronization
Purpose
Section titled “Purpose”Describe how media flows between central storage and the tenant edge.
Overview
Section titled “Overview”The node agent runs two sync loops:
- Down (assets): polls
GET /api/v1/nodes/media/manifest?since=<version>(304 when unchanged). The manifest lists assets byobject_key,local_path,content_sha256andsize_bytes. Each object is fetched through the node-authenticated proxyGET /api/v1/nodes/media/object?key=…(MinIO is never reachable from the edge), streamed to a temp file, verified against its SHA-256, and atomically renamed into place underEDGE_MEDIA_ROOT. Files already matching the hash are skipped; a prune removes local assets no longer in the manifest. - Up (recordings): polls
GET /api/v1/nodes/recordings/pendingand uploads each file as multipart toPOST /api/v1/nodes/recordings/<call_id>. See Recordings.
Configuration
Section titled “Configuration”EDGE_MEDIA_ROOT=/var/lib/get2dial/media # playback root; MUST match the control planeAGENT_MEDIA_SYNC_ENABLED=trueAGENT_MEDIA_SYNC_SECONDS=60AGENT_MEDIA_SYNC_PRUNE=true # remove assets no longer in the manifestExamples
Section titled “Examples”A new voicemail-drop asset uploaded to the audio library changes the manifest
version (its content_sha256 is the change key); on the next poll the node agent
pulls just that object to EDGE_MEDIA_ROOT/tenants/<tenant>/…, after which
FreeSWITCH can play it locally.
EDGE_MEDIA_ROOTmust match the control plane’s expectation or the stamped voicemail/asset paths won’t resolve on the edge.- Sync is manifest- and hash-driven — assets transfer once and are reused; downloads are atomic so a half-written file is never played.