Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create answering machine intellegently catching SPAM calls #41

Open
wants to merge 153 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
c1eff12
Starting point for a crazy answer bot that can catch spam calls.
haumacher Oct 28, 2023
7b2684a
Adjusted to mjsip API change.
haumacher Oct 28, 2023
393b8cc
Use new file per recording.
haumacher Oct 30, 2023
311ada5
Switched to args4j for command-line arguments parsing.
haumacher Oct 31, 2023
6872ae8
Allow to configure dialog and recoding dirs.
haumacher Nov 1, 2023
41167f3
Added DynIP servlet for updating IP addresses for PhoneBlock-AB.
haumacher Nov 1, 2023
bec1c39
Added check for the conversation directory to exist.
haumacher Nov 5, 2023
8520c64
Added configuration template and lanch config for Fritz!Box access.
haumacher Nov 5, 2023
ca8c3b2
Added configuration options to control the answerbot dialogue.
haumacher Nov 5, 2023
f44d14f
Completed call handling in phoneblock-ab.
haumacher Nov 6, 2023
c3d8df0
Added user agent header for PhoneBlock lookup.
haumacher Nov 6, 2023
5f4248c
Moved PhoneBlock answerbot to canonical package.
haumacher Nov 6, 2023
43206f1
Create README.md for anwserbot
haumacher Nov 6, 2023
438498b
Preparation to register answer bot to multiple registrars.
haumacher Nov 7, 2023
5070568
Extracted all options specific for a single customer to CustomerOptions.
haumacher Nov 7, 2023
24bc0bb
Made customer config dynamic.
haumacher Nov 7, 2023
c6b06d7
Bugfix: Parsing user from SIP header must use SipParser.
haumacher Nov 10, 2023
735d5cc
Bugfix: Must use a negative refuse time to prevent immediate refuse.
haumacher Nov 10, 2023
e39b908
Ignore test launchers.
haumacher Nov 10, 2023
d5d14de
Enhanced checks of incoming call.
haumacher Nov 10, 2023
2e3fbd2
Extracted SecureRandomService.
haumacher Nov 10, 2023
c274967
Moved TestDomUtil to canonical package.
haumacher Nov 11, 2023
8777115
Do not unconditionally reset services during shutdown.
haumacher Nov 11, 2023
36175ff
Added setter methods.
haumacher Nov 11, 2023
f28acb5
Applied migration Scheduler is now an interface.
haumacher Nov 11, 2023
3808bc0
Starting point for SipService.
haumacher Nov 11, 2023
72b3074
Starting point for answer bot setup pages.
haumacher Nov 11, 2023
ff01c3c
Fixed accept-anonymous option accepting yes/no.
haumacher Nov 13, 2023
46a5262
Added starting point for WAV resampling tool.
haumacher Nov 13, 2023
20da882
Fixed buffer handling in resample tool, use libresample4j.
haumacher Nov 13, 2023
7e14cba
Adjusted to modularization of mjsip, introduced answer bot module.
haumacher Nov 16, 2023
746f933
Removed libresample4j dependency.
haumacher Nov 16, 2023
b38940d
Added tool to initialize an answer bot conversion from recorded audio.
haumacher Nov 16, 2023
4d9b61d
Better defined types of speech produced by the answer bot.
haumacher Nov 16, 2023
9723815
Made org.mjsip.sound a transitive dependency.
haumacher Nov 16, 2023
11641b8
The registrar option is mandatory.
haumacher Nov 16, 2023
aeb5539
Use AudioType enum for supported audio formats of the answer bot.
haumacher Nov 16, 2023
623098c
Open config types to args4j to allow command line parsing with modules.
haumacher Nov 16, 2023
8c27edc
Added module path to Eclipse settings.
haumacher Nov 16, 2023
263b647
Use utf-8 for test sources.
haumacher Nov 16, 2023
ce9feb5
Updated URLs after moving to phoneblock.net.
haumacher Nov 17, 2023
ed77f0b
Added route and force-rport options to the config template.
haumacher Nov 17, 2023
801d026
Fixed wrong key for lookup of audio file.
haumacher Nov 17, 2023
0735e95
More logging.
haumacher Nov 18, 2023
e3adaa3
Added transitive module requirement.
haumacher Nov 18, 2023
353af04
Added test number prefix configuration option.
haumacher Nov 18, 2023
7fef195
Added README for the conversion folder.
haumacher Nov 19, 2023
7c947fd
Migrated due to mySIP API change of registrar and route settings.
haumacher Nov 19, 2023
5b2e7a8
Separated schema for used, dyndns and sip settings.
haumacher Nov 19, 2023
b95f8fa
Prevent NPE, if conversation directory does not exist.
haumacher Nov 19, 2023
9e9f6ba
Added setters to bot configuration.
haumacher Nov 19, 2023
f9b3760
Log failure, if DynDNS request crashes.
haumacher Nov 19, 2023
6b01b92
First working version of built-in SIP service.
haumacher Nov 19, 2023
8106405
Added call handling for multiple clients.
haumacher Nov 19, 2023
df858c5
Create format directories in conversion directory, if they do not exist.
haumacher Nov 25, 2023
d67241f
Detect answer of counterpart, even if PhoneBlock is currently speaking.
haumacher Nov 26, 2023
f1a2cf2
Updated configuration template.
haumacher Nov 26, 2023
ff0753b
There is only a single match for media to select.
haumacher Nov 26, 2023
0c1a923
Clear state selection if there is silence again.
haumacher Nov 26, 2023
bd9aca8
Typo, added more suggestions to conversation.
haumacher Nov 26, 2023
e4ec38d
Added parsing label of caller.
haumacher Nov 27, 2023
46a6a78
Adjusted to mjSip API change.
haumacher Nov 27, 2023
3f43d1e
Added task updating answerbot registrations upon change.
haumacher Nov 27, 2023
8055eb3
Always anser local (test) calls.
haumacher Dec 18, 2023
7edc4ae
Allow to enable/disable answer bots through JMX.
haumacher Dec 18, 2023
842d45b
Update "registered" flag when registering/unregistering a bot.
haumacher Dec 20, 2023
89a11b2
Allow to start/stop the SIP service from JMX.
haumacher Dec 28, 2023
1be8142
Use version of phoneblock-shared artifact.
haumacher Dec 28, 2023
0d16659
Only read supported (configured) media types.
haumacher Dec 28, 2023
2b0d67b
Added logging configuration for standalone phoneblock-ab.
haumacher Dec 28, 2023
9a68396
Use more reasonable module names.
haumacher Dec 29, 2023
4e52c16
Applied migration: Use thread pool for RTP streams.
haumacher Dec 31, 2023
0ad962c
Initially working starting point for Flutter UI for answerbot config.
haumacher Jan 1, 2024
a4b96c9
Added listing answer bots and added starting point for bot config.
haumacher Jan 1, 2024
08539ad
Removed hard-coded phoneblock.net address.
haumacher Jan 8, 2024
ea01c4a
Resolved configured via host names to IP addresses.
haumacher Jan 13, 2024
a37ea79
Applied fixes suggested by dart fix.
haumacher Jan 14, 2024
f769288
First working prototype of Flutter answer bot configuration UI.
haumacher Jan 18, 2024
9c56cb0
Allow refreshing the bot list.
haumacher Jan 18, 2024
30c9d75
Updated H2 to version 2.2.224.
haumacher Jan 20, 2024
952b6bd
Added API to delete an answerbot.
haumacher Jan 21, 2024
b8fc013
Updated msgbuf dependency.
haumacher Jan 21, 2024
2eee646
Added API to retrieve same number infos as web page search.
haumacher Jan 21, 2024
a2c5a95
Fixed JSPs after class move.
haumacher Jan 21, 2024
83bb3f9
Remember originally requested location before authentication.
haumacher Jan 21, 2024
554e9e0
Added allowed origin https://phoneblock.net to CORS filter.
haumacher Jan 22, 2024
0110009
Added logging of received answerbot commands.
haumacher Jan 22, 2024
be812f3
Added UI for enabling/disabling/deleting answer bots.
haumacher Jan 22, 2024
73dc322
Added logo drafts for the new PhoneBlock answerbot service.
haumacher Jan 22, 2024
06a636c
Ignore calls with local address book entry.
haumacher Jan 22, 2024
2bb628e
Record number an duration of processes spam calls per user.
haumacher Jan 22, 2024
9544b8f
Bugfix: Must return after sending error result to prevent NPE.
haumacher Jan 27, 2024
d5840a5
Prevent string index out of bound when running in root context.
haumacher Jan 28, 2024
3def122
Added backward compatibility to filter implementation.
haumacher Jan 28, 2024
e416d82
Allow to configure database with system properties.
haumacher Jan 28, 2024
86ad819
Allow to configure mail service with system properties.
haumacher Jan 28, 2024
00e285b
Automatically detect version of webjar dependencies.
haumacher Jan 28, 2024
8469439
Added plugins to run PhoneBlock locally with jetty:run plugin.
haumacher Jan 28, 2024
c1438c3
Enable calling to the host the Flutter UI is served from.
haumacher Jan 28, 2024
12d1f10
Use official context path /phoneblock even for local test.
haumacher Jan 28, 2024
dbd40a1
Disabled CORS filter, which should not be necessary.
haumacher Jan 28, 2024
f16d0e0
Show progress while answerbot tries to register.
haumacher Jan 28, 2024
2c5899a
Fixed display issue after deleting the last answerbot.
haumacher Jan 28, 2024
8944468
Show progress, when enabling a registered answerbot.
haumacher Jan 28, 2024
100dc69
Only allow access to own answer bots.
haumacher Jan 29, 2024
433317d
Again authenticate answerbot API calls.
haumacher Jan 29, 2024
bd33678
Removed duplicate constraint.
haumacher Jan 29, 2024
29660f5
Mark bot registered when successfully checked.
haumacher Jan 29, 2024
6aceb01
Split UI code into multiple files.
haumacher Jan 29, 2024
59eeb50
Allow to show answered calls.
haumacher Jan 29, 2024
c5d8500
Display details of phone numbers, allow to open answerbot settings.
haumacher Jan 29, 2024
62872df
Ignore properties plugin in Eclipse.
haumacher Jan 29, 2024
6b08d10
Updated Eclipse settings.
haumacher Jan 29, 2024
debbccc
Moved comment on CORS filter to the filter definition.
haumacher Jan 29, 2024
a83d248
Made file name of CallListView consistent with defined class.
haumacher Jan 29, 2024
c9acb89
Show bot list after deleting a bot.
haumacher Jan 29, 2024
f752ba9
Enhanced setup help.
haumacher Jan 29, 2024
8259590
Added help pictures for DynDNS setup.
haumacher Jan 29, 2024
318f0de
Remember target location during registration/login process.
haumacher Feb 2, 2024
014cb29
Starting point for answering machine setup instructions.
haumacher Feb 2, 2024
ea55b04
Added icons to the answerbost app. Improved error messages.
haumacher Feb 4, 2024
bb2ef6a
Allow completing setup answerbot when setup was interrupted.
haumacher Feb 4, 2024
a8a2b74
Allow to delete an incompletely configured answer bot.
haumacher Feb 4, 2024
86257b8
Logo for bot in bot list, made app bar logo monochrome.
haumacher Feb 4, 2024
53801c5
Completed answerbot setup instructions. Adjusted rest of the site.
haumacher Feb 4, 2024
0b184be
Disabled CORS filter, since app is distributed from same origin.
haumacher Feb 4, 2024
ae4e14e
Show number of calls and total talk time in bot list.
haumacher Feb 4, 2024
bc9f958
Added Jetty CORS filter for local debugging.
haumacher Feb 4, 2024
5233fa6
Added setting to debug locally.
haumacher Feb 4, 2024
c396c38
Applied proposed dart fixes.
haumacher Feb 4, 2024
4adda77
Updated dependencies.
haumacher Feb 4, 2024
b112b6e
Round talk time to full seconds.
haumacher Feb 4, 2024
d4489ec
Use text ellipsis for app title text.
haumacher Feb 6, 2024
51db453
Use landscape logo for medum.com story title.
haumacher Feb 6, 2024
89b7c20
Added another link to the answer bot setup page.
haumacher Feb 6, 2024
7121457
Fixed missing redirect to target page after login.
haumacher Feb 6, 2024
8baf313
Show number of new calls in bot list.
haumacher Feb 6, 2024
4ade065
Added missing increment of new call counter.
haumacher Feb 10, 2024
c02b409
Added documentation to answer bot command line options.
haumacher Feb 10, 2024
19298d6
Ticket #43: Added RSS feed link to the web site.
haumacher Feb 14, 2024
0188263
Added FAQ entry about accidentally blocked number.
haumacher Feb 14, 2024
dd9cc19
Ticket #45: Added option to retrieve full blocklist.
haumacher Feb 15, 2024
d0bdda2
Fixed URL of DynDNS service.
haumacher Feb 15, 2024
a6ea91e
Updated dependencies.
haumacher Feb 15, 2024
c3b258d
Enhanced answerbot setup instructions.
haumacher Feb 16, 2024
7059cc2
Added heading for installation test step.
haumacher Feb 16, 2024
a23f154
Added test instructions.
haumacher Feb 16, 2024
d629caa
Updated mobile app, added prototype of SPAM contact sync.
haumacher Feb 16, 2024
cd4443a
Added FAQ entries about blocklist synchronization.
haumacher Feb 16, 2024
ca1ab72
Fixed warnings.
haumacher Feb 16, 2024
a588f53
Use stable window name for inspecting a number.
haumacher Feb 17, 2024
ea2b497
No need to make sendRequest() async.
haumacher Feb 17, 2024
5ff274a
Starting point for login from within answerbot control app.
haumacher Feb 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 31 additions & 0 deletions phoneblock-ab/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="module" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
2 changes: 2 additions & 0 deletions phoneblock-ab/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target/
*.wav
36 changes: 36 additions & 0 deletions phoneblock-ab/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>phoneblock-ab</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
4 changes: 4 additions & 0 deletions phoneblock-ab/.settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=utf-8
encoding//src/test/java=utf-8
encoding/<project>=utf-8
12 changes: 12 additions & 0 deletions phoneblock-ab/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=11
4 changes: 4 additions & 0 deletions phoneblock-ab/.settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
5 changes: 5 additions & 0 deletions phoneblock-ab/.settings/org.eclipse.wst.common.component
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="phoneblock-ab">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
</wb-module>
</project-modules>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="11"/>
<installed facet="jst.utility" version="1.0"/>
</faceted-project>
16 changes: 16 additions & 0 deletions phoneblock-ab/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# phoneblock-ab - Der PhoneBlock-Anrufbeantworter

