Adds JVB added, removed and lost events.

main
Yasen Pramatarov 2024-06-21 12:27:56 +03:00
parent eee70f73dc
commit 72ab3560b9
1 changed files with 30 additions and 0 deletions

30
jilo
View File

@ -381,6 +381,36 @@ jitsi_log_parse() {
db_insert=$(printf "$db_insert_jitsi_component_event_template" "$jitsi_component" "$loglevel" "$event_time" "" "jicofo started" "") db_insert=$(printf "$db_insert_jitsi_component_event_template" "$jitsi_component" "$loglevel" "$event_time" "" "jicofo started" "")
db_query "$db_insert" db_query "$db_insert"
# bridge added
elif [[ "$line" =~ Jicofo\ ([0-9-]+\ [0-9:.]+)\ ([A-Z]+):.*\BridgeSelector\.addJvbAddress.*:\ Added\ new\ videobridge:\ Bridge\[jid=.*@.*\/(.*),\ version=(.*),.*region=(.*), ]]; then
event_time="${BASH_REMATCH[1]}"
loglevel="${BASH_REMATCH[2]}"
jvb_id="${BASH_REMATCH[3]}"
jvb_version="${BASH_REMATCH[4]}"
jvb_region="${BASH_REMATCH[5]}"
db_insert=$(printf "$db_insert_jitsi_component_event_template" "$jitsi_component" "$loglevel" "$event_time" "$jvb_id" "jvb added" "")
db_query "$db_insert"
db_insert=$(printf "$db_insert_jitsi_component_event_template" "$jitsi_component" "$loglevel" "$event_time" "$jvb_id" "jvb version" "$jvb_version")
db_query "$db_insert"
db_insert=$(printf "$db_insert_jitsi_component_event_template" "$jitsi_component" "$loglevel" "$event_time" "$jvb_id" "jvb region" "$jvb_region")
db_query "$db_insert"
# bridge removed
elif [[ "$line" =~ Jicofo\ ([0-9-]+\ [0-9:.]+)\ ([A-Z]+):.*\BridgeSelector\.removeJvbAddress.*:\ Removing\ JVB:\ .*@.*\/(.*) ]]; then
event_time="${BASH_REMATCH[1]}"
loglevel="${BASH_REMATCH[2]}"
jvb_id="${BASH_REMATCH[3]}"
db_insert=$(printf "$db_insert_jitsi_component_event_template" "$jitsi_component" "$loglevel" "$event_time" "$jvb_id" "jvb removed" "")
db_query "$db_insert"
# bridge lost (just in case the removal was not detected)
elif [[ "$line" =~ Jicofo\ ([0-9-]+\ [0-9:.]+)\ ([A-Z]+):.*\BridgeSelector\.removeJvbAddress.*:\ Lost\ a\ bridge:\ .*@.*\/(.*) ]]; then
event_time="${BASH_REMATCH[1]}"
loglevel="${BASH_REMATCH[2]}"
jvb_id="${BASH_REMATCH[3]}"
db_insert=$(printf "$db_insert_jitsi_component_event_template" "$jitsi_component" "$loglevel" "$event_time" "$jvb_id" "jvb lost" "")
db_query "$db_insert"
# locate conference starting event # locate conference starting event
elif [[ "$line" =~ Jicofo\ ([0-9-]+\ [0-9:.]+)\ ([A-Z]+):.*\[room=([^ ]+)@(.*)\]\ JitsiMeetConferenceImpl\.joinTheRoom ]]; then elif [[ "$line" =~ Jicofo\ ([0-9-]+\ [0-9:.]+)\ ([A-Z]+):.*\[room=([^ ]+)@(.*)\]\ JitsiMeetConferenceImpl\.joinTheRoom ]]; then
event_time="${BASH_REMATCH[1]}" event_time="${BASH_REMATCH[1]}"