fixed date string

git-svn-id: svn://192.168.202.10@1035 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mikec
2009-01-20 21:45:52 +00:00
parent 63bf88e5a6
commit 5f77404afd
+10
View File
@@ -17,6 +17,15 @@ if (($phone_number eq "--help") || ($exten eq "--help") || ($cid_name eq "--help
# get the current time
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = ($year + 1900);
$mon++;
if ($mon < 10) {$mon = "0$mon";}
if ($mday < 10) {$mday = "0$mday";}
if ($hour < 10) {$Fhour = "0$hour";}
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
my $date = "$year-$mon-$mday $hour:$min:$sec";
# default path to astguiclient configuration file:
@@ -50,6 +59,7 @@ $dbhB = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
# Insert our call record
$stmtB = "INSERT INTO vicidial_manager values( '', '', '$date', 'NEW', 'N', '$VARserver_ip', '', 'Originate', 'TESTCIDBLASTCALL0124', 'Channel: Local/$phone_number@default', 'Context; default', 'Exten: $exten', 'Priority: 1', 'Callerid: \"$cid_name\" <$cid_num>', '', '', '', '', '' );";
print $stmtB . "\n";
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
$sthB->finish();