AT0myks / pycallblock

Block spam calls with a USB modem.
GNU General Public License v3.0
8 stars 0 forks source link

TFM-561U doesn't support fax class 2 #3

Open AT0myks opened 1 year ago

AT0myks commented 1 year ago
          Here is the log made before in fax mode.
2023-11-10 14:34:26,409 DEBUG: Background task event_loop is done
2023-11-10 14:34:26,427 DEBUG: CommandResponse('ATZ', None, <ResultCode.OK: 'OK'>, b'ATZ\r\r\nOK\r\n')
2023-11-10 14:34:26,431 DEBUG: CommandResponse('AT+FCLASS?', '0', <ResultCode.OK: 'OK'>, b'AT+FCLASS?\r\r\n0\r\nOK\r\n')
2023-11-10 14:34:26,453 INFO: pycallblock stopped
2023-11-10 14:35:09,012 INFO: pycallblock 1.0.2 is starting
2023-11-10 14:35:09,012 INFO: Audio file: None
2023-11-10 14:35:09,012 INFO: Block action: BlockAction.FAX_MACHINE
2023-11-10 14:35:09,012 INFO: Block private numbers: False
2023-11-10 14:35:09,012 INFO: Filter list: /home/nf/pycallblock/block.csv
2023-11-10 14:35:09,012 INFO: Filter type: FilterType.BLACKLIST
2023-11-10 14:35:09,012 INFO: Max voice duration: None
2023-11-10 14:35:09,012 INFO: Silence seconds: None
2023-11-10 14:35:09,012 INFO: Timezone: None
2023-11-10 14:35:09,240 DEBUG: CommandResponse('ATZ', None, <ResultCode.OK: 'OK'>, b'ATZ\r\r\nOK\r\n')
2023-11-10 14:35:09,243 DEBUG: CommandResponse('AT+FCLASS?', '0', <ResultCode.OK: 'OK'>, b'AT+FCLASS?\r\r\n0\r\nOK\r\n')
2023-11-10 14:35:09,244 DEBUG: Device: '/dev/ttyACM0'
2023-11-10 14:35:09,246 DEBUG: CommandResponse('ATI3', 'CX93001-EIS_V0.2002-V92', <ResultCode.OK: 'OK'>, b'ATI3\r\r\nCX93001-EIS_V0.2002-V92\r\n\r\nOK\r\n')
2023-11-10 14:35:09,246 DEBUG: await self.get_masked_firmware_id_code()='CX93001-EIS_V0.2002-V92'
2023-11-10 14:35:09,248 DEBUG: CommandResponse('AT+GMI', 'CONEXANT', <ResultCode.OK: 'OK'>, b'AT+GMI\r\r\n+GMI: CONEXANT\r\n\r\nOK\r\n')
2023-11-10 14:35:09,249 DEBUG: await self.get_product_manufacturer()='CONEXANT'
2023-11-10 14:35:09,253 DEBUG: CommandResponse('AT+VCID=1', None, <ResultCode.OK: 'OK'>, b'AT+VCID=1\r\r\nOK\r\n')
2023-11-10 14:35:09,256 DEBUG: CommandResponse('AT+FCLASS=2', None, <ResultCode.ERROR: 'ERROR'>, b'AT+FCLASS=2\r\r\nERROR\r\n')
2023-11-10 14:35:09,256 ERROR: Could not set mode to Mode.FAX_CLASS_2
2023-11-10 14:35:09,256 INFO: Waiting event...
2023-11-10 14:51:29,940 DEBUG: Event({'DATE': '1110', 'TIME': '1451', 'NMBR': '987654321', 'NAME': 'P'}, b'\r\nDATE = 1110\r\nTIME = 1451\r\nNMBR = 987654321\r\nNAME = P\r\n', 1699624289940637446)
2023-11-10 14:51:29,940 INFO: Receiving call: 987654321/P
2023-11-10 14:51:29,941 INFO: Blocking call from 987654321/P
2023-11-10 14:51:29,941 INFO: Picking up
2023-11-10 14:51:30,385 DEBUG: CommandResponse('ATH1', None, <ResultCode.OK: 'OK'>, b'ATH1\r\r\nOK\r\n')
2023-11-10 14:51:30,387 INFO: Hanging up
2023-11-10 14:51:30,918 DEBUG: CommandResponse('ATH0', None, <ResultCode.OK: 'OK'>, b'ATH0\r\r\nOK\r\n')
2023-11-10 14:51:30,923 DEBUG: CommandResponse('ATZ', None, <ResultCode.OK: 'OK'>, b'ATZ\r\r\nOK\r\n')
2023-11-10 14:51:30,926 DEBUG: CommandResponse('AT+FCLASS?', '0', <ResultCode.OK: 'OK'>, b'AT+FCLASS?\r\r\n0\r\nOK\r\n')
2023-11-10 14:51:30,929 DEBUG: CommandResponse('AT+VCID=1', None, <ResultCode.OK: 'OK'>, b'AT+VCID=1\r\r\nOK\r\n')
2023-11-10 14:51:30,932 DEBUG: CommandResponse('AT+FCLASS=2', None, <ResultCode.ERROR: 'ERROR'>, b'AT+FCLASS=2\r\r\nERROR\r\n')
2023-11-10 14:51:30,932 ERROR: Could not set mode to Mode.FAX_CLASS_2
2023-11-10 14:51:30,932 INFO: 987654321/P blocked because: Contact is on blacklist
2023-11-10 14:51:30,948 INFO: Call logged
2023-11-10 14:51:30,948 INFO: Waiting event...
2023-11-10 14:51:31,881 DEBUG: Event('RING', b'\r\nRING\r\n', 1699624291881088733)
2023-11-10 14:51:31,881 INFO: Ringing...
2023-11-10 14:51:31,881 INFO: Waiting event...
2023-11-10 14:51:36,441 DEBUG: Event('RING', b'\r\nRING\r\n', 1699624296441974691)
2023-11-10 14:51:36,442 INFO: Ringing...
2023-11-10 14:51:36,442 INFO: Waiting event...
2023-11-10 14:51:41,021 DEBUG: Event('RING', b'\r\nRING\r\n', 1699624301021814209)
2023-11-10 14:51:41,021 INFO: Ringing...
2023-11-10 14:51:41,022 INFO: Waiting event...
2023-11-10 14:51:45,022 DEBUG: Event('RING', b'\r\nRING\r\n', 1699624305022125835)
2023-11-10 14:51:45,022 INFO: Ringing...
2023-11-10 14:51:45,022 INFO: Waiting event...
2023-11-10 14:53:26,668 INFO: Received SIGINT
2023-11-10 14:53:26,668 INFO: Stopping...

Originally posted by @paloke in https://github.com/AT0myks/pycallblock/issues/1#issuecomment-1806206599

AT0myks commented 1 year ago

Can you update to v1.1.0 to see if that works with your modem? It should fall back to class 1 since it doesn't support class 2.

paloke commented 1 year ago

The -f parameter works correctly, it picks up and answers like a FAX. But, in normal mode, it doesn't pick up and hangs up. I think the time between picking up and hanging up is too fast. I have done the sequence manually, in a terminal, and the HAYES commands are correct.

ATZ
OK

ATH0
OK

AT+VCID=1
OK

AT+FCLASS=0
OK

DATE = 1112
TIME = 2144
NMBR = 987654321
NAME = P

RING
ATH1
OK

ATH0
OK
AT0myks commented 1 year ago

And was the call picked up correctly? Looks like yes but I just want to confirm.

paloke commented 1 year ago

Yes, the call was answered correctly.

AT0myks commented 1 year ago

I added a 1 second delay before the hang up. Please install from source (pip install git+https://github.com/AT0myks/pycallblock.git) to see if that fixes the issue.

paloke commented 12 months ago

Sorry, I haven't been able to test it, the VM where I have the modem installed doesn't have git.