from csv import reader, writer
from datetime import datetime
def main():
input_file = 'IN.csv'
output_file = 'OUT_new.csv'
r = reader(open(input_file))
lines = list(r)
for line in lines:
setuptime = line[13].split("=")[1]
d_in = datetime.strptime((setuptime), '%Y-%m-%d %H:%M:%S')
d_out = d_in.strftime('%H:%M:%S.000 +0700 %a %b %d %Y')
line[13] = " TIME=" + d_out
write = writer(open(output_file, 'w', newline=''))
write.writerows(lines)
if __name__ == '__main__':
main()
RESULT=xxxxx, TIME=2020-01-20 18:43:12, HOST=xxxxxxxxxxx, NAME=xxxxxxxx
RESULT=xxxxx, TIME=2020-01-20 18:43:20, HOST=xxxxxxxxxxx, NAME=xxxxxxxx
RESULT=xxxxx, TIME=2020-01-20 18:43:25, HOST=xxxxxxxxxxx, NAME=xxxxxxxx
RESULT=xxxxx, TIME=18:43:12.000 +0700 Mon Jan 20 2020, HOST=xxxxxxxxxxx, NAME=xxxxxxxx
RESULT=xxxxx, TIME=18:43:20.000 +0700 Mon Jan 20 2020, HOST=xxxxxxxxxxx, NAME=xxxxxxxx
RESULT=xxxxx, TIME=18:43:25.000 +0700 Mon Jan 20 2020, HOST=xxxxxxxxxxx, NAME=xxxxxxxx
host dynamic
ipaddr xxx.xxx.xxx.95
regseconds 1506935559
centos*CLI> sip show settings
Global Settings:
Qualify: 2000
centos*CLI> realtime load sippeers name 200
Column Name Column Value
name 200
cid_number 200
nat force_rport,comedia
disallow all
allow ulaw
allow alaw
context out
qualify yes
При регистрации в поле контакт мы указываем строку с параметром vireg. При входящем инвайте эта строка должна полностью содержаться в RURI запроса, иначе мы не сможем обработать данный звонок
[directories](!)
astetcdir => /etc/asterisk
astmoddir => /usr/lib64/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
astsbindir => /usr/sbin