Is there a modem expert in the house?

123

Senior Member
I've scoured the basic AT command set and can't find a setting that makes a modem report the Hook Status.

A modem reports when it detects a RING and Caller ID information (TIME, DATE, NMBR, NAME). Maybe it isn't possible but I want to see something like "OFFHOOK/ONHOOK" reported when someone lifts a handset elsewhere in the house.

In addition, I'd like to see it report touchtones. I think the modem must support Voice in order to detect touchtones. If at all possible, I'd like to accomplish all of this without using TAPI; I simply want to parse the strings reported by the modem.


PS
If it is not possible with a modem, then there might be something I can do with ELK M1 Rules. It has the ability to detect certain telephone events including offhook/onhook status:
TELEPHONE LINE IS RINGING

TELEPHONE LINE SEIZE
--> OCCURS
--> CLEARS

TELEPHONE LINE ON/OFF HOOK
--> GOES OFF-HOOK
--> GOES ON-HOOK

TELEPHONE LOCAL ACCESS
--> BEGINS
--> ENDS
 
I am no expert but "played" with modems in the 80's-90's. Remember though "upgrading" from 300 baud to 1200 baud and thinking how "fast" it was back then...like more recently today with PDA phones initially using GPRS versus today's 3G for browsing the internet.

You can read the S-Registers. Typically similiar but unique to model of modem. Many years ago (in the 90's) used the S-Registers for a hardware device that I made for a dial up BBS I had. What is the model of modem?

Sn=x - "Status Registers" - This command writes to or reads data from S-register n. The data written is represented in the place of x. The data used in read mode is selected by the value in x. S-registers can vary a great deal, please consult the AT Command Set specific to your modem when attempting to use these.

Here's the Hayes S-register command set.

Modem S register definitions
Register Description Range Default value
S0 Number of rings before Auto-Answer 0–0 never 0
S1 Ring Counter 0–255 rings 0
S2 Escape character 0–255, ASCII decimal 43
S3 Carriage Return Character 0–127, ASCII decimal 13 (Carriage Return)
S4 Line Feed Character 0–127, ASCII decimal 10 (Line Feed)
S5 Backspace Character 0–32, ASCII decimal 8 (Backspace)
S6 Wait Time before Blind Dialing 2–255 seconds 2
S7 Wait for Carrier after Dial 1–255 seconds 50
S8 Pause Time for Comma (Dial Delay) 0–255 seconds 2
S9 Carrier Detect Response Time 1–255 tenths of a seconds 6 (0.6 second)
S10 Delay between Loss of Carrier and Hang-Up 1–255 tenths of a second 14 (1.4 seconds)
S11 DTMF Tone Duration 50–255 milliseconds 95 milliseconds
S12 Escape Code Guard Time 0–255 fiftieths of a second 50 (1 second)
S18 Test Timer 0–255 seconds 0 seconds
S25 Delay to DTR 0–255 (seconds if sychronous mode, hundredths of a second in all other modes) 5
S26 RTS to CTS Delay Interval 0–255 hundredths of a second 1 hundredth of a second
S30 Inactivity Disconnect Timer 0–255 tens of seconds 0 (disable)
S37 Desired Telco Line Speed 0–10
Command options:

0 Attempt auto mode connection
1 Attempt to connect at 300 bit/s
2 Attempt to connect at 300 bit/s
3 Attempt to connect at 300 bit/s
5 Attempt to connect at 1200 bit/s
6 Attempt to connect at 2400 bit/s
7 Attempt to connect in V.23 75/1200 mode.
8 Attempt to connect at 9600 bit/s
9 Attempt to connect at 12000 bit/s
10 Attempt to connect at 14400 bit/s
0
S38 Delay before Force Disconnect 0–255 seconds 20 seconds

From here:

Hayes Wiki
 
I'm going to need some more hand-holding because I didn't see anything in the S registers that makes the modem report hook status. Nor do I see a register that holds the current hook status. If I'm not mistaken, the S registers define how the modem handles initiating/receiving calls.
 
I'm going to need some more hand-holding because I didn't see anything in the S registers that makes the modem report hook status. Nor do I see a register that holds the current hook status. If I'm not mistaken, the S registers define how the modem handles initiating/receiving calls.


It depends on the model / mfg of modem. Some carry the last few calls in memory. There's really no set definition for what the S registers store. Some just a couple of things others have many functions.

I can help. What is the model and mfg of the modem?
 
Isn't a modem one of those things that connected to your Atari 64? ;)

I'm pretty sure I tried the exact thing as you, even went as far if seeing that this feature was even in the modem chip my modem used. The modem CAN tell if ITS off-hook or on-hook, but I never could find a way to tell if another phone was off-hook short of attempting to dial a number and see if it can detect a dial tone.
 
My custom HW device would actually create a single connection to the phone line and disconnect rest of lines using the modem commands / HW relays - made just for use of a BBS. It would do same for incoming / outgoing calls.

Actually got the phone company PO'd with me (early-middle 1980's) because of the BBS I was running at the time. I had the BBS connected to a bank of public telephone lines in my place of business at the time. (and I cared more about the BBS versus the outgoing/incoming on the public phone lines at the time).
 
