Skip to content

Commit

Permalink
Add note to README about Dell RD02-D400 modems.
Browse files Browse the repository at this point in the history
Add OPTIONAL_MODEM_INIT string sent after ATZ reset to configuration options.
Bump version to 1.6.3
  • Loading branch information
thess committed Dec 16, 2023
1 parent f13864a commit 02010cb
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 5 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,21 @@ The __callattendant__ uses the following hardware:
- A 56K V.92 Data + Fax modem compatible with the **U.S. Robotics USR5637** or any device using a **Conexant CX930xx** modem have been proven effective.
- [Optional] A GPIO based indicator board or an MQTT server.

**Note:** Dell Conexant modems such as RD02-D400 are not compatible with the __callattendant__ without a firmware patch.
A patch may be applied by adding a modem init string in the config file OPTIONAL_MODEM_INIT.
Multiple commands may be specified by separating them with a semicolon. For example: `AT!4886=00;AT!4892=FF`

ref: https://en.wikipedia.org/wiki/Network_Caller_ID (Note G)
```
CallerID can be reenabled in any CX93001-based modem by one of the following:
AT!4886=00 for Bell FSK countries
AT!4886=01 for V23 FSK (Japan)
AT!4886=02 for ETSI FSK (France, Italy, Spain)
AT!4886=03 for SIN227 (UK)
AT!4886=05 for ETSI DTMF
Sometimes additionally AT!4892=FF may be required.`
```

---

## Software setup
Expand Down
6 changes: 6 additions & 0 deletions callattendant/app.cfg.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ DEBUG = False
# TESTING: If True function tests are executed in lieu of normal operation
TESTING = False

# 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
Expand Down
4 changes: 3 additions & 1 deletion callattendant/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# and screened callers through to the home phone.
#
default_config = {
"VERSION": '1.6.2',
"VERSION": '1.6.3',

"ENV": 'production',
"DEBUG": False,
Expand All @@ -28,6 +28,8 @@
"HOST": "0.0.0.0",
"PORT": 5000,

"OPTIONAL_MODEM_INIT": "",

"DATABASE": "callattendant.db",
"NOTIFICATIONS_FOLDER": "notifications",
"SCREENING_MODE": ("whitelist", "blacklist"),
Expand Down
14 changes: 11 additions & 3 deletions callattendant/hardware/modem.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
RESET_PROFILE = "ATZ0"
GET_MODEM_PRODUCT_CODE = "ATI0"
GET_MODEM_SETTINGS = "AT&V"
GET_MODEM_FIRMWARE_ID = "ATI3"
GET_MODEM_PATCH_LEVEL_CONEXANT = "AT-PV"
DISABLE_ECHO_COMMANDS = "ATE0"
ENABLE_ECHO_COMMANDS = "ATE1"
ENABLE_FORMATTED_CID = "AT+VCID=1"
Expand Down Expand Up @@ -585,7 +587,7 @@ def record_audio(self, audio_file_name, detect_silence=True):
success = False
finally:
# Clear input buffer before sending commands else its
# contents may interpreted as the cmd's return code
# contents may be interpreted as the cmd's return code
self._serial.reset_input_buffer()

# Send End of Recieve Data state by passing "<DLE>!"
Expand Down Expand Up @@ -859,19 +861,23 @@ def _detect_modem(self):
(success, result) = self._send_and_read(GET_MODEM_PRODUCT_CODE)

if success:
# Query firmware ID
self._send_and_read(GET_MODEM_FIRMWARE_ID)
if USR_5637_PRODUCT_CODE in result:
print("******* US Robotics Model 5637 detected **********")
print("*** US Robotics modem detected ***")
self.model = "USR"

elif CONEXANT_PROODUCT_CODE in result:
print("******* Conextant-based modem detected **********")
self.model = "CONEXANT"
# Define the settings for the Zoom3905 where they differ from the USR5637
SET_VOICE_COMPRESSION = SET_VOICE_COMPRESSION_CONEXANT
DISABLE_SILENCE_DETECTION = DISABLE_SILENCE_DETECTION_CONEXANT
ENABLE_SILENCE_DETECTION_5_SECS = ENABLE_SILENCE_DETECTION_5_SECS_CONEXANT
ENABLE_SILENCE_DETECTION_10_SECS = ENABLE_SILENCE_DETECTION_10_SECS_CONEXANT
ENABLE_FORMATTED_CID = ENABLE_FORMATTED_CID_CONEXANT
# Query firmware patch level
self._send_and_read(GET_MODEM_PATCH_LEVEL_CONEXANT)
print("*** Conextant modem detected ***")
else:
print("******* Unknown modem detected **********")
# We'll try to use the modem with the predefined USR AT commands if it supports VOICE mode.
Expand All @@ -896,6 +902,8 @@ def _init_modem(self):
try:
if not self._send(RESET):
print("Error: Unable reset to factory default")
if self.config["OPTIONAL_MODEM_INIT"]:
self._send(self.config["OPTIONAL_MODEM_INIT"])
if not self._send(ENABLE_VERBOSE_CODES):
print("Error: Unable set response in verbose form")
if not self._send(DISABLE_ECHO_COMMANDS):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

setuptools.setup(
name="callattendant", # Add user name when uploading to TestPyPI
version="1.6.2", # Ensure this is in-sync with VERSION in config.py
version="1.6.3", # Ensure this is in-sync with VERSION in config.py
author="Ted Hess",
author_email="[email protected]",
description="An automated call attendant and call blocker using a USR5637 or CX930xx modem",
Expand Down

1 comment on commit 02010cb

@roycewilliams
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great sleuthing and great work!

Please sign in to comment.