Das Blocklist-Telefonbuch wird immer größer. Mittlerweile hat es die 10.000 Nummmenmarke geknackt. Ein Telefonbuch in der
Fritz!Box kann aber je nach Modell nur höchstens 3000 bis 4000 Nummern fassen. Die Lösung ist der **PhoneBlock-Anrufbeantworter**.

Den PhoneBlock-Anrufbeantworter meldest du an Deiner Fritz!Box (oder einem beliebigen anderen VOIP-fähigen Internetrouter)
als Telefoniegerät "Telefon mit oder ohne Anrufbeantworter" an. Bei einem Anruf checkt der PhoneBlock-AB blitzschnell, ob die
anrufende Nummer auf der Blocklist steht und geht dann ran. Der Vorteil ist, dass die **Blocklist immer 100% aktuell** ist, da es
keinen nächtlichen Update-Lauf mehr gibt.

Das Witzige ist, dass der PhoneBlock-Anrufbeantworter deine unerwünschten Anrufer in ein richtiges Gespräch verwickeln und sie so
eine kleine Weile davon abhalten kann, andere zu nerven. Wie das geht? Wenn PhoneBlock einen Anruf annimmt, wird zuerst eine
Begrüßungsmeldung abgespielt. Danach wartet PhoneBlock, bis das Gegenüber etwas sagt und stellt danach vollkommen sinnlose
Rückfragen. Eine professionelle Telfonmarketingfachkraft kann sich so minutenlang mit PhoneBlock unterhalten.


