aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Context.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-02-21 15:20:25 +0500
committerAbyss777 <abyss@fox5.ru>2017-02-21 15:20:25 +0500
commitbd2a8efaddacbd8d8386ae38f000b633845639ab (patch)
tree80d4454311d9656fe79850ebcdb4131e3cc32634 /src/org/traccar/Context.java
parentb6af1e997c125336e2ce9f5056d9502743f22034 (diff)
downloadtrackermap-server-bd2a8efaddacbd8d8386ae38f000b633845639ab.tar.gz
trackermap-server-bd2a8efaddacbd8d8386ae38f000b633845639ab.tar.bz2
trackermap-server-bd2a8efaddacbd8d8386ae38f000b633845639ab.zip
Implement SMS notifications with help smpp protocol
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r--src/org/traccar/Context.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java
index c9c2e633e..6c271c3ed 100644
--- a/src/org/traccar/Context.java
+++ b/src/org/traccar/Context.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org)
+ * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -49,6 +49,7 @@ import org.traccar.geolocation.GeolocationProvider;
import org.traccar.geolocation.MozillaGeolocationProvider;
import org.traccar.geolocation.OpenCellIdGeolocationProvider;
import org.traccar.notification.EventForwarder;
+import org.traccar.smpp.SmppClient;
import org.traccar.web.WebServer;
public final class Context {
@@ -176,6 +177,12 @@ public final class Context {
return statisticsManager;
}
+ private static SmppClient smppClient;
+
+ public static SmppClient getSmppManager() {
+ return smppClient;
+ }
+
public static void init(String[] arguments) throws Exception {
config = new Config();
@@ -277,7 +284,7 @@ public final class Context {
notificationManager = new NotificationManager(dataManager);
Properties velocityProperties = new Properties();
velocityProperties.setProperty("file.resource.loader.path",
- Context.getConfig().getString("mail.templatesPath", "templates/mail") + "/");
+ Context.getConfig().getString("templates.rootPath", "templates") + "/");
velocityProperties.setProperty("runtime.log.logsystem.class",
"org.apache.velocity.runtime.log.NullLogChute");
@@ -301,6 +308,10 @@ public final class Context {
statisticsManager = new StatisticsManager();
+ if (config.getBoolean("sms.smpp.enable")) {
+ smppClient = new SmppClient();
+ }
+
}
public static void init(IdentityManager testIdentityManager) {