thess / callattendant

A python-based automated call attendant, call blocker, and voice messaging system running on a Raspberry Pi or equivalent. Screens callers and block robocalls and scams with a low-cost system and modem.
https://thess.github.io/callattendant/
MIT License
14 stars 6 forks source link

crashed.. garbled info in caller log #64

Open comet424 opened 3 months ago

comet424 commented 3 months ago

i didnt bother posting entire caller log.. just the last bit... it looks like the caller information got garbled.. static maybe? but callattendant couldnt handle it and exited.. maybe needs like a protection that if it gets garble it cant exit.. maybe be able to log it seperatly when its garbled.. i dunno

but here is the log

callattendant error log.txt

thess commented 3 months ago

What version are you running? I looks like you still have some local mods which are interfering with normal operational timing. Also, what (if anything) occurred in the the 6 minutes between the 2 log entries below - was it edited? There seems to be some missing logged data I would be expecting.

Jul 16 11:01:03 callerid callattendant[1193]: 192.168.0.12 - - [16/Jul/2024 11:01:03] "GET / HTTP/1.1" 200 - Jul 16 11:07:19 callerid callattendant[1193]: [10B blob data]

comet424 commented 3 months ago

how do i check the version ?? and i dont think i running my mods unless its the 1 line i might have put back in for something ill have to check but it should be just the orginal

and no there is no log enteries altered... what you see is what you get... there is blob data call attendant is reporting and then scrambles the phone number then crashs i guess due do the length of the phone number.. i was going to copy entire log but didnt think u wanted 2 weeks of phone calls so i just copied the last couple calls from the bottom..

how do i run version check? and update to latest version

comet424 commented 3 months ago

i checked the code.. ya i had my code left in that just runs a command line but it wouldnt interfer with anything as it exports outside of the callattendant and doesnt run inside it just runs a dos command

but i took it out wont run again i forgot to remove it i was testing sometime a while ago..

i guess version is 2.0.4

in site packages it says callattendant-2.0.4.dist-info

thess commented 3 months ago

If you are running 1.7.3 or later, the version info is available by clicking on the the exclamation (!) on the main menu. If you are using MQTT, the only supported method is now part of v2 and later - v2.0.7 is latest.

I believe I had mentioned the fact that the way you were invoking mosquitto_sub by exec only stalls the main thread waiting for execution to finish so it is unable to properly timeout RING notifications and differentiate them from a hang-up.

I looks like the modem went off-hook and was receiving unsolicited audio data when it should have been waiting for another call. I don't know how that could of happened from the log data without enabling DEBUG.

comet424 commented 3 months ago

i must have missed that comment.. but i removed it ... so i looked in the config.. im runnin 2.0.4
and how do i update to 2.07 whats the easiest.. like apk update callattendant and debug is still enabled

so the logs i sent ya were with debug enabled

here is the config file