1 change: 1 addition & 0 deletions phoneblock-ab/bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Test *.launch
29 changes: 29 additions & 0 deletions phoneblock-ab/bin/AnswerBot (Fritz!Box).launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<stringAttribute key="bad_container_name" value="/phoneblock-ab/b"/>
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/phoneblock-ab/src/main/java/de/haumacher/phoneblock/answerbot/AnswerBot.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE" value="true"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER&quot; path=&quot;5&quot; type=&quot;4&quot;/&gt;&#10;"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="de.haumacher.phoneblock.answerbot.AnswerBot"/>
<listAttribute key="org.eclipse.jdt.launching.MODULEPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/&quot; path=&quot;4&quot; type=&quot;4&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry path=&quot;4&quot; projectName=&quot;phoneblock-ab&quot; type=&quot;1&quot;/&gt;&#10;"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="de.haumacher.phoneblock.ab"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-f ./configs/phoneblock-answerbot"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="phoneblock-ab"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>
15 changes: 15 additions & 0 deletions phoneblock-ab/bin/phoneblock.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=phoneblock
After=network.target

[Service]
ExecStart=/usr/bin/java -jar phoneblock-ab-1.4.6-SNAPSHOT-jar-with-dependencies.jar
WorkingDirectory=/home/phoneblock
StandardOutput=inherit
StandardError=inherit
Restart=always
RestartSec=10s
User=phoneblock

