bash - Asterisk: How to convert time to seconds -
i want print result when $9 greather 1 hour
how can convert seconds? can use 3600sec check.
$9 = duration of call 00:00:00
asterisk -rx "core show channels verbose" | awk '$9 > "01:00:00"' | awk '$6 == "dial"' | wc -l > test.txt
as mentioned, easiest thing check if first 2 digits of time not "00". this:
asterisk -rx "core show channels verbose" | awk '$9 !~ /00:..:../ && $6 == "dial"' | wc -l
that means match , record "01:00:00" may not want :-( . matches "$9 greater or equal 1 hour".
this match "greater than" condition:
asterisk -rx "core show channels verbose" | awk '$9 !~ /00:..:../ && $9 != "01:00:00" && $6 == "dial"' | wc -l
Comments
Post a Comment