Jitsi Meetの会議開催状況をログ・ファイルから取得する

 前回及び前々回は閉域網にJitsi Meetの構築を紹介しました。COVID-19感染拡大の影響で院内のビデオ会議によるカンファレンス等のニーズが増えてきました。電子カルテのネットワークに影響を避けるため、Jitsi Meetの利用状況をログファイルから取得するようにしました。

ログファイルのサンプル:

Jicofo 2021-09-18 07:52:01.657 情報: [88] org.jitsi.jicofo.xmpp.FocusComponent.log() Focus request for room: test@conference.10.120.8.204

Jicofo 2021-09-18 07:52:01.658 情報: [88] org.jitsi.jicofo.FocusManager.log() Created new focus for test@conference.10.120.8.204@auth.10.120.8.204. Conference count 1,options: channelLastN=-1 enableLipSync=false openSctp=true disableRtx=false 

Jicofo 2021-09-18 07:52:01.659 情報: [88] org.jitsi.jicofo.JitsiMeetConferenceImpl.log() Joining the room: test@conference.10.120.8.204

Jicofo 2021-09-18 07:52:01.772 情報: [42] org.jitsi.jicofo.ChatRoomRoleAndPresence.log() Chat room event ChatRoomMemberPresenceChangeEvent[type=MemberJoined sourceRoom=org.jitsi.impl.protocol.xmpp.ChatRoomImpl@2c54c4b3 member=ChatMember[test@conference.10.120.8.204/c184dd0e, jid: null]@2049783322]

Jicofo 2021-09-18 07:52:01.776 情報: [42] org.jitsi.jicofo.ChatRoomRoleAndPresence.log() Granted owner to test@conference.10.120.8.204/c184dd0e

Jicofo 2021-09-18 07:52:01.776 情報: [42] org.jitsi.jicofo.JitsiMeetConferenceImpl.log() Member test@conference.10.120.8.204/c184dd0e joined.

Jicofo 2021-09-18 07:55:07.067 情報: [42] org.jitsi.jicofo.ChatRoomRoleAndPresence.log() Chat room event ChatRoomMemberPresenceChangeEvent[type=MemberLeft sourceRoom=org.jitsi.impl.protocol.xmpp.ChatRoomImpl@2c54c4b3 member=ChatMember[test@conference.10.120.8.204/c184dd0e, jid: gy2hkp_hyxl_l-zu@10.120.8.204/assk9fMm]@2049783322]

Jicofo 2021-09-18 07:55:07.067 情報: [42] org.jitsi.jicofo.ChatRoomRoleAndPresence.log() Owner has left the room !

Jicofo 2021-09-18 07:55:07.068 情報: [42] org.jitsi.jicofo.JitsiMeetConferenceImpl.log() Member test@conference.10.120.8.204/c184dd0e is leaving

Jicofo 2021-09-18 07:55:07.068 警告: [42] org.jitsi.jicofo.JitsiMeetConferenceImpl.log() Participant not found for test@conference.10.120.8.204/c184dd0e terminated already or never started ?

Jicofo 2021-09-18 07:55:07.071 情報: [42] org.jitsi.jicofo.FocusManager.log() Disposed conference for room: test@conference.10.120.8.204 conference count: 0

そして、下記のようなテーブルにしてみました。

2021-09-18
会議名-開催回開始時刻終了時刻延べ参加者数現在参加者数
kannfarennsu -107:29:02.33507:29:18.30710
kannfarennsu -207:36:13.81607:37:47.06510
test -107:52:01.65807:55:07.07110



phpをJitsi Meetと同じサーバに実装する場合、必要ないのですが、こちらのサンプルは、BitnamiのRedmineで使うApache2に実装したため、Windows版のsshfsを使ってWindows 2019サーバにマウントして取得しています。

以下はPHP

<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <meta http-equiv="refresh" content="300";>
    <title>Document</title>
</head>
<body>
<?php
date_default_timezone_set('Asia/Tokyo');
$date = new DateTime();
print "<hr>Jitsiビデオ会議サーバ204利用状況   更新日時:".$date->format('Y-m-d H:i:s')."<hr>";

function log2table($logfile) {
$filter=['Created','Member','Disposed'];
$room_used=[];
$start_time=[];
$total_member=[];
$current_member=[];
$end_time=[];

$fp=fopen($logfile,'r');
while (!feof($fp)) {
$line=fgets($fp);
$fields=explode(" ",$line);
if (in_array($fields[6],$filter)){
$room = preg_replace('/.* ([^ ]*)@conference(.*)/i','$1',$line);
if (!array_key_exists($room,$room_used)) {
$room_used[$room]=0;
$today=$fields[1];
}
if ($fields[6]=='Created'){
$room_used[$room]=$room_used[$room]+1;
//$start_time[$room."-".$room_used[$room]]=$fields[1]." ".$fields[2];
$start_time[$room."-".$room_used[$room]]=$fields[2];
$total_member[$room."-".$room_used[$room]]=0;
$current_member[]=0;
}
if ($fields[6]=='Member'){
if (substr($fields[8],0,6)=='joined'){
$total_member[$room."-".$room_used[$room]]=$total_member[$room."-".$room_used[$room]]+1;
$current_member[$room."-".$room_used[$room]]=$current_member[$room."-".$room_used[$room]]+1;
}
if (substr($fields[9],0,7)=='leaving'){
$current_member[$room."-".$room_used[$room]]=$current_member[$room."-".$room_used[$room]]-1;
}
}

if ($fields[6]=='Disposed'){
//$end_time[$room."-".$room_used[$room]]=$fields[1]." ".$fields[2];
$end_time[$room."-".$room_used[$room]]=$fields[2];
}
}
}
fclose($fp);

print "<hr>".$today."<hr>";
print '<table border=1><tr><td>会議名-開催回</td><td>開始時刻</td><td>終了時刻</td><td>延べ参加者数</td><td>現在参加者数</td></tr>';
foreach ($start_time as $key => $value){
print '<tr><td>'.$key."</td><td>".$value."</td><td>".$end_time[$key]."</td><td>".$total_member[$key]."</td><td>".$current_member[$key]."</td></tr>";
}
print '</table>';
}

log2table("C:/Bitnami/redmine-4.1.1-5/apache2/htdocs/tools/jicofo.log");
log2table("C:/Bitnami/redmine-4.1.1-5/apache2/htdocs/tools/jicofo.log.1");

?>

</body>
</html>



コメント

  1. All of the beneficial casinos here are are|listed under are} respectable websites that keep players protected. They respect gambling rules and age restrictions, providing an excellent real cash gaming expertise in a safe setting dedicated to players' welfare and safety on-line. It even gives you an impressive bonus daily and great chances to win the Jackpot. You can double or quadruple your bets to have a better probability of profitable. As you enhance the degrees, you'll unlock exciting features. Of the most effective free slot machine 1xbet korea apps, that is the one which receives the most constructive responses from customers on the internet.

    返信削除

コメントを投稿

人気の投稿