[Install]
WantedBy=multi-user.target
2 changes: 2 additions & 0 deletions phoneblock-ab/configs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/phoneblock-answerbot
/test*
58 changes: 58 additions & 0 deletions phoneblock-ab/configs/phoneblock-answerbot.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#
# Answerbot configuration for registering to a Fritz!Box in a local network.
#

###################################################################################################
# This file is a configuration template. Copy the contents to a file named "phoneblock-answerbot"
# and fill out the missing options below. Afterwards, you can start the launch configuration
# AnswerBot (Fritz!Box).launch in the /bin folder.
###################################################################################################

registrar=fritz.box
realm=fritz.box
#route=fritz.box
#force-rport=yes

# The user name for registering the IP phone device configured in your Fritz!Box
user=phoneblock

# The password for registering the IP phone device configured in your Fritz!Box
passwd=<fill-out-here>

# The local ports used by the answerbot
host-port=55060
media-port=50061
port-count=20

# Enable SIP message debugging.
log-all-packets=no

# Directory where to store recordings to, 'none' to disable recording.
recodings = .

# The directory where the WAV files for the bot conversation are located.
conversation=./conversation

# The format of the conversation media stord in the directories in ./conversation/*
media=audio 4080 RTP/AVP { 8 PCMA 8000 160 ; 120 PCMA 16000 320 }

