-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.cfg
282 lines (236 loc) · 11.3 KB
/
app.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
#!/usr/bin/env python
#
# file: app.cfg
#
# ==============================================================================
# This file contains configuration settings for the callattendant.
#
# The values are in python syntax. You can/should use an editor like
# "nano" which will provide you with syntax highlighting to ensure your
# values are syntactically valid.
# ==============================================================================
# DEBUG: If True additional assertions and output may be generated
DEBUG = False
# TESTING: If True function tests are executed in lieu of normal operation
TESTING = False
# Optional modem serial port (comma separated list permitted)
# If not specified, the modem will be auto-detected
# Example: "/dev/ttyUSB0, /dev/ttyACM0"
MODEM_DEVICE = ""
# Optional modem initialization string: (AT commands) to be sent to the modem
# Additional modem options can be set when necessary.
# See README.md notes regarding caller-id enable for Dell RD02-D400 modems.
OPTIONAL_MODEM_INIT = ""
# Web UI options: HOST can be set to a specific IP address or "::" to include IPv6
HOST = "0.0.0.0"
PORT = 5000
# DATABASE: Sqlite database for incoming call log, whitelist and blacklist
# This should not be changed/overrriden except during development/testing
#DATABASE = "callattendant.db"
# PHONE_DISPLAY_SEPARATOR: Specify the character used to format phone numbers, e.g, a space, hyphen or period,
PHONE_DISPLAY_SEPARATOR = "-"
# PHONE_DISPLAY_FORMAT: Define the formatting of phone numbers in the various lists. You must use the
# separator character defined by PHONE_DISPLAY_SEPARATOR above in the format string.
#
# The phone display format handles variable length phone numbers. Excess digits not included
# in the format string are prepended to the number with a separator.
# For example, the AUS number 006173XXXYYYY would be formatted as follows:
# General format: 006173-XXX-YYYY
# AU format: 00-61-73-XXX-YYYY
# US format: 006-173-XXX-YYYY
# UK format: 00-6173-XXX-YYYY
# FR format: 0061-73X-XX-YY-YY
#
# Example: General
# PHONE_DISPLAY_FORMAT = "###-####"
#
# Example: US
# PHONE_DISPLAY_FORMAT = "###-###-####"
#
# Example: UK
# PHONE_DISPLAY_FORMAT = "####-###-####"
#
# Example: FR
# PHONE_DISPLAY_FORMAT = "###-##-##-##"
#
# Example: AU
# PHONE_DISPLAY_FORMAT = "##-##-###-####"
#
# Example: Raw - no formatting
# PHONE_DISPLAY_FORMAT = ""
#
PHONE_DISPLAY_FORMAT = "###-###-####"
# SCREENING_MODE: A tuple containing: "whitelist" and/or "blacklist", or empty
SCREENING_MODE = ("whitelist", "blacklist")
# BLOCK_ENABLED: if True calls that fail screening will be blocked
BLOCK_ENABLED = True
# NOTIFICATIONS_FOLDER: Locations of recorded wave files used for voice notifications
NOTIFICATIONS_FOLDER = "notifications"
# CALLERID_PATTERNS_FILE: A file containing RegEx expressions for blocked and permitted names and
# phone numbers to be used for screening. The file is in YAML format and had 4 sections, one for
# each category:
# - "blockednames" - a list of names to be blocked
# - "permittednames" - a list of names to be permitted
# - "blockednumbers" - a list of phone numbers to be blocked
# - "permittednumbers" - a list phone numbers to be permitted
#
# Each item is a RegEx expression and a description.
# Example: V[0-9]{15}: Telemarketer Caller ID
# O: Unknown caller
CALLERID_PATTERNS_FILE = 'cid_patterns.yaml'
# PERMIT_NEXT_CALL_FLAG: Temporary file, created and destroyed by the app,
# to indicate whether the next incoming call should be permitted.
PERMIT_NEXT_CALL_FLAG = 'permitnextcall.flag'
# BLOCK_SERVICE: The name of the online service used to lookup robocallers and spam numbers.
# NOMOROBO and SHOULDIANSWER are supported. NOMOROBO is for the USA only. Areas outside the
# US can use SHOULDIANSWER. Otherwise, set to blank. When the online service is
# blank (service query disabled), only the blacklist and blocked name/number patterns are
# used to block numbers.
#
# Example: "NOMOROBO", SHOULDIANSWER, or "" (disabled).
BLOCK_SERVICE = "NOMOROBO"
# BLOCK_SERVICE_THRESHOLD: The severity level returned by the online service which
# is considered spam or nuisance calls. Only values 1 or 2 are accepted.
# NOMOROBO:
# 1 = Caller is identified by NOMOROBO as a Robocall.
# 2 = Spam - marked as a scam, or a robocaller with "Severe" Call Activity
# SHOULDIANSWER:
# 1 = (not used - further analysis of the score in "reviews' section warranted)
# 2 = Spam - marked as "Negative"
# Example: if 2, then items with a score of 2 are considered spam.
# if 1, then items with a score of 1 or 2 are considered spam.
BLOCK_SERVICE_THRESHOLD = 2
# BLOCKED_ACTIONS: A tuple containing following actions:
# "ignore" -OR- a combination of the following:
# "answer", "greeting", "record_message", "voice_mail".
#
# Note: "ignore" and "answer" are mutually exclusive; one or the other is required.
# Note: "record_message" and "voice_mail" actions are mutually exclusive.
# Note: A trailing comma is REQUIRED for a tuple with just one item.
#
# Example: Take no action, just let the phone ring
# BLOCKED_ACTIONS = ("ignore",)
# NOTE: A tuple with one item requires a trailing comma; just like the example above
#
# Example: Just answer and hang_up
# BLOCKED_ACTIONS = ("answer",)
# NOTE: A tuple with one item requires a trailing comma; just like the example above
#
# Example: Answer and play an announcement before hanging up
# BLOCKED_ACTIONS = ("answer", "greeting")
#
# Example: Answer and record a message before hanging up;
# no keypress required
# BLOCKED_ACTIONS = ("answer", "record_message")
#
# Example: Answer and go into the voice mail menu;
# a keypress is required to a leave message
# BLOCKED_ACTIONS = ("answer", "voice_mail")
#
# Example: Answer, play announcment and record a message;
# no keypress required
# BLOCKED_ACTIONS = ("answer", "greeting", "record_message")
#
# Example: Answer, play announcment and go into the voice mail menu;
# a keypress is required to leave message
# BLOCKED_ACTIONS = ("answer", "greeting", "voice_mail")
#
BLOCKED_ACTIONS = ("answer", "greeting")
# BLOCKED_GREETING_FILE: The wav file to be played to blocked callers.
# Example: "Your number has been blocked."
BLOCKED_GREETING_FILE = "blocked_greeting.wav"
# BLOCKED_RINGS_BEFORE_ANSWER: The number of rings to wait before answering
# Example: 0 to act immediately, possibly before your local phone rings.
BLOCKED_RINGS_BEFORE_ANSWER = 0
# SCREENED_ACTIONS: A tuple containing a combination of the following actions:
# "ignore" OR a combo of "answer", "greeting", "record_message", "voice_mail".
# See BLOCKED_ACTIONS for more info.
SCREENED_ACTIONS = ("answer", "greeting", "voice_mail")
# SCREENED_GREETING_FILE: The wav file to be played to allowed callers.
# Example: "I'm sorry, I can't take your call."
SCREENED_GREETING_FILE = "screener_greeting.wav"
# SCREENED_RINGS_BEFORE_ANSWER: The number of rings to wait before answering
# Example: 0 to act immediately, possibly before your local phone rings.
SCREENED_RINGS_BEFORE_ANSWER = 0
# PERMITTED_ACTIONS: A tuple containing a combination of the following actions:
# "ignore" OR a combo of "answer", "greeting", "record_message", "voice_mail".
# See BLOCKED_ACTIONS for more info.
PERMITTED_ACTIONS = ("answer", "greeting", "record_message")
# PERMITTED_GREETING_FILE: The wav file to be played to allowed callers.
# Example: "I'm sorry, I can't take your call."
PERMITTED_GREETING_FILE = "general_greeting.wav"
# PERMITTED_RINGS_BEFORE_ANSWER: The number of rings to wait before answering a call.
# Example: 4 to allow the callee to pick up the phone before going to voice mail.
PERMITTED_RINGS_BEFORE_ANSWER = 4
# VOICE_MAIL_GOODBYE_FILE: The wav file play just before hanging up
# Example: "Goodbye"
VOICE_MAIL_GOODBYE_FILE = "goodbye.wav"
# VOICE_MAIL_INVALID_RESPONSE_FILE: The wav file played on an invalid keypress
# Example: "That was an invalid response.."
VOICE_MAIL_INVALID_RESPONSE_FILE = "invalid_response.wav"
# VOICE_MAIL_LEAVE_MESSAGE_FILE: The wav file played before recording a message
# Example: "Please leave a message"
VOICE_MAIL_LEAVE_MESSAGE_FILE = "please_leave_message.wav"
# VOICE_MAIL_CALLBACK_FILE: The wav file played for whitelist callback
# Example: "You may hang up now and call back"
VOICE_MAIL_CALLBACK_FILE = "thankyou_callback.wav"
# VOICE_MAIL_MESSAGE_FOLDER: The folder where voice mail message are stored
# This should not be changed/overridden except during development/testing
#VOICE_MAIL_MESSAGE_FOLDER = "messages"
# VOICE_MAIL_RECORD_TIME: The maximum length of a recorded message in seconds
# Example: 60 for 1 minute
VOICE_MAIL_RECORD_TIME = 120
# EMAIL settings are used to send an e-mail notification when a message is recorded
# EMAIL_ENABLE is True to enable sending e-mails when message are recorded. If set
# to True, the other EMAIL settings must have valid values.
EMAIL_ENABLE = False
EMAIL_SERVER = "SMTP server"
EMAIL_PORT = 465
EMAIL_SERVER_USERNAME = 'user name to log into the SMTP server'
EMAIL_SERVER_PASSWORD = 'password to log into the SMTP server'
EMAIL_FROM = 'e-mail address to appear in the "From:" header'
EMAIL_TO = 'e-mail address(es) to send the voicemail notification to, one string, comma-separated'
# Set to True to attach VM wave file to message
EMAIL_WAVE_ATTACHMENT = False
# Indicator modules can be one of: GPIO, NULL or MQTT. Multiple indicator type not supported.
# Default is NULL (No special hardware)
# MQTT support requires 'paho.mqtt' installed
# GPIO (on RPi) requires 'gpizero' and supporting system interaces (E.g.: RPi.gpio and/or pigpio)
STATUS_INDICATORS = "NULL"
# MQTT settings if STATUS_INDICATORS is set to MQTT
# Host name is required
MQTT_BROKER = "MQTT server"
MQTT_TOPIC_PREFIX = "callattendant"
# Port is optional, default is 1883
#MQTT_PORT = 1883
# Username is optional, default is None
#MQTT_USERNAME = ""
#MQTT_PASSWORD = ""
# MQTT_NOTIFICATION_TYPE: The type of notification to send. Valid values are: EVENT, STATE
# This setting controls the RETAIN attribute of MQTT messages.
# EVENT: Indicator topics are not retained
# STATE: Indicator topics are retained
MQTT_INDICATOR_TYPE = "STATE"
#MQTT_TIME_FORMAT: The format of the timestamp in the MQTT message. Valid values are: ISO, UNIX
# ISO = "YYYY-MM-DD HH:MM:SS"
# UNIX = Seconds since epoch (Usually: 1970-01-01 00:00:00)
MQTT_TIME_FORMAT = "UNIX"
# MQTT_CALLERID_FORMAT: The format of the callerid in the MQTT message. Valid values are: RAW, DISPLAY
# DISPLAY uses the PHONE_DISPLAY_FORMAT to format the number
# RAW uses the number from the provider
MQTT_CALLERID_FORMAT = "RAW"
# GPIO_LED_..._PIN: These values are the GPIO pin numbers attached to the LED indicators
# GPIO_LED_..._BRIGHTNESS: These values are a percentage of brightness for the LED indicators when on.
GPIO_LED_RING_PIN = 14
GPIO_LED_RING_BRIGHTNESS = 100
GPIO_LED_APPROVED_PIN = 15
GPIO_LED_APPROVED_BRIGHTNESS = 100
GPIO_LED_BLOCKED_PIN = 17
GPIO_LED_BLOCKED_BRIGHTNESS = 100
GPIO_LED_MESSAGE_PIN = 4
GPIO_LED_MESSAGE_BRIGHTNESS = 100
# GPIO_LED_MESSAGE_COUNT_PINS: This is a tuple containing the GPIO pins for the 7-segment LED
# ordered by segment as thus: (a, b, c, d, e, f, g, dp)
GPIO_LED_MESSAGE_COUNT_PINS = (8, 7, 27, 23, 10, 11, 9, 18)
# GPIO_LED_MESSAGE_COUNT_KWARGS: This is a dictionary of optional arguments (used by GPIOZero LEDBoard)
GPIO_LED_MESSAGE_COUNT_KWARGS = {"active_high": True}