# ATSlog version 2.1.1 build 664 www.atslog.com # # VENDOR: Samsung # MODELS: OFFICESERV-7200,OFFICESERV-500,OFFICESERV-100,IDCS-500 # AUTHOR: Sergey Solonina # # TESTLOG: Samsung OfficeServ 7200.txt # TESTLOG: Samsung OfficeServ 500.txt # TESTLOG: Samsung iDCS 500.txt # # Samsung OfficeServ 7200 library (c) 2006 Sergey Solonina # Patched for more accurate regexp and OFFICESERV-500 support by Alex Samorukov, samm@os2.kiev.ua # sub parsecurcalls() { while ($str=) { $stringnumber++; if ($str =~ /(\d) (.{4}) (.{4}) (.{4}) (\d{2})\/(\d{2}) (\d{2})\:(\d{2})\:(\d{2}) (\d{2})\:(\d{2})\:(\d{2}) (.{2}) (.{18})/) { unitecurcalls(); #print ("Ok\n"); }else { #print("$stringnumber\n"); print $str if ($vars{debug} =~ /yes/i and $str !~ /^$/) }; }; }; sub unitecurcalls() { $internally=$2; $co=$4; $Month=$5; $Day=$6; my $flags=$13; $dialed_number=$14; $Year = (localtime())[5]; $Year += 1900; $CallHour=$7; $CallMinute=$8; $CallSeconds=$9; $duration = (($10*60*60)+($11*60)+$12); $timeofcall = "$Year-$Month-$Day $CallHour\:$CallMinute\:$CallSeconds"; SWITCH: { $flags =~ /xT/i and $forwarded=3, last SWITCH; $flags =~ /T/i and $forwarded=1, last SWITCH; $flags =~ /xI/i and $forwarded=2, last SWITCH; $forwarded=0; } if ($dialed_number=~/(\d+)/) { $number=$1; } else { $number=0; } if ($co=~/(\d+)/) { $co=$1; } else { $co=0; } if ($flags =~ /T/i or $flags =~ /I/i) { $way='1'; }else{ $way='2'; } if ($timeofcall ne "") { $callsCount++; } #print("Ok: '$stringnumber' '$timeofcall' '$forwarded' '$internally' '$co' '$way' '$number' '$duration'\n"); WriteRecord($timeofcall, $forwarded, $internally, $co, $way, $number, $duration); } 1;