aboutsummaryrefslogtreecommitdiff
path: root/opengts.cfg
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-02-10 11:04:02 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-02-10 11:04:02 +1300
commitc37b9de4b1a5d678c191f209b2b8f2447492a5c3 (patch)
treee7a5607a5a0657843e04e40f429d13087af56de5 /opengts.cfg
parent0ccf90b139ac70b69145a3e2d9dd763a7c8379fa (diff)
downloadtrackermap-server-c37b9de4b1a5d678c191f209b2b8f2447492a5c3.tar.gz
trackermap-server-c37b9de4b1a5d678c191f209b2b8f2447492a5c3.tar.bz2
trackermap-server-c37b9de4b1a5d678c191f209b2b8f2447492a5c3.zip
Improve OpenGTS config (fix #1021)
Diffstat (limited to 'opengts.cfg')
-rw-r--r--opengts.cfg4
1 files changed, 2 insertions, 2 deletions
diff --git a/opengts.cfg b/opengts.cfg
index a7bcad2ad..bee6d9e15 100644
--- a/opengts.cfg
+++ b/opengts.cfg
@@ -16,8 +16,8 @@
<entry key='database.insertPosition'>
START TRANSACTION;
- UPDATE Device SET lastValidLatitude = :latitude, lastValidLongitude = :longitude, lastGPSTimestamp = UNIX_TIMESTAMP(:time), lastUpdateTime = UNIX_TIMESTAMP(NOW()) WHERE imeiNumber = :device_id;
- SELECT @accountID := accountID, @deviceID := deviceID FROM Device WHERE imeiNumber = :device_id;
+ UPDATE Device SET lastValidLatitude = :latitude, lastValidLongitude = :longitude, lastGPSTimestamp = UNIX_TIMESTAMP(:time), lastUpdateTime = UNIX_TIMESTAMP(NOW()) WHERE imeiNumber = RIGHT(CONCAT('000000000000000', :device_id), 15);
+ SELECT @accountID := accountID, @deviceID := deviceID FROM Device WHERE imeiNumber = RIGHT(CONCAT('000000000000000', :device_id), 15);
INSERT INTO EventData (accountID, deviceID, timestamp, statusCode, latitude, longitude, speedKPH, heading, altitude, rawData, creationTime, address)
VALUES (@accountID, @deviceID, UNIX_TIMESTAMP(:time), 0, :latitude, :longitude, :speed * 1.852, :course, :altitude, '', UNIX_TIMESTAMP(NOW()), :address);
COMMIT;