There are a few issues with trying to do this with a modem. I was going down this path but am thinking other hardware will be better. The modem can't tell if other phones are on the line. Most voice modems don't do a very good job of DTMF decoding.

I was wanting something that runs under linux and there are some things out there - vgetty and VOCP. I got it partially working but the poor DTMF decoding was the biggest issue. I would have been able to record and play back audio.

Your best bet is to put something together with a micro and a DTMF decoder chip. I was also wanting caller ID so a chip for that too. And the line in use status can easily be detected based on voltage. There are a few projects out there that do most of what I wanted. I wanted a serial interface as I have lots of them.

What are you wanting to get this into? A PC? What OS? Are you able/willing to build a micro project? If so I may be able to point you to more info...
 
... What are you wanting to get this into? A PC? What OS? ...
I want to be able to detect On-hook/Off-hook and Caller ID. I can get Caller ID from the modem but Hook Status has eluded me. The modem is connected, via USB, to a PC running Windows XP.

An added bonus would be to detect the special dial-tone that indicates there are new voice-mail messages. I suspect modems are unable to detect this tone.
 
Today with HSPro / HAI plugin / Way2Call and a serially connected CID device I get that info. I can read the on-hook/off-hook and CID (in addition to outbound calls and custom events based on inbound calls)

I use HSPhone plus a couple of other HS plugins.

Here is a list of s-register entries for USR modems via the internet. Historically I've also opened up support tickets with them and they are very responsive.

USR S-Register
 
Here are a couple links to the commands. If you are able to type commands in Hyperterminal or something similar (not sure exactly how this would work with a USB connection) then you can figure out many of the commands by experimenting.

http://en.wikipedia.org/wiki/Hayes_command_set

http://en.wikipedia.org/wiki/Voice_modem_command_set

http://www.vocpsystem.com/install_modems.php?mode=function

The last one is for VOCP but the commands would be the same for whatever OS and terminal program you use and it has some good information on determining voice modem capabilities.

For line activity the hardware is pretty simple. A few parts and an optoisolator feeding a signal into a serial handshake line or a parallel port pin. XP will make it harder to directly check that pin but it is possible.

Not sure about message waiting. For me I think this is a 'stutter' in the dial tone when the handset is lifted. I haven't seen anything on automatically detecting it.
 
pete_c,
I've reviewed the list of S registers and, honestly, can't find anything that controls the display of hook-status.

JimS,
Thanks for links. I had already reviewed the Wikipedia articles and didn't find anything about hook-status (other than H0 and H1 which aren't what I want). The article in the third link was a bit of a rehash of the voice modem material covered in Wikipedia.

I'm beginning to believe ano's conclusion and maybe hook-status cannot be monitored with a garden-variety modem.
 
I created UltraCID HSPI (Caller ID) plug-in for HomeSeer. This is the modem initialization command sequence I use to report caller ID and handset status (reported as P or p).

ATQ0V1E0
AT+GMM
AT+VCID=1
AT+FCLASS=8

Regards,
Ultrajones
 
123 -

You also mentioned use of Elk panel too - here is that status I see of the panel via HS plugin.

You mentioned the Elk status'. Does your HA application create variables for the status of the panel?

My little "box" that I built in the 80's actually used the on/off hook status via the modem which was connected to 3 or 4 telephone lines. Think at the time it was a Ventel or something like that modem?
 
Actually, forgetting about modems, etc. its very easy to detect if a phone is off hook. Just measure the voltage across the red and green wires. If all phones are on-hook, the voltage will be over 60V DC. If any phone is off-hook, the voltage will be under 30V. A modem could measure this as well, but none seem to. However, designing something that can is pretty easy. Even if you have NO design skills, there are devices out there designed to connect a tape recorder to a phone line that have a relay that trips when a phone goes off-line (to start the tape recorder). Radio Shack used to carry these for under $20. Note sure if they still do.
 
Back
Top