From 7b9b7845485eefc8187f5c3fa4c0f055dd116940 Mon Sep 17 00:00:00 2001 From: chandi Date: Sat, 18 Jul 2020 19:12:19 +0200 Subject: [PATCH] change how announcement disabling is archived --- docker-compose.yml | 3 +- .../autoload_configs/conference.conf.xml.tmpl | 284 ++++++++++++++++++ mod/freeswitch/entrypoint.sh | 6 +- sample.env | 7 +- 4 files changed, 292 insertions(+), 8 deletions(-) create mode 100644 mod/freeswitch/conf/autoload_configs/conference.conf.xml.tmpl diff --git a/docker-compose.yml b/docker-compose.yml index ed73cc2..1b5a0e2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,7 +35,8 @@ services: EXTERNAL_IP: ${EXTERNAL_IP} SIP_IP_ALLOWLIST: ${SIP_IP_ALLOWLIST} NETWORK_INTERFACE: ${NETWORK_INTERFACE:-} - REMOVE_ENGLISH_FREESWITCH_AUDIO_ANNOUNCEMENS: ${REMOVE_ENGLISH_FREESWITCH_AUDIO_ANNOUNCEMENS} + DISABLE_SOUND_MUTED: ${DISABLE_SOUND_MUTED:-false} + DISABLE_SOUND_ALONE: ${DISABLE_SOUND_ALONE:-false} volumes: - ./conf/sip_profiles:/etc/freeswitch/sip_profiles/external - ./conf/dialplan_public:/etc/freeswitch/dialplan/public_docker diff --git a/mod/freeswitch/conf/autoload_configs/conference.conf.xml.tmpl b/mod/freeswitch/conf/autoload_configs/conference.conf.xml.tmpl new file mode 100644 index 0000000..516b2c7 --- /dev/null +++ b/mod/freeswitch/conf/autoload_configs/conference.conf.xml.tmpl @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{if not (isTrue .Env.DISABLE_SOUND_MUTED) }} + + + {{end}} + {{if not (isTrue .Env.DISABLE_SOUND_ALONE) }} + + {{end}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mod/freeswitch/entrypoint.sh b/mod/freeswitch/entrypoint.sh index 84a59ce..bde349a 100755 --- a/mod/freeswitch/entrypoint.sh +++ b/mod/freeswitch/entrypoint.sh @@ -15,11 +15,7 @@ for IP in "${ADDR[@]}"; do iptables -I INPUT -p udp --dport 5060 -s $IP -j ACCEPT done -# remove English audio annoucements -if [ "$REMOVE_ENGLISH_FREESWITCH_AUDIO_ANNOUNCEMENS" == 'true' ]; then - rm -rf /usr/share/freeswitch/sounds/en/us/callie/conference/ -fi - dockerize \ -template /etc/freeswitch/vars.xml.tmpl:/etc/freeswitch/vars.xml \ + -template /etc/freeswitch/autoload_configs/conference.conf.xml.tmpl:/etc/freeswitch/autoload_configs/conference.conf.xml \ /usr/bin/freeswitch -u freeswitch -g daemon -nonat -nf diff --git a/sample.env b/sample.env index a0ff418..a8a5d82 100644 --- a/sample.env +++ b/sample.env @@ -92,8 +92,11 @@ CHAT_ENABLED=true # set to true to start chat closed CHAT_START_CLOSED=false -# set to true to remove the English audio announcements from freeswitch, e.g. "You are the only person in this conference" -REMOVE_ENGLISH_FREESWITCH_AUDIO_ANNOUNCEMENS=false +# set to true to disable announcements "You are now (un-)muted" +DISABLE_SOUND_MUTED=false + +# set to true to disable announcement "You are the only person in this conference" +DISABLE_SOUND_ALONE=false # ==================================== # GREENLIGHT CONFIGURATION