diff --git a/roles/freepbx/files/agi/jitsi_conf_pin b/roles/freepbx/files/agi/jitsi_conf_pin new file mode 100644 index 0000000..91675ce --- /dev/null +++ b/roles/freepbx/files/agi/jitsi_conf_pin @@ -0,0 +1,23 @@ +#!/usr/bin/perl + +use warnings; +use strict; +use LWP::UserAgent; +use JSON; + +my $ret = 'error'; + +my $url = $ARGV[0] . '?id=' . $ARGV[1]; +my $ua = LWP::UserAgent->new(timeout => 10); +$ua->env_proxy; + +my $response = $ua->get($url); +if ($response->is_success){ + my $json = from_json($response->content); + if (defined $json and defined $json->{conference}){ + $ret = $json->{conference}; + $ret =~ s/@.*//; + } +} + +print "SET VARIABLE JITSI_ROOM $ret\n"; diff --git a/roles/freepbx/tasks/main.yml b/roles/freepbx/tasks/main.yml index 670c43a..da08d1a 100644 --- a/roles/freepbx/tasks/main.yml +++ b/roles/freepbx/tasks/main.yml @@ -19,6 +19,7 @@ - mysql-connector-odbc - mpg123 - lame + - opus - nmap - nodejs #- kmod-dahdi-linux @@ -403,6 +404,12 @@ - post tags: fpbx +- name: Install agi scripts + copy: src=agi/{{ item }} dest=/usr/share/asterisk/agi-bin/{{ item }} mode=750 group=asterisk + loop: + - jitsi_conf_pin + tags: fpbx + - name: Handle FreePBX ports iptables_raw: name: "{{ item.name }}" diff --git a/roles/jitsi/defaults/main.yml b/roles/jitsi/defaults/main.yml index ea04ed7..a4f97ae 100644 --- a/roles/jitsi/defaults/main.yml +++ b/roles/jitsi/defaults/main.yml @@ -13,6 +13,9 @@ jitsi_jicofo_git_url: https://github.com/jitsi/jicofo.git jitsi_jigasi_git_url: https://github.com/jitsi/jigasi.git jitsi_meet_git_url: https://github.com/jitsi/jitsi-meet.git +# Should ansible handle upgrades, or only initial install ? +jitsi_manage_upgrade: True + # XMPP server to connect to. Default is the same machine jitsi_xmpp_server: "{{ inventory_hostname }}" # Port on which to connect to the XMPP server to register as a component @@ -67,11 +70,12 @@ jitsi_meet_conf_base: bosh: '//{{ jitsi_domain }}/http-bind' websocket: 'wss://{{ jitsi_domain }}/xmpp-websocket' clientNode: http://jitsi.org/jitsimeet + focusUserJid: "{{ jitsi_jicofo_xmpp_user }}@{{ jitsi_auth_domain }}" disableAudioLevels: True testing: p2pTestMode: False enableNoAudioDetection: True - enableNoisyMicDetection: True + enableNoisyMicDetection: False desktopSharingChromeExtId: null desktopSharingChromeSources: - screen @@ -80,9 +84,14 @@ jitsi_meet_conf_base: desktopSharingChromeMinExtVersion: 0.1 channelLastN: -1 requireDisplayName: False + resolution: 480 + enableLayerSuspension: True enableCalendarIntegration: False disableThirdPartyRequests: True enableWelcomePage: True + useStunTurn: True + localRecording: + enabled: True p2p: enabled: True useStunTurn: True @@ -143,10 +152,11 @@ jitsi_meet_interface_conf_base: - stats - shortcuts - tileview - #- videobackgroundblur + - videobackgroundblur - download - help - mute-everyone + #- localrecording SETTINGS_SECTIONS: - devices - language @@ -214,6 +224,8 @@ jitsi_jigasi_default_room: sip #jitsi_jigasi_sip_user: #jitsi_jigasi_sip_secret: #jitsi_jigasi_sip_server: +jitsi_jigasi_sip_port: 5060 +jitsi_jigasi_sip_transport: UDP jitsi_jigasi_xmpp_user: jigasi jitsi_jigasi_xmpp_domain: "{{ jitsi_auth_domain }}" @@ -234,7 +246,7 @@ jitsi_confmapper_conf_base: port: "{{ jitsi_confmapper_port }}" host: 0.0.0.0 expire_seconds: 86400 - id_max_length: 5 + id_max_length: 4 db_file: "{{ jitsi_root_dir }}/data/confmapper.sqlite" jitsi_confmapper_conf_extra: {} jitsi_confmapper_conf: "{{ jitsi_confmapper_conf_base | combine(jitsi_confmapper_conf_extra, recursive=True) }}" diff --git a/roles/jitsi/tasks/conf.yml b/roles/jitsi/tasks/conf.yml index e1f5937..a75a7e4 100644 --- a/roles/jitsi/tasks/conf.yml +++ b/roles/jitsi/tasks/conf.yml @@ -32,7 +32,7 @@ notify: restart jitsi-jicofo tags: jitsi -- name: Deploy jigasiconfiguration +- name: Deploy jigasi configuration template: src=jigasi/{{ item }}.j2 dest={{ jitsi_root_dir }}/etc/jigasi/{{ item }} group={{ jitsi_user }} mode=640 loop: - jigasi.conf diff --git a/roles/jitsi/tasks/facts.yml b/roles/jitsi/tasks/facts.yml index 81efc93..966db99 100644 --- a/roles/jitsi/tasks/facts.yml +++ b/roles/jitsi/tasks/facts.yml @@ -88,3 +88,8 @@ stat: path={{ jitsi_root_dir }}/jigasi/jigasi.sh register: jitsi_jigasi_script tags: jitsi + +- name: Check if meet is installed + stat: path={{ jitsi_root_dir }}/meet/index.html + register: jitsi_meet_index + tags: jitsi diff --git a/roles/jitsi/tasks/install.yml b/roles/jitsi/tasks/install.yml index 947f4da..1589332 100644 --- a/roles/jitsi/tasks/install.yml +++ b/roles/jitsi/tasks/install.yml @@ -4,6 +4,7 @@ yum: name: - java-1.8.0-openjdk + - java-1.8.0-openjdk-devel - git - nodejs # needed to build meet - libXScrnSaver # needed for jigasi @@ -61,7 +62,7 @@ delete: True delegate_to: "{{ inventory_hostname }}" notify: restart jitsi-jicofo - when: jitsi_jicofo_git.changed or not jitsi_jicofo_script.stat.exists + when: (jitsi_jicofo_git.changed and jitsi_manage_upgrade) or not jitsi_jicofo_script.stat.exists tags: jitsi - name: Clone jigasi repo @@ -98,7 +99,7 @@ delete: True delegate_to: "{{ inventory_hostname }}" notify: restart jitsi-jigasi - when: jitsi_jigasi_git.changed or not jitsi_jigasi_script.stat.exists + when: (jitsi_jigasi_git.changed and jitsi_manage_upgrade) or not jitsi_jigasi_script.stat.exists tags: jitsi - name: Deploy systemd unit @@ -128,8 +129,7 @@ become_user: "{{ jitsi_user }}" tags: jitsi -- when: jitsi_meet_git.changed - tags: jitsi +- name: Install or update jitsi meet block: - name: Install jitsi meet node dependencies npm: path={{ jitsi_root_dir }}/src/meet @@ -149,6 +149,8 @@ cp css/all.css {{ jitsi_root_dir }}/meet/css/ args: chdir: "{{ jitsi_root_dir }}/src/meet" + when: (jitsi_meet_git.changed and jitsi_manage_upgrade) or not jitsi_meet_index.stat.exists + tags: jitsi - name: Install dehydrated hook template: src=dehydrated_hook.sh.j2 dest=/etc/dehydrated/hooks_deploy_cert.d/jitsi.sh mode=755 diff --git a/roles/jitsi/templates/jigasi/sip-communicator.properties.j2 b/roles/jitsi/templates/jigasi/sip-communicator.properties.j2 index d325bec..a898cdc 100644 --- a/roles/jitsi/templates/jigasi/sip-communicator.properties.j2 +++ b/roles/jitsi/templates/jigasi/sip-communicator.properties.j2 @@ -23,6 +23,10 @@ net.java.sip.communicator.impl.protocol.sip.acc.KEEP_ALIVE_METHOD=OPTIONS net.java.sip.communicator.impl.protocol.sip.acc.VOICEMAIL_ENABLED=false net.java.sip.communicator.impl.protocol.sip.acc.OVERRIDE_ENCODINGS=false net.java.sip.communicator.impl.protocol.sip.acc.DOMAIN_BASE={{ jitsi_domain }} +net.java.sip.communicator.impl.protocol.sip.acc.PROXY_ADDRESS={{ jitsi_jigasi_sip_server }} +net.java.sip.communicator.impl.protocol.sip.acc.PROXY_AUTO_CONFIG=false +net.java.sip.communicator.impl.protocol.sip.acc.PROXY_PORT={{ jitsi_jigasi_sip_port }} +net.java.sip.communicator.impl.protocol.sip.acc.PREFERRED_TRANSPORT={{ jitsi_jigasi_sip_transport }} {% else %} # No SIP acc configured, jigasi will be disabled {% endif %} diff --git a/roles/jitsi_videobridge/defaults/main.yml b/roles/jitsi_videobridge/defaults/main.yml index c45c8e6..8c07e0c 100644 --- a/roles/jitsi_videobridge/defaults/main.yml +++ b/roles/jitsi_videobridge/defaults/main.yml @@ -5,6 +5,9 @@ jitsi_user: jitsi jitsi_videobridge_git_url: https://github.com/jitsi/jitsi-videobridge.git +# Should ansible manage upgrades or only initial install +jitsi_videobridge_manage_upgrade: "{{ jitsi_manage_upgrade | default(True) }}" + jitsi_videobridge_harvester_port: 4443 jitsi_videobridge_rtp_port: 10000 jitsi_videobridge_src_ip: diff --git a/roles/jitsi_videobridge/tasks/install.yml b/roles/jitsi_videobridge/tasks/install.yml index 71d7c12..26d0f99 100644 --- a/roles/jitsi_videobridge/tasks/install.yml +++ b/roles/jitsi_videobridge/tasks/install.yml @@ -45,7 +45,7 @@ delegate_to: "{{ inventory_hostname }}" notify: restart jitsi-videobridge - when: jitsi_videobridge_git.changed or not jitsi_videobridge_script.stat.exists + when: (jitsi_videobridge_git.changed and jitsi_videobridge_manage_upgrade) or not jitsi_videobridge_script.stat.exists tags: jitsi - name: Deploy systemd unit diff --git a/roles/matrix_synapse/defaults/main.yml b/roles/matrix_synapse/defaults/main.yml index d02ccb6..ebbaa74 100644 --- a/roles/matrix_synapse/defaults/main.yml +++ b/roles/matrix_synapse/defaults/main.yml @@ -1,7 +1,7 @@ --- # Synapse version to deploy -synapse_version: 1.12.1 +synapse_version: 1.12.4 # Synapse install dir synapse_root_dir: /opt/matrix/synapse diff --git a/roles/prosody/tasks/main.yml b/roles/prosody/tasks/main.yml index 25a20f2..66bdce5 100644 --- a/roles/prosody/tasks/main.yml +++ b/roles/prosody/tasks/main.yml @@ -1,7 +1,7 @@ --- -- include: install.yml - include: directories.yml +- include: install.yml - include: facts.yml - include: conf.yml - include: iptables.yml