Remote Hangup


If a call comes in on posts line (TDM400P) and is automatically sent out to my mobile, and I miss the call, the result is a 30 minute answer phone message on my mobile and a large voip provider bill.

It seems that my asterisk box is not understanding when my pots line tells it the remote caller has hung up.

Any assistance sorting this out would be appreciated.



you need something called disconect supervision. When you have this, and the remote end of the line hangs up, the telco sends a CPC signal (short polarity reversal) to signal the end of the call. To test if you have this, find a standard analog phone with a backlit keypad (the kind that’s powered from the phone line and doesn’t have a battery or power plug). Now call your cell phone, and hang up the cell phone. If the backlight on the keypad doesn’t go out for a second when you hang up, you need to call your telco and request disconnect supervision.

To setup *- your FXO port type must be set to FXS_KS. KS is Kewlstart- loopstart with disconnect supervision. also turn on hanguponpolarityswitch=yes

Hope that helps!

Thanks IronHelix for your informative reply.

The following question is relative to my original query as it could be the problem is not actually a problem with remote hangup - more about remote not hanging up!

If an application dials a mobile and the mobile goes to voicemail, how does Asterisk know when to hang up? You see, I have experienced the other end hanging up only after 29m 59s. This is when the other end hangs up and then Asterisk hangs up too.

The only way I can imagine Asterisk could do this would be based on X seconds or minutes of silence but any info I can find relating to ‘silence detect’ seem to relate to the Asterisk VM system.

Thanks again,


There is an application WaitForSilence() which will wait for a certain number of seconds of silence, before proceeding.

I think how this would work depends on what you are doing. If you are pushing calls out to people (ie for a billing reminder system) you should force them to acknowledge the call in some way, possibly by pushing a number key. If they don’t push the key, the call will time out after 30 seconds or so.

Hi IronHelix, thanks for your help.

The reason the question come about was because I was diverting inbound POTS line calls to my mobile via a voip trunk. I found my * box had made several 30 minute calls to my mobiles voicemail system.

For some reason, when the POTS caller hung up, the ZAP trunk closed but the voip trunk stayed open until the mobile company ended the call 30 minutes later.

If I forward my internal extension to 234 then have:

exten => 234,1,dial(IAX2/voiptrunk/447962111222)
exten => 234,2,WaitForSilence(10000,1)
exten => 234,3,Hangup()

Would this allow a caller to leave a message and than hang up the trunk if 10 seconds of silence is encountered?

Your help is appreciated. Thanks.

No I don’t think so, because in that code example it will still be on ‘dial’ while the silence is occurring.

I think your best bet is to get reliable disconnect supervision on the pots side. I think there may be an option in zaptel to hangup after X seconds of silence? Either that or disconnect supervision. because once the zap side hangs up, the voip side will then hang up with it. If the zap side doesn’t have disconnect supervision, then even if the voip side is hung up it may still think the zap is off hook…