USB Modem as a phone caller ID filter...
Posted: Thursday 25 June 2020 14:53
Hello,
I have re-used an old POTS 56K (hardware) analog modem as a caller ID filtering device: Far too many unsolicited calls (publicity, sellers...)!
The idea is to configure the modem (basic config, no auto-answer etc, using modems "AT" command set) connected on my internet modem that also acts as an IP phone gateway (those all-in-one french "internet boxes"), using it's phone line RJ11 (unused, the modem also does DECT, so phones are wirelessly connected) connector.
When the phone rings, before the 2nd ring, provided CID (caller ID) reporting is setup ("AT+VCID=1"), I get lines of data on the serial ttyUSB of the modem:
DATE = 0625
TIME = 1133
NMBR = 06XXXXXXXX
NAME = ...
Good point: The name info is only given for my phone registered numbers, so filtering family and friends is an easy job!
For callers with no NAME info, I call a www.shouldianswer.com page (french version: http://www.doisjerepondre.fr/numero-de-telephone/NMBR) to get a phone number classification score that can be unknown/neutral/negative.
No public API for this service, had to parse the page using python beautfifulsoup module for the interesting part of the response that can be:
[<div class="scoreContainer">\n<div class="score unknown"></div>\n</div>]
[<div class="scoreContainer">\n<div class="score neutral"></div>\n</div>]
[<div class="scoreContainer">\n<div class="score negative"></div>\n</div>]
If negative, modem answers ('ATA' in data mode, 'ATS1' in voice mode) then hangs up after 1s ('ATH'/'ATS0' respectively): Phone only rings once and I'm quiet again!
I can say this mostly works... Had to cope with a few modem bugs (to set the modem in voice mode, to avoid a nice old analog modem sound while trying to sync with remote!!!), by the way, but there is one remaining problem I could not solve for now:
Sometimes, modem shows rings ('RING' string in data mode, '<DLE>R' in voice mode) but no CID info. This may probably happen (private calls?), but problem is my phone did retrieve the information, so the modem really misses some CIDs!
In the infinite loop that receive/process modem data, I had some ring nb checks (to be able to separate call attempts, answered by my phones or not) using 'ATS1?' command: This looks to disturb CID read if the command is sent before all the CID lines are received. So I count rings in the loop and used a timeout mechanism instead. Now, no more possible writes before full CID is read to avoid killing it for current call attempt!
Less misses... But still have some! Maybe 20/30%...
=> The question is: Do someone on the forum have experience with raw modem use tips and tricks?
As this may be modem/hardware dependent, mine is branded as Longshine LCS-8151C1 and its Conexant based with this FW version (can be read using 'ATI3' command):
"CX93001-EIS_V0.2013-V92"
As said here-upper, this modem looks a bit buggy: For instance, it supports voice mode but it's not configurable (nor advertised, with 8 in the response to 'AT+FCLASS=?' command) until a 1st call is answered in data mode!
Tried different setup (on top of windows driver extracted .inf file that shows the init strings used by the supposed-to-work driver!), no solution to this. So this is done the way it proved to work (after 1st answered/filtered call).
An AT command set reference can be found here:
https://arcelect.com/IML56_modem_AT_commands.pdf
Thanks!
I have re-used an old POTS 56K (hardware) analog modem as a caller ID filtering device: Far too many unsolicited calls (publicity, sellers...)!
The idea is to configure the modem (basic config, no auto-answer etc, using modems "AT" command set) connected on my internet modem that also acts as an IP phone gateway (those all-in-one french "internet boxes"), using it's phone line RJ11 (unused, the modem also does DECT, so phones are wirelessly connected) connector.
When the phone rings, before the 2nd ring, provided CID (caller ID) reporting is setup ("AT+VCID=1"), I get lines of data on the serial ttyUSB of the modem:
DATE = 0625
TIME = 1133
NMBR = 06XXXXXXXX
NAME = ...
Good point: The name info is only given for my phone registered numbers, so filtering family and friends is an easy job!
For callers with no NAME info, I call a www.shouldianswer.com page (french version: http://www.doisjerepondre.fr/numero-de-telephone/NMBR) to get a phone number classification score that can be unknown/neutral/negative.
No public API for this service, had to parse the page using python beautfifulsoup module for the interesting part of the response that can be:
[<div class="scoreContainer">\n<div class="score unknown"></div>\n</div>]
[<div class="scoreContainer">\n<div class="score neutral"></div>\n</div>]
[<div class="scoreContainer">\n<div class="score negative"></div>\n</div>]
If negative, modem answers ('ATA' in data mode, 'ATS1' in voice mode) then hangs up after 1s ('ATH'/'ATS0' respectively): Phone only rings once and I'm quiet again!
I can say this mostly works... Had to cope with a few modem bugs (to set the modem in voice mode, to avoid a nice old analog modem sound while trying to sync with remote!!!), by the way, but there is one remaining problem I could not solve for now:
Sometimes, modem shows rings ('RING' string in data mode, '<DLE>R' in voice mode) but no CID info. This may probably happen (private calls?), but problem is my phone did retrieve the information, so the modem really misses some CIDs!
In the infinite loop that receive/process modem data, I had some ring nb checks (to be able to separate call attempts, answered by my phones or not) using 'ATS1?' command: This looks to disturb CID read if the command is sent before all the CID lines are received. So I count rings in the loop and used a timeout mechanism instead. Now, no more possible writes before full CID is read to avoid killing it for current call attempt!
Less misses... But still have some! Maybe 20/30%...
=> The question is: Do someone on the forum have experience with raw modem use tips and tricks?
As this may be modem/hardware dependent, mine is branded as Longshine LCS-8151C1 and its Conexant based with this FW version (can be read using 'ATI3' command):
"CX93001-EIS_V0.2013-V92"
As said here-upper, this modem looks a bit buggy: For instance, it supports voice mode but it's not configurable (nor advertised, with 8 in the response to 'AT+FCLASS=?' command) until a 1st call is answered in data mode!
Tried different setup (on top of windows driver extracted .inf file that shows the init strings used by the supposed-to-work driver!), no solution to this. So this is done the way it proved to work (after 1st answered/filtered call).
An AT command set reference can be found here:
https://arcelect.com/IML56_modem_AT_commands.pdf
Thanks!