Skip to content

Commit e82427c

Browse files
committed
Merge branch 'development'
2 parents ef58301 + da460a5 commit e82427c

File tree

15 files changed

+486
-264
lines changed

15 files changed

+486
-264
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ The application itself works by parsing log files for call-id strings and closin
1616
* Run created task and check /etc/application.log for any errors or exceptions.
1717

1818
## Release notes ##
19-
### 1.01 ###
19+
20+
### 1.1 ###
21+
* Added SQLite database as a persistent database engine instead of NoSQL MapDB.
22+
* Reworked application architecture.
23+
* In case of any problems with DB, version 1.01 of this application can be used.
24+
25+
#### 1.01 ####
2026
* Added new configuration timers: sipByeSenderPause and applicationClosingTimer. Detailed description about each timer see in config.properties file.
2127
* Fixed bug caused some performance slowdown on processing inbound responses
2228

pom.xml

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>ru.cti</groupId>
88
<artifactId>verintbyehandler</artifactId>
9-
<version>1.0-SNAPSHOT</version>
9+
<version>1.1-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111

1212
<properties>
@@ -37,26 +37,6 @@
3737
<target>1.6</target>
3838
</configuration>
3939
</plugin>
40-
<plugin>
41-
<groupId>org.codehaus.mojo</groupId>
42-
<artifactId>exec-maven-plugin</artifactId>
43-
<version>1.1.1</version>
44-
<executions>
45-
<execution>
46-
<phase>test</phase>
47-
<goals>
48-
<goal>java</goal>
49-
</goals>
50-
<configuration>
51-
<mainClass>ru.cti.verintsipbyehandler.Main</mainClass>
52-
<arguments>
53-
<argument>arg0</argument>
54-
<argument>arg1</argument>
55-
</arguments>
56-
</configuration>
57-
</execution>
58-
</executions>
59-
</plugin>
6040
<plugin>
6141
<groupId>org.codehaus.mojo</groupId>
6242
<artifactId>properties-maven-plugin</artifactId>
@@ -81,7 +61,7 @@
8161
<configuration>
8262
<archive>
8363
<manifest>
84-
<mainClass>ru.cti.verintsipbyehandler.Main</mainClass>
64+
<mainClass>ru.cti.verintsipbyehandler.controller.Main</mainClass>
8565
</manifest>
8666
</archive>
8767
<descriptorRefs>
@@ -126,9 +106,9 @@
126106
<version>${spring.version}</version>
127107
</dependency>
128108
<dependency>
129-
<groupId>org.mapdb</groupId>
130-
<artifactId>mapdb</artifactId>
131-
<version>2.0-beta13</version>
109+
<groupId>org.xerial</groupId>
110+
<artifactId>sqlite-jdbc</artifactId>
111+
<version>3.8.11.2</version>
132112
</dependency>
133113
<dependency>
134114
<groupId>javax.sip</groupId>

src/main/java/ru/cti/verintsipbyehandler/Configuration.java

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,27 @@
55
import org.springframework.context.annotation.PropertySource;
66
import org.springframework.context.annotation.PropertySources;
77
import org.springframework.core.env.Environment;
8+
import org.springframework.jdbc.datasource.SimpleDriverDataSource;
9+
import ru.cti.verintsipbyehandler.controller.CallHandler;
10+
import ru.cti.verintsipbyehandler.controller.CallParser;
11+
import ru.cti.verintsipbyehandler.controller.Main;
12+
import ru.cti.verintsipbyehandler.controller.dao.DAOFacade;
13+
import ru.cti.verintsipbyehandler.controller.SipLayer;
14+
import ru.cti.verintsipbyehandler.model.factory.CallsFactory;
815

916
import javax.sip.InvalidArgumentException;
1017
import javax.sip.ObjectInUseException;
1118
import javax.sip.PeerUnavailableException;
1219
import javax.sip.TransportNotSupportedException;
20+
import javax.sql.DataSource;
1321
import java.net.UnknownHostException;
1422
import java.util.TooManyListenersException;
1523

1624
/**
1725
* Spring Java configuration file
1826
*/
1927
@org.springframework.context.annotation.Configuration
20-
@PropertySources({ @PropertySource(value = "file:etc/config.properties")})
28+
@PropertySources({@PropertySource(value = "file:etc/config.properties")})
2129
public class Configuration {
2230
@Autowired
2331
Environment env;
@@ -27,14 +35,6 @@ public Main main() {
2735
return new Main(Integer.parseInt(env.getProperty("applicationClosingTimer")));
2836
}
2937

30-
@Bean
31-
public ParseAndProcessCalls parseAndProcessCalls() throws Exception {
32-
return new ParseAndProcessCalls(env.getProperty("regexp"),
33-
env.getProperty("risLogsFolderPath"),
34-
Integer.parseInt(env.getProperty("callTerminationTimeout")),
35-
Integer.parseInt(env.getProperty("completedCallDeletionTimer")),
36-
Integer.parseInt(env.getProperty("sipByeSenderPause")));
37-
}
3838

3939
@Bean
4040
public SipLayer sipLayer() throws InvalidArgumentException, PeerUnavailableException, UnknownHostException,
@@ -45,4 +45,35 @@ public SipLayer sipLayer() throws InvalidArgumentException, PeerUnavailableExcep
4545
env.getProperty("sip.destinationAddress"),
4646
env.getProperty("sipLibraryLogLevel"));
4747
}
48+
49+
@Bean
50+
public CallsFactory callsFabric() {
51+
return new CallsFactory();
52+
}
53+
54+
@Bean
55+
public DataSource dataSource() {
56+
SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
57+
dataSource.setDriverClass(org.sqlite.JDBC.class);
58+
dataSource.setUrl("jdbc:sqlite:db/sqlite.db");
59+
return dataSource;
60+
}
61+
62+
@Bean
63+
public DAOFacade daoFacade() {
64+
return new DAOFacade(dataSource());
65+
}
66+
67+
@Bean
68+
public CallParser callParser() {
69+
return new CallParser(env.getProperty("risLogsFolderPath"),
70+
env.getProperty("regexp"));
71+
}
72+
73+
@Bean
74+
public CallHandler callHandler() {
75+
return new CallHandler(Long.parseLong(env.getProperty("callTerminationTimeout")),
76+
Long.parseLong(env.getProperty("completedCallDeletionTimer")),
77+
Integer.parseInt(env.getProperty("sipByeSenderPause")));
78+
}
4879
}

src/main/java/ru/cti/verintsipbyehandler/ParseAndProcessCalls.java

Lines changed: 0 additions & 211 deletions
This file was deleted.

0 commit comments

Comments
 (0)