From 871697aa92ab8d3f1a7101db57ddcc9a024209db Mon Sep 17 00:00:00 2001 From: adminbruno Date: Thu, 17 Aug 2023 14:51:33 -0400 Subject: [PATCH] Ajouter 'trunk-monitor-pjsip' --- trunk-monitor-pjsip | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 trunk-monitor-pjsip diff --git a/trunk-monitor-pjsip b/trunk-monitor-pjsip new file mode 100644 index 0000000..fcd18eb --- /dev/null +++ b/trunk-monitor-pjsip @@ -0,0 +1,14 @@ +#!/bin/bash +#Bruno Thibodeau +#FreePBX 13 + + +#Sortir les trunk et leur status +trunks=($(asterisk -rx "pjsip show registrations" ! grep Registered | awk '{print$3}')) + +#Compter le nombre de trunk "Registered" +trstatus=($(echo ${trunks[*]} | grep -o 'Registered' | wc -l)) +#echo $trstatus + +#Si moins de deux trunks enregistrés, repartir le process +if (( $trstatus != 2 )) ; then $(which fwconsole) reload; fi \ No newline at end of file