Added WEB scripts

This commit is contained in:
svk28 2017-08-21 15:10:41 +03:00
parent a6dc8d3836
commit e3bdf5e967
2 changed files with 20 additions and 15 deletions

View File

@ -80,16 +80,16 @@ def parce_string(line):
dial_number = dial_number[3:] dial_number = dial_number[3:]
else: call_direct = "Исходящий" else: call_direct = "Исходящий"
insert(call_date=call_date, insert(call_date=call_date,
call_time=call_time, call_time=call_time,
int_number=int_number, int_number=int_number,
ext_co_line=ext_co_line, ext_co_line=ext_co_line,
dial_number=dial_number, dial_number=dial_number,
ring=ring, ring=ring,
call_duration=call_duration, call_duration=call_duration,
acc_code=acc_code, acc_code=acc_code,
call_code=call_code, call_code=call_code,
call_direct=call_direct) call_direct=call_direct)
def port_data_read(port_name): def port_data_read(port_name):
global out_dir global out_dir

View File

@ -9,7 +9,6 @@ package require mysqltcl
# параметры соединения с СУБД # параметры соединения с СУБД
#source config.tcl
#set db(host) "host" #set db(host) "host"
#set db(user) "user" #set db(user) "user"
#set db(pass) "password" #set db(pass) "password"
@ -72,12 +71,18 @@ proc ParceString {line} {
InsertData InsertData
} }
proc Read {} {
global fh
if {[gets $fh line] >= 0} {
ParceString $line
}
}
proc PortDataRead {portName} { proc PortDataRead {portName} {
global out_dir global out_dir fh
set fh [open $portName RDONLY] set fh [open $portName RDONLY]
fconfigure $fh -blocking 0 -buffering none -mode 9600,n,8,1 -translation crlf -eofchar {} fconfigure $fh -blocking 0 -buffering line -mode 9600,n,8,1 -translation crlf -eofchar {}
fileevent $fh readable [list read $fh] fileevent $fh readable Read
puts "Waiting for Capture data"
vwait forever vwait forever
} }