diff --git a/apps/asterisk/deployment.yaml b/apps/asterisk/deployment.yaml index 1545123..acdcb73 100644 --- a/apps/asterisk/deployment.yaml +++ b/apps/asterisk/deployment.yaml @@ -16,22 +16,39 @@ spec: metadata: labels: app: asterisk - spec: - nodeSelector: - kubernetes.io/hostname: rke2-agent1 - hostNetwork: true - dnsPolicy: ClusterFirstWithHostNet + spec: + nodeSelector: + kubernetes.io/hostname: rke2-agent1 + hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet securityContext: fsGroup: 0 - initContainers: - - name: install-sounds - image: busybox:latest - command: - - sh - - -c - - | - mkdir -p /sounds/en && - echo "Leaving /var/lib/asterisk/sounds/en empty until the sound bootstrap lane is fixed." + initContainers: + - name: install-sounds + # Downloads Asterisk core sounds (en, ulaw) into the sounds emptyDir + # volume so the base Asterisk image (which ships no sounds) can play + # vm-advopts, vm-goodbye, digits/*, characters/*, beep, etc. Skips + # the download if the directory already contains sound files — + # re-running the pod after a hot image reload reuses the unpack. + image: alpine:3.20 + command: + - sh + - -c + - | + set -eu + if [ -f /sounds/en/vm-goodbye.ulaw ] || [ -f /sounds/en/vm-goodbye.gsm ]; then + echo "Sounds already present — skipping download." + exit 0 + fi + echo "Installing curl + tar..." + apk add --no-cache curl tar gzip >/dev/null + cd /tmp + echo "Downloading Asterisk core sounds (en, ulaw) 1.6.1..." + curl -fsSLO https://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-en-ulaw-1.6.1.tar.gz + echo "Extracting to /sounds/en ..." + mkdir -p /sounds/en + tar -xzf asterisk-core-sounds-en-ulaw-1.6.1.tar.gz -C /sounds/en + echo "Done — $(ls /sounds/en | wc -l) files installed." volumeMounts: - name: sounds mountPath: /sounds/en