# Number of milliseconds silence must be detected before responding.
min-silence-time = 800

# When recording, the number of milliseconds of silence to record before and after the conterpart's speach.")
padding-time = 500

# The maximum value in decibel relative to full scale (dbfs) for an audio segment to be classified as silence.")
silence-db = -35

# The minimum number of PhoneBlock votes for a number to be consideres SPAM.
min-votes = 4

# Whether to let PhoneBlock accept anonymous calls. It is not recommended to enable this option. Better configure a
# separate answering machine in you router to gracefully handle anonymous calls.
accept-anonymous=no

# Prefix of a number that triggers PhoneBlock to respond to the call (for testing). A local number typically starts
# with a '*' character. Using this prefix allows to call PhoneBlock locally to verify it is working.
test-prefix=*

75 changes: 75 additions & 0 deletions phoneblock-ab/conversation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Verzeichnis mit Audiodateien, aus denen PhoneBlock einen Dialog mit dem Anrufer zusammensetzt

Ein PhoneBlock-Dialog besteht aus folgenden Komponenten:
* Eine Begrüßung ("hello")
* Warten auf eine Meldung des Gegenüber ("waiting")
* Eine Rückfrage ("question")
* Warten auf eine Antwort ("waiting")
* Weiter bei "Rückfrage".
* Eine Nachfrage, wenn sich das Gegenüber auf die Begrüßung nicht meldet ("who-is-calling")
* Eine Nachfrage, wenn das Gegenüber auf eine Rückfrage nicht antwortet ("still-there")

Für jeden Dialog-Teil gibt es ein Unterverzeichnis, in den eine Audiodatei (WAV) abgelegt werden muss, in der (am
besten) viele mögliche Sätze gesprochen werden, die zur jeweiligen Situation des Dialoges passen. Zwischen jedem Satz
muss sich ausreichend Stille (1s) befinden, damit PhoneBlock die Sätze voneinander trennen kann. Die folgenden
Abschnitte machen Vorschläge, was man in den jeweiligen Audio-Dateien aufsprechen könnte.

Wenn die Audiodateien vorliegen, muss das Dialogverzeichnis mit dem Tool `ConversionInitializer` initialisiert werden.
Diese Tool splittet die Audiodateien in die einzelnen Sätze und bereite verschiedene Formatversionen vor, die für die
Kommunikation benötigt werden (je nachdem was für ein Audioformat mit der Gegenstelle ausgehandelt wird).


## Ansagen, mit denen das Gespräch begonnen wird ("hello")
* Guten Tag, wie kann ich Ihnen behilflich sein?
* Guten Tag, was kann ich für Sie tun?
* Hallo, wie kann ich Ihnen weiterhelfen?
* Einen schönen guten Tag, mit wem spreche ich?
* Einen schönen guten Tag, wer ist da bitte?
* Einen schönen guten Tag, was wünschen Sie?

## Nach der Ansage meldet sich das Call-Center nicht sofort, PhoneBlock fragt nach, wer anruft ("who-is-calling")

* Hallo, wer ist da bitte?
* Hallo, wer ist in der Leitung?
* Hallo, ist da jemand?
* Hallo, bitte melden Sie sich!
* Ich höre nichts, wer sind Sie?
* Ist da jemand? Ich höre nichts!

