Clens up variable names.

main
Yasen Pramatarov 2024-06-01 23:08:31 +03:00
parent 137d216038
commit 7bd5b9a253
1 changed files with 7 additions and 7 deletions

14
jilo
View File

@ -197,34 +197,34 @@ jitsi_log_parse() {
# locate participant joining event # locate participant joining event
elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[confId=${conference_id}\ .*epId=([a-zA-Z0-9-]+)\ stats_id=([a-zA-Z0-9-]+)\ .*Starting\ the\ Agent\ without\ remote\ candidates ]]; then elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[confId=${conference_id}\ .*epId=([a-zA-Z0-9-]+)\ stats_id=([a-zA-Z0-9-]+)\ .*Starting\ the\ Agent\ without\ remote\ candidates ]]; then
participant_join_time="${BASH_REMATCH[1]}" event_time="${BASH_REMATCH[1]}"
event_type='participant joining' event_type='participant joining'
participant_endpoint_id="${BASH_REMATCH[2]}" participant_endpoint_id="${BASH_REMATCH[2]}"
participant_stats_id="${BASH_REMATCH[3]}" participant_stats_id="${BASH_REMATCH[3]}"
if [[ -n "$conference_id" ]]; then if [[ -n "$conference_id" ]]; then
db_insert=$(printf "$db_insert_participant_template" "$conference_id" "$participant_join_time" "$event_type" "$participant_endpoint_id" "$participant_stats_id" "") db_insert=$(printf "$db_insert_participant_template" "$conference_id" "$event_time" "$event_type" "$participant_endpoint_id" "$participant_stats_id" "")
db_query "$db_insert" db_query "$db_insert"
fi fi
# locate participant pair selection event # locate participant pair selection event
elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[confId=${conference_id}\ .*epId=${participant_endpoint_id}\ stats_id=${participant_stats_id}\ .*Selected\ pair\ for\ stream\ .*([0-9.]+):10000/udp/srflx\ \-\>\ ([0-9.]+):[0-9]+/udp/prflx ]]; then elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[confId=${conference_id}\ .*epId=${participant_endpoint_id}\ stats_id=${participant_stats_id}\ .*Selected\ pair\ for\ stream\ .*([0-9.]+):10000/udp/srflx\ \-\>\ ([0-9.]+):[0-9]+/udp/prflx ]]; then
participant_join_time="${BASH_REMATCH[1]}" event_time="${BASH_REMATCH[1]}"
event_type='pair selected' event_type='pair selected'
participant_IP="${BASH_REMATCH[3]}" participant_IP="${BASH_REMATCH[3]}"
if [[ -n "$conference_id" ]]; then if [[ -n "$conference_id" ]]; then
db_insert=$(printf "$db_insert_participant_template" "$conference_id" "$participant_join_time" "$event_type" "$participant_endpoint_id" "$participant_stats_id" "$participant_IP") db_insert=$(printf "$db_insert_participant_template" "$conference_id" "$event_time" "$event_type" "$participant_endpoint_id" "$participant_stats_id" "$participant_IP")
db_query "$db_insert" db_query "$db_insert"
fi fi
# locate participant leaving event # locate participant leaving event
elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[confId=${conference_id}\ .*epId=${participant_endpoint_id}\ stats_id=${participant_stats_id}\]\ Endpoint\.expire.*:\ Expired\. ]]; then elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[confId=${conference_id}\ .*epId=${participant_endpoint_id}\ stats_id=${participant_stats_id}\]\ Endpoint\.expire.*:\ Expired\. ]]; then
participant_join_time="${BASH_REMATCH[1]}" event_time="${BASH_REMATCH[1]}"
event_type='participant leaving' event_type='participant leaving'
if [[ -n "$conference_id" ]]; then if [[ -n "$conference_id" ]]; then
db_insert=$(printf "$db_insert_participant_template" "$conference_id" "$participant_join_time" "$event_type" "$participant_endpoint_id" "$participant_stats_id" "$participant_IP") db_insert=$(printf "$db_insert_participant_template" "$conference_id" "$event_time" "$event_type" "$participant_endpoint_id" "$participant_stats_id" "$participant_IP")
db_query "$db_insert" db_query "$db_insert"
# the participant left, forget about him # the participant left, forget about him
unset $participant_join_time $event_type $participant_endpoint_id $participant_stats_id $participant_IP unset $event_time $event_type $participant_endpoint_id $participant_stats_id $participant_IP
fi fi
# locate the corresponding conference ending event # locate the corresponding conference ending event