Skip to content

Commit 01afe61

Browse files
committed
Replace invalid CNAM or number with 'Private/Unknown' or '0000000000' values.
Bump version to 2.1.2
1 parent d96f290 commit 01afe61

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

callattendant/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# and screened callers through to the home phone.
2121
#
2222
default_config = {
23-
"VERSION": '2.1.1',
23+
"VERSION": '2.1.2',
2424

2525
"DEBUG": False,
2626
"TESTING": False,

callattendant/hardware/modem.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,15 @@ def cid_validate(val, key, regex):
334334
val = modem_data.split('=')[1].strip()
335335
if cid_validate(val, NAME, r'^[A-Za-z][A-Za-z0-9 .,]{1,14}$'):
336336
call_record[NAME] = val
337+
else:
338+
call_record[NAME] = "Private/Unknown"
337339

338340
elif NMBR in modem_data:
339341
val = modem_data.split('=')[1].strip()
340342
if cid_validate(val, NMBR, r'^\d{4,17}$'):
341343
call_record[NMBR] = val
344+
else:
345+
call_record[NMBR] = "0000000000"
342346
else:
343347
# Caller ID validation is disabled
344348
if DATE in modem_data:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
setuptools.setup(
1616
name="callattendant", # Product name on PyPi (Callattendant2)
17-
version="2.1.1", # Ensure this is in-sync with VERSION in config.py
17+
version="2.1.2", # Ensure this is in-sync with VERSION in config.py
1818
author="Ted Hess",
1919
author_email="thess@kitschensync.net",
2020
description="An automated call attendant and call blocker using a USR5637 or CX930xx modem",

0 commit comments

Comments
 (0)