## Das Gegenüber sagt nichts, PhoneBlock stellt eine Nachfrage ("still-there")

* Entschuldigen Sie, aber ich höre nichts. Können Sie mich hören?
* Gibt es ein Problem mit der Verbindung? Haben Sie etwas gesagt?
* Ist die Verbindung unterbrochen? Hören Sie mich?
* Ich habe Sie nicht verstanden, können Sie das nocheinmal wiederholen?
* Es scheint, als ob es Kommunikationsprobleme gibt. Könnten Sie noch einmal anrufen?
* Tut mir leid, aber ich kann nichts hören. Können Sie bitte wiederholen, was Sie gesagt haben?
* Gibt ein technisches Problem mit der Verbindung? Ich höre Sie nicht!
* Es sieht so aus, als hätten wir ein Verbindungsproblem. Haben Sie etwas gesagt?

## Das Gegenüber hat etwas gesagt, PhoneBlock stellt eine idiotische Rückfrage ("question")

* Können Sie das bitte genauer erklären?
* Können Sie mir mehr Informationen dazu geben?
* Lassen Sie mich darüber nachdenken - muss das jetzt sofort entschieden werden?
* Können Sie Beispiele dafür nennen?
* Ich verstehe noch nicht ganz, können Sie das nocheinmal erklären?
* Ich bin mir nicht sicher, können Sie weitere Einzelheiten mitteilen?
* Gibt es noch etwas, was Sie hinzufügen möchten?
* Können Sie bitte mehr Details dazu geben?
* Könnten Sie das bitte genauer erklären?
* Gibt es weitere Informationen, die relevant sein könnten?
* Könnten Sie mir mehr Hintergrundinformationen geben?
* Ist das unbedingt notwendig? Welche anderen Optionen können in Betracht gezogen werden?
* Das kann ich mir nicht vorstellen, könnten Sie das bitte ausführlicher erläutern?
* Das klingt sehr allgemein. Welche genauen Daten haben Sie hier?
* Gibt es zusätzliche Fakten, die berücksichtigt werden sollten?
* Können Sie das genauer in einzelnen Schritten erklären?

## Während PhoneBlock auf eine Antwort wartet, wird Rauschen abgespielt, um eine Verbindung vorzutäuschen ("waiting")

* Eine Audio-Datei, in der einfach für 3 bis 5 Sekunden Stille (am besten mit ganz leichtem Grundrauschen) aufgenommen
wird.



3 changes: 3 additions & 0 deletions phoneblock-ab/conversation/hello/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*.wav
/PCMA-WB/
/PCMA/
4 changes: 4 additions & 0 deletions phoneblock-ab/conversation/hello/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Directory for greetings streamed by the answer bot

When a call arrives, the answer bot selects one of the `*.wav` files placed to this directory and streams it to the
counterpart.
3 changes: 3 additions & 0 deletions phoneblock-ab/conversation/question/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*.wav
/PCMA-WB/
/PCMA/
4 changes: 4 additions & 0 deletions phoneblock-ab/conversation/question/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Directory for silly questions streamed by the answer bot

Whenever the counterpart says something, answer bot selects one of the `*.wav` files placed to this directory and
streams it to the counterpart as response.
3 changes: 3 additions & 0 deletions phoneblock-ab/conversation/still-there/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*.wav
/PCMA-WB/
/PCMA/
4 changes: 4 additions & 0 deletions phoneblock-ab/conversation/still-there/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Directory for inquiries streamed by the answer bot

Whenever the counterpart does not respond to a silly question, the answer bot selects one of the `*.wav` files placed
to this directory and streams it to the counterpart as response.
1 change: 1 addition & 0 deletions phoneblock-ab/conversation/waiting/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*.wav
5 changes: 5 additions & 0 deletions phoneblock-ab/conversation/waiting/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Directory for silent noise sounds

Whenever the answer bot waits for a response from the counterpart, it selects one of the `*.wav` files placed
to this directory and streams it to the counterpart to pretend that there is still somebody at the other end of the
line.
3 changes: 3 additions & 0 deletions phoneblock-ab/conversation/who-is-calling/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*.wav
/PCMA-WB/
/PCMA/
4 changes: 4 additions & 0 deletions phoneblock-ab/conversation/who-is-calling/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Directory for asking who is calling

If the counterpart does not say anything in response to the hello message, the answer bot randomly selects one of the
files placed to this directory and streams it to the counterpart.
Loading