News:

On Tuesday September 6th the forum will be down for maintenance from 9:30 PM to 11:59 PM PDT

Main Menu

Notification of off hook / not connected status

Started by n4mwd, August 19, 2019, 04:12:58 PM

Previous topic - Next topic

n4mwd

Does anyone know of a way to get the Obi200 to send some kind of email or IOT notification whenever the phone is accidentally left off the hook?  That is, when the SIP is not actually connected, but the phone is still off hook for more than 1 minute. 

azrobert

#1
The OBi200 has the ability to make a call when nothing is dialed after the phone is taken off-hook. You can get a free account at Callcentric. They have an email notification for voicemail. The email/voicemail you will receive will be silence. You would have to test this to make sure it works. You have to use OBi Expert to configure the OBi200.

n4mwd

Thanks, I am looking for something that I can use with an IOT device to sound an alarm that would announce that the phone is off the hook over a loudspeaker.  What you describe sounds close, but in my case, I would mainly need to detect someone not hanging the phone up after a call is terminated. 

It sounds like you are referring to the hotline feature of the OBI which will autodial a number when the phone is picked up or nothing dialed in a certain period of time.  Would that also work if someone didn't hang up within a reasonable period of time?

Without the OBI, I can use a circuit to determine if the phone is off the hook, but its not so easy to determine if a SIP connection is still active.

azrobert

I tested the hotline after a call is terminated and it works. The "S" parameter on the hotline has a max of a 9 second delay, so you have to string them together for a longer delay, e.g., <S9S9:5>. I don't know how many you can string. Dial Tone has a 20 second timeout, so that will have to be changed for a longer delay.

You can route the call to a SIP softphone installed on a computer and hear ringing.

n4mwd

So what exactly did you put in which dial string to accomplish this?  Also, can it repeat dial if the phone continues to remain off the hook with no connection?  In order to be an effective approach, it needs to continue until the phone is put back on the hook.

I have also been looking at the phone line polarity.  Under "Physical Interfaces" -> "Phone1 Port" -> "Tip-Ring Voltage Polarity" there is a section that might make it possible to detect the status of a call by the polarity of the Tip/Ring wires.

In my case, it would be easier if I could get your approach to work because I would only need a single circuit, say an ESP wifi board to emulate a SIP server, plus the amplifier.  This is because the PA system is in a central location that does not have access to a phone line.  So if I use the polarity method, I have to have two units, one to detect the off-hook condition and another to activate the PA system - connected by a wireless link.

azrobert

Physical Interfaces - Phone1 Port -> DigitMap:
Add after the beginning parenthesis: <S9S9:5>|

S9S9 will trigger the hotline after 18 seconds
5 is speed dial #5

Define Speed Dial#5:
sp1(user@192.168.1.100:5060)

SP1 must be defined as a non-GV SIP trunk
Replace 192.168.1.100 with the IP address of your server
5060 is the listening port number

If you don't have a non-GV SP trunk, then define a dummy trunk like this:
Service Providers -> ITSP Profile B -> SIP -> ProxyServer: 127.0.0.1
Voice Services -> SP2 Service -> AuthUserName: (any userid)
Voice Services -> SP2 Service -> X_RegisterEnable: (unchecked)
Voice Services -> SP2 Service -> X_ServProvProfile: B

Tone Settings -> Tone Profile A -> Dial Tone -> TonePattern (default):
350-18,440-18;20

The 20 is the timeout value.
If you want to trigger the hotline after 20 or more seconds, this value must be increased.

n4mwd

Thanks, So if "s9s9:5" triggers the hotline in 18 seconds, then what is the "20" on the dial tone string for?

Does "s9s9s9s9" work as you predicted to give a longer delay?

What is the mechanism that causes it to repeat dial until the phone is hung up?

I'm thinking of a minimal SIP server emulator on the ESP wifi board should be sufficient to detect it.

azrobert

The 20 is the Dial Tone timeout value. You will get a Busy when the phone is off-hook for more than the timeout value. This will prevent the Hotline from triggering, so the timeout must be set higher than the Hotline delay.

"S9S9S9S9" will produce a 36 second delay. The "S" must be upper case.

The Hotline is triggered when Dial Tone is produced plus the delay. Your server must hang up and after a few seconds Dial tone will be produced then the Hotline will be triggered again after the delay.

n4mwd

Thanks, That sounds like it will do exactly what I want. 

I am assuming that the "<S9S9:5>|" will not interfere with the regular dial string.  The dial strings I use are fairly complicated, but don't rely on inactive timers.  I use S0 a lot, but never S9.

I am thinking that it wouldn't need to redial after all.  Once it connects to the fake sip server, it will send a SIP BYE to indicate that the phone has been hung up.  The ESP could easily set any delay it wants between "The phone is off the hook.  Please hang it up." messages.

drgeoff

Quote from: n4mwd on August 21, 2019, 04:37:27 PM
I am assuming that the "<S9S9:5>|" will not interfere with the regular dial string.  The dial strings I use are fairly complicated, but don't rely on inactive timers.  I use S0 a lot, but never S9.
AIUI you can only have one <S0:something> entry in a digit map and it will trump any <Sn:something> (n not equal zero) entry in the same map.

n4mwd

Its more like "<911S0:911> |" so that once it gets a certain sequence of digits, it connects without waiting.  In my case, if a standard North American local or long distance number is dialed, it connects without waiting or the "#" key.  That shouldn't cause a problem because it wont hit the S0 until after the preceding digits are dialed first.

That  said, I think I found a flaw in the process.  If any invalid key sequence is pressed and THEN the phone is set off the hook, it connects to a busy signal followed by a fast busy signal and then nothing.  It does not give another dial tone.  Do the "S9" commands care if keys have already been pressed that don't match anything else?  Or do they override other key sequences such that if you had <S9:5> and did not complete your dialing sequence within 9 seconds, it calls speed dial 5?

drgeoff

#11
Quote from: n4mwd on August 22, 2019, 05:44:38 AM
Its more like "<911S0:911> |" so that once it gets a certain sequence of digits, it connects without waiting.  In my case, if a standard North American local or long distance number is dialed, it connects without waiting or the "#" key.  That shouldn't cause a problem because it wont hit the S0 until after the preceding digits are dialed first.

That  said, I think I found a flaw in the process.  If any invalid key sequence is pressed and THEN the phone is set off the hook, it connects to a busy signal followed by a fast busy signal and then nothing.  It does not give another dial tone.  Do the "S9" commands care if keys have already been pressed that don't match anything else?  Or do they override other key sequences such that if you had <S9:5> and did not complete your dialing sequence within 9 seconds, it calls speed dial 5?
That use of Sn at the end is completely different from the use of <Sn:something> and there is no conflict between them.

Within the Sn timeout period, the very first digit (or # or *) of dialling anything "kills" the <Sn:something> substitution. Valid or not is irrelevant.

azrobert

Quote from: n4mwd on August 22, 2019, 05:44:38 AM
That  said, I think I found a flaw in the process. 

Add "@@.S4" to the Phone DigitMap.
Now you will get "No Service Error" 3 times and then Dial Tone.

This "<911S0:911>|" works for 911 zero delay, but you can just do this "911S0".

n4mwd

#13
Thanks, I think that will work.  Now the hard part.  I need to write a fake SIP server to accept the call and initiate the alarm.  The ESP boards already support web servers, which is not that far from SIP, but it will still require a good bit of programming to do what I want.

I'm using the Arduino IDE suite and its very painful to use considering it takes about 20 minutes for a compile.