<Config {'VERSION': '2.0.4', 'DEBUG': True, 'TESTING': False, 'HOST': '0.0.0.0', 'PORT': 5000, 'MODEM_DEVICE': '', 'OPTIONAL_MODEM_INIT': '', 'DATABASE': 'callattendant.db', 'NOTIFICATIONS_FOLDER': '/home/pi/.callattendant/notifications', 'SCREENING_MODE': ('whitelist', 'blacklist'), 'PHONE_DISPLAY_SEPARATOR': '-', 'PHONE_DISPLAY_FORMAT': '###-###-####', 'BLOCK_ENABLED': True, 'BLOCK_SERVICE': '', 'BLOCK_SERVICE_THRESHOLD': 2, 'CALLERID_PATTERNS_FILE': '/home/pi/.callattendant/cid_patterns.yaml', 'PERMIT_NEXT_CALL_FLAG': '/home/pi/.callattendant/permitnextcall.flag', 'BLOCKED_ACTIONS': ('answer',), 'BLOCKED_GREETING_FILE': '/home/pi/.callattendant/notifications/blocked_greeting.wav', 'BLOCKED_RINGS_BEFORE_ANSWER': 0, 'SCREENED_ACTIONS': ('answer', 'greeting', 'voice_mail'), 'SCREENED_GREETING_FILE': '/home/pi/.callattendant/notifications/screener_greeting.wav', 'SCREENED_RINGS_BEFORE_ANSWER': 20, 'PERMITTED_ACTIONS': ('answer', 'greeting', 'record_message'), 'PERMITTED_GREETING_FILE': '/home/pi/.callattendant/notifications/general_greeting.wav', 'PERMITTED_RINGS_BEFORE_ANSWER': 20, 'VOICE_MAIL_GOODBYE_FILE': '/home/pi/.callattendant/notifications/goodbye.wav', 'VOICE_MAIL_INVALID_RESPONSE_FILE': '/home/pi/.callattendant/notifications/invalid_response.wav', 'VOICE_MAIL_LEAVE_MESSAGE_FILE': '/home/pi/.callattendant/notifications/please_leave_message.wav', 'VOICE_MAIL_CALLBACK_FILE': '/home/pi/.callattendant/notifications/thankyou_callback.wav', 'VOICE_MAIL_MESSAGE_FOLDER': '/home/pi/.callattendant/messages', 'VOICE_MAIL_RECORD_TIME': 120, 'EMAIL_SERVER': 'SMTP server', 'EMAIL_PORT': 465, 'EMAIL_SERVER_USERNAME': 'user name to log into the SMTP server', 'EMAIL_SERVER_PASSWORD': '********', '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', 'EMAIL_WAVE_ATTACHMENT': False, 'STATUS_INDICATORS': 'MQTT', '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': (8, 7, 27, 23, 10, 11, 9, 18), 'GPIO_LED_MESSAGE_COUNT_KWARGS': {'active_high': True}, 'MQTT_BROKER': '192.168.0.12', 'MQTT_PORT': 1883, 'MQTT_TOPIC_PREFIX': 'callattendant', 'MQTT_USERNAME': 'mqtt-user', 'MQTT_PASSWORD': '********', 'MQTT_TIME_FORMAT': 'UNIX', 'MQTT_CALLERID_FORMAT': 'DISPLAY', 'MQTT_INDICATOR_TYPE': 'STATE', 'ROOT_PATH': '/home/pi/venv/lib/python3.11/site-packages/callattendant', 'DATA_PATH': '/home/pi/.callattendant', 'EMAIL_ENABLE': False, 'CONFIG_FILE': 'app.cfg', 'DB_FILE': '/home/pi/.callattendant/callattendant.db', 'MODEM_ONLINE': True, 'CALLERID_PATTERNS': {'blocknames': {}, 'blocknumbers': {}, 'permitnames': {}, 'permitnumbers': {}}, 'MESSAGE_EVENT': <threading.Event at 0x7fab2041d0: unset>}>
Config File: /home/pi/.callattendant/app.cfg
#!/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 = True

# 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 = ""
# 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 = might be spam (caller is "Political", "Charity", or "Debt Collector"),
#   2 = Spam - marked as "Do Not Answer",
# 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 = 20

# 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 = 20

# 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 = '********'
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 = "MQTT"

# MQTT settings if STATUS_INDICATORS is set to MQTT
# Host name is required
MQTT_BROKER = "192.168.0.12"
MQTT_TOPIC_PREFIX = "callattendant"
# Port is optional, default is 1883
MQTT_PORT = 1883
# Username is optional, default is None
MQTT_USERNAME = "mqtt-user"
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 = "DISPLAY"

# 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}
comet424 commented 3 months ago

i guessing maybe you cant update... maybe you need to uninstall and reinstall to get the latest version? re run all the install steps?

thess commented 3 months ago

Updates work -- Just install the new version the same way you installed the current version. See: https://github.com/thess/callattendant/issues/36#issuecomment-2041518496

If not one of these methods, use whatever works for you.

comet424 commented 3 months ago

ok thanks updated to 2.0.7 wasnt sure how to update always learning something new everyday... and least i didnt have to move database or anything like that...

i get alot of V194123123 numbers now too which is really annoying number starts with a V

hopefully this blob error doesnt come back