[asterisk-users] SoftHangup for emergency calls

Dave Platt dplatt at radagast.org
Fri Oct 12 12:42:33 CDT 2012


> Setting up a group of analog lines to use for outbound emergency calls 
> (911).  My current dial plan and debug output shown below.  It appears 
> that when the SoftHangup() is executed that the line does not really 
> hang up.  In the case shown, I had reduced the group to a single DAHDI 
> (analog) channel and dialed in to that number from the outside. You can 
> see in the output that the SoftHangup() was executed, but the call was 
> not terminated - the outside caller stayed connected to something.  
> Caller no longer heard the sounds from the menu he was in, but the call 
> itself seemed to stay connected.

That may be due to a common characteristic of PSTN lines (at least,
it's common here in the U.S.)

By design, most U.S. PSTN lines have a very asymmetrical response
to a physical hangup:

-  If the calling party hangs up, the call is terminated
   immediately.

-  If the called party hangs up, and the calling party does not,
   the line remains "live" for some time (typically around 30
   seconds, I believe).  If the called party goes off-hook again
   during this period, they can resume the call.

If I recall correctly, things were designed this way so that
the called party could say "Oh, hang on, I answered this call
in the bedroom and the stuff I need is in the living room",
hang up the extension phone, go to another room, pick up the
other phone and carry on with the call.

If that's what you're running into here - if the line you
are trying to SoftHangup() was handing an inbound call - then
there may be no good solution.  As far as I know, there is no
way to force an incoming PSTN call to release the line, other
than "go on-hook, and wait for 30 seconds to pass".

Several possible workarounds, roughly in order of increasing
complexity and decreasing reliability:

(1) Keep one of your PSTN lines reserved for emergency calls
    only;  remove it from your inbound hunt group and place
    it in a Dahdi line group of its own (or don't group it at
    all).

(2) Keep one of your PSTN lines reserved for *outbound* calls
    only;  you should be able to SoftHangup() an outbound call
    within a second or two.

(3) Figure out a way to check the PSTN lines that are in use
    at the time of an emergency - if they're all in use,
    somehow find one which was in use for an outbound call,
    and select it as the one to SoftHangup() and dial upon.

(4) If you must keep all of your PSTN lines in bidirectional
    use, you may have to *tell* the parties that the line is
    needed for an emergency call, and ask them to release the
    line.  Do a barge-in on the channel, play an alert sound,
    play a message saying "Emergency call in progress, please hang
    up this line immediately, play the alert sound again for
    a few seconds, SoftHangup(), Wait(2), and then try dialing.





More information about the asterisk-users mailing list