Skip to content

feat: per-org hold music & ringback upload with auto-transcoding#198

Merged
shridarpatil merged 4 commits intomainfrom
feat/per-org-hold-music-ringback
Feb 27, 2026
Merged

feat: per-org hold music & ringback upload with auto-transcoding#198
shridarpatil merged 4 commits intomainfrom
feat/per-org-hold-music-ringback

Conversation

@shridarpatil
Copy link
Owner

@shridarpatil shridarpatil commented Feb 27, 2026

Summary

  • Allow each organization to upload custom hold music and ringback tone via Settings > Calling, with global config values as fallback defaults
  • Auto-transcode all uploaded audio (IVR, hold music, ringback) to OGG/Opus 48kHz mono via ffmpeg, fixing garbled playback from non-Opus files
  • Add frontend build stage to docker/Dockerfile so local Docker builds include fresh frontend assets

Test plan

  • Upload an MP3/WAV hold music file in Settings > Calling — verify it plays clearly during call transfers
  • Upload a ringback tone — verify agents hear it while an outbound call is ringing
  • Upload an IVR greeting in any format — verify it plays correctly
  • Test org without custom files uses global config defaults
  • Test with multiple orgs to verify isolation
  • Verify docker build -f docker/Dockerfile . produces a working image with the UI changes

Allow each organization to upload custom hold music and ringback tones
via the Settings UI, with global config values as fallback defaults.

Backend:
- Add hold_music_file and ringback_file to org settings JSONB
- Add UploadOrgAudio handler with org-scoped filenames
- Add getOrgHoldMusic/getOrgRingback helpers in calling Manager
- Wire org hold music into transfer flow
- Wire ringback tone into outgoing call ringing event
- Add POST /api/org/audio route

Frontend:
- Add file upload fields for hold music and ringback in Calling tab
- Add play/preview button for uploaded audio
- Add uploadOrgAudio API method
The embedded frontend assets in internal/frontend/dist/ are gitignored,
so the Docker build was using stale/empty assets. Add a Node.js build
stage that builds the frontend and copies the output into the Go embed
directory before compiling the binary.
The AudioPlayer sends raw Opus packets over RTP at 48kHz/20ms frames.
Uploaded files in other formats (MP3, Vorbis OGG, WAV) were saved as-is,
producing distorted/garbled audio during playback.

Now UploadOrgAudio transcodes any input to OGG/Opus 48kHz mono via
ffmpeg before saving, ensuring compatibility with the RTP player.

Also adds ffmpeg to both Dockerfiles as a runtime dependency.
Apply the same ffmpeg transcoding to UploadIVRAudio that was added to
UploadOrgAudio, so IVR greeting audio files are also guaranteed to be
compatible with the WebRTC AudioPlayer.
@shridarpatil shridarpatil merged commit 97a87f7 into main Feb 27, 2026
8 checks passed
@shridarpatil shridarpatil deleted the feat/per-org-hold-music-ringback branch February 27, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant