diff options
| author | Antoine Ouvrard <antoine.ouvrard@nereide.fr> | 2021-03-11 14:30:34 +0000 |
|---|---|---|
| committer | Antoine Ouvrard <antoine.ouvrard@nereide.fr> | 2021-03-11 14:30:34 +0000 |
| commit | 7d981802b9d1c93071f4e71dbd1cfb6fde488920 (patch) | |
| tree | 35467248cc81f566a6cd11c43b50bf069be3e27b /roles | |
| parent | 331a941fcbfba7228c097484bd81ec328176c81d (diff) | |
configuration d'appel SIP pour jitsi et BBB
Diffstat (limited to 'roles')
| -rw-r--r-- | roles/bbb-enable-sip/files/bbb_sip_ovh.xml | 32 | ||||
| -rw-r--r-- | roles/bbb-enable-sip/handlers/main.yml | 8 | ||||
| -rw-r--r-- | roles/bbb-enable-sip/tasks/main.yml | 51 | ||||
| -rw-r--r-- | roles/bbb-enable-sip/templates/sip-profiles.xml.j2 | 10 | ||||
| -rw-r--r-- | roles/jitsi-add-sip/tasks/main.yml | 25 |
5 files changed, 126 insertions, 0 deletions
diff --git a/roles/bbb-enable-sip/files/bbb_sip_ovh.xml b/roles/bbb-enable-sip/files/bbb_sip_ovh.xml new file mode 100644 index 0000000..a43b1a9 --- /dev/null +++ b/roles/bbb-enable-sip/files/bbb_sip_ovh.xml @@ -0,0 +1,32 @@ +<extension name="sip01"> + <condition field="destination_number" expression="^sip01"> + <action application="start_dtmf" /> + <action application="answer"/> + <action application="sleep" data="1000"/> + <action application="play_and_get_digits" data="5 5 3 7000 # conference/conf-pin.wav ivr/ivr-that_was_an_invalid_entry.wav pin \d+"/> + + <!-- Uncomment the following block if you want to mask the phone number in the list of participants. --> + <!-- Instead of `01711233121` it will then show `xxx-xxx-3121`. --> + <!-- + <action application="set_profile_var" data="caller_id_name=${regex(${caller_id_name}|^.*(.{4})$|xxx-xxx-%1)}"/> + --> + + <action application="transfer" data="SEND_TO_CONFERENCE XML public"/> + </condition> +</extension> +<extension name="check_if_conference_active"> + <condition field="${conference ${pin} list}" expression="/sofia/g" /> + <condition field="destination_number" expression="^SEND_TO_CONFERENCE$"> + <action application="set" data="bbb_authorized=true"/> + <action application="transfer" data="${pin} XML default"/> + </condition> +</extension> + +<extension name="conf_bad_pin"> + <condition field="${pin}" expression="^\d{5}$"> + <action application="answer"/> + <action application="sleep" data="1000"/> + <action application="play_and_get_digits" data="5 5 3 7000 # conference/conf-bad-pin.wav ivr/ivr-that_was_an_invalid_entry.wav pin \d+"/> + <action application="transfer" data="SEND_TO_CONFERENCE XML public"/> + </condition> +</extension>
\ No newline at end of file diff --git a/roles/bbb-enable-sip/handlers/main.yml b/roles/bbb-enable-sip/handlers/main.yml new file mode 100644 index 0000000..254cf59 --- /dev/null +++ b/roles/bbb-enable-sip/handlers/main.yml @@ -0,0 +1,8 @@ +--- +- name: restart freeswitch + systemd: + name: freeswitch + state: restarted + daemon_reload: true + enabled: true + diff --git a/roles/bbb-enable-sip/tasks/main.yml b/roles/bbb-enable-sip/tasks/main.yml new file mode 100644 index 0000000..9ddecd4 --- /dev/null +++ b/roles/bbb-enable-sip/tasks/main.yml @@ -0,0 +1,51 @@ +--- +- name: Application de la conf général SIP + template: + src: ../templates/sip-profiles.xml.j2 + dest: /opt/freeswitch/conf/sip_profiles/external/sip.xml + mode: u=rw,g=r,o=r + owner: freeswitch + group: daemon + notify: + - restart freeswitch + +- name: Application de la conf SIP + template: + src: ../files/bbb_sip_ovh.xml + dest: /opt/freeswitch/conf/dialplan/public/bbb_sip_ovh.xml + mode: u=rw,g=r,o=r + owner: freeswitch + group: daemon + notify: + - restart freeswitch + +- name: Ajout d'un message d'information dans le chat + lineinfile: + path: /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties + regexp: "defaultDialAccessNumber=" + line: "defaultDialAccessNumber={{ bbb_sip_telnum_for_user }}" + +- name: Ajout d'un message d'information dans le chat + lineinfile: + path: /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties + regexp: "defaultWelcomeMessageFooter=" + line: "defaultWelcomeMessageFooter=Pour rejoindre la conférence par téléphone, appeler au numéro :<br> %%DIALNUM%%<br> puis saisir le code :<br> %%CONFNUM%%" + register: welcomeMessage + +- name: On redémarre bbb que si le fichier ci dessus a été modifié + shell: "bbb-conf --restart" + when: welcomeMessage is changed + +- name: Changement du message d'accueil audio + copy: + src: "{{ inventory_hostname }}/bbb-sounds/{{ item }}/conf-pin.wav" + dest: "/opt/freeswitch/share/freeswitch/sounds/en/us/callie/conference/{{ item }}/" + owner: freeswitch + group: daemon + mode: u=rw,g=r,o=r + backup: yes + loop: + - 8000 + - 16000 + - 32000 + - 48000
\ No newline at end of file diff --git a/roles/bbb-enable-sip/templates/sip-profiles.xml.j2 b/roles/bbb-enable-sip/templates/sip-profiles.xml.j2 new file mode 100644 index 0000000..43191fe --- /dev/null +++ b/roles/bbb-enable-sip/templates/sip-profiles.xml.j2 @@ -0,0 +1,10 @@ +<include> + <gateway name="{{ bbb_sip_provider }}"> + <param name="proxy" value="{{ bbb_sip_provider }}"/> + <param name="username" value="{{ bbb_sip_username }}"/> + <param name="password" value="{{ bbb_sip_password }}"/> + <param name="extension" value="sip01"/> + <param name="register" value="true"/> + <param name="context" value="public"/> + </gateway> +</include>
\ No newline at end of file diff --git a/roles/jitsi-add-sip/tasks/main.yml b/roles/jitsi-add-sip/tasks/main.yml new file mode 100644 index 0000000..b8c0db7 --- /dev/null +++ b/roles/jitsi-add-sip/tasks/main.yml @@ -0,0 +1,25 @@ +--- +- name: Ajout du compte SIP + debconf: + name: jigasi + question: jigasi/sip-account + value: '{{ jigasi_sip_account }}' + vtype: string + +- name: Ajout du mot de passe SIP + debconf: + name: jigasi + question: jigasi/sip-password + value: '{{ jigasi_sip_password }}' + vtype: string + +- name: Installation de jigasi + apt: + name: + - jigasi + +- name: Nommage de la room SIP + lineinfile: + path: /etc/jitsi/jigasi/sip-communicator.properties + regexp: "org.jitsi.jigasi.DEFAULT_JVB_ROOM_NAME=" + line: "org.jitsi.jigasi.DEFAULT_JVB_ROOM_NAME={{ jigasi_sip_room }}@conference.{{ inventory_hostname }}" |
