Hangup detection

I’ve searched all and checked everything I can find, but still have a problem with Asterisk not releasing the line.

If a call come in (TDM400), the system answers and starts a Lumenvox script. If the caller hangs up immediately, the script continues to run and finally connects to the default extension (leaving a blank voicemail). Even without Lumenvox, if an extension is selected, when the caller hangs up, the line is not released.

BellSouth has checked the line ($80.00) and says everything is set properly.

Suggestions greatly appreciated!


Zapata.conf


[channels]
language=en
#include zapata_additional.conf
context=from-pstn
signalling=fxs_ks
faxdetect=incoming
usecallerid=yes
callerid=asreceived
echocancel=yes
callprogress=yes
busydetect=yes
busycount=5
callprogress=yes
progzone=us
echocancelwhenbridged=no
echotraining=800
group=0
channel=1-4
hanguponpolarityswitch=yes


Log output - hangup was done as soon as line picked up


Connected to Asterisk 1.2.12.1 currently running on localhost (pid = 2677)
Verbosity is at least 8
– Starting simple switch on ‘Zap/1-1’
– Executing Set(“Zap/1-1”, “FROM_DID=s”) in new stack
– Executing Set(“Zap/1-1”, "FAX_RX_EMAIL=xxxx@example.com") in new stack
– Executing Answer(“Zap/1-1”, “”) in new stack
– Executing PlayTones(“Zap/1-1”, “ring”) in new stack
– Executing NVFaxDetect(“Zap/1-1”, “5”) in new stack
– Executing Goto(“Zap/1-1”, “custom-lumenvox|s|1”) in new stack
– Goto (custom-lumenvox,s,1)
– Executing Set(“Zap/1-1”, “LOOPCOUNT=0”) in new stack
– Executing SpeechCreate(“Zap/1-1”, “”) in new stack
– Executing SpeechActivateGrammar(“Zap/1-1”, “directory”) in new stack
– Executing SpeechStart(“Zap/1-1”, “”) in new stack
– Executing GotoIf(“Zap/1-1”, “1?6:8”) in new stack
– Goto (custom-lumenvox,s,6)
– Executing SpeechBackground(“Zap/1-1”, “custom/MainIVR|10”) in new stack
– Playing ‘custom/MainIVR’ (language ‘en’)
– Executing Goto(“Zap/1-1”, “s|9”) in new stack
– Goto (custom-lumenvox,s,9)
– Executing SpeechDeactivateGrammar(“Zap/1-1”, “directory”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?custom-check-dtmf|s|1”) in new stack
– Executing GotoIf(“Zap/1-1”, “1?custom-check-dtmf|s|1”) in new stack
– Goto (custom-check-dtmf,s,1)
– Executing GotoIf(“Zap/1-1”, “1?custom-lumenvox|s|12”) in new stack
– Goto (custom-lumenvox,s,12)
– Executing NoOp(“Zap/1-1”, ""Score: “”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?16”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?17”) in new stack
– Executing Goto(“Zap/1-1”, “loop|1”) in new stack
– Goto (custom-lumenvox,loop,1)
– Executing Set(“Zap/1-1”, “LOOPCOUNT=1”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?hang|1”) in new stack
– Executing Goto(“Zap/1-1”, “s|3”) in new stack
– Goto (custom-lumenvox,s,3)
– Executing SpeechActivateGrammar(“Zap/1-1”, “directory”) in new stack
– Executing SpeechStart(“Zap/1-1”, “”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?6:8”) in new stack
– Goto (custom-lumenvox,s,8)
– Executing SpeechBackground(“Zap/1-1”, “custom/didnt-hear|10”) in new stack
– Playing ‘custom/didnt-hear’ (language ‘en’)
– Executing SpeechDeactivateGrammar(“Zap/1-1”, “directory”) in new stack
– Executing GotoIf(“Zap/1-1”, “1?custom-check-dtmf|s|1”) in new stack
– Goto (custom-check-dtmf,s,1)
– Executing GotoIf(“Zap/1-1”, “0?custom-lumenvox|s|12”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?custom-lumenvox|s|12”) in new stack
– Executing GotoIf(“Zap/1-1”, “1?custom-lumenvox|s|12”) in new stack
– Goto (custom-lumenvox,s,12)
– Executing NoOp(“Zap/1-1”, ""Score: “”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?16”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?17”) in new stack
– Executing Goto(“Zap/1-1”, “loop|1”) in new stack
– Goto (custom-lumenvox,loop,1)
– Executing Set(“Zap/1-1”, “LOOPCOUNT=2”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?hang|1”) in new stack
– Executing Goto(“Zap/1-1”, “s|3”) in new stack
– Goto (custom-lumenvox,s,3)
– Executing SpeechActivateGrammar(“Zap/1-1”, “directory”) in new stack
– Executing SpeechStart(“Zap/1-1”, “”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?6:8”) in new stack
– Goto (custom-lumenvox,s,8)
– Executing SpeechBackground(“Zap/1-1”, “custom/didnt-hear|10”) in new stack
– Playing ‘custom/didnt-hear’ (language ‘en’)
– Executing Hangup(“Zap/1-1”, “”) in new stack
== Spawn extension (custom-lumenvox, h, 1) exited non-zero on ‘Zap/1-1’
– Hungup 'Zap/1-1’
localhost*CLI>

I dont believe there is a way of seeing it. I believe you can only see this with a PRI or voip account. I am sure there is a way of hacking asterisk to do this. Ask around on the users and developers lists (lists.digium.com).

This can be detected. Most analog lines have ‘disconnect supervision’ which means that when the remote party hangs up, a CPC signal (short polarity reversal) is sent to indicate the end of a call. For asterisk to detect this you must be using Kewlstart signalling and enable disconnect supervision in zapata.conf.

If it doesn’t appear to work, you can test it. Make a call using a standard touch tone phone with a light-up keypad (one powered by the line and not a battery or adapter). Call your cell phone, talk to yourself for a second, and then hang up the cell phone. Within a few seconds, the keypad light should go out for half a second. If this does not happen, you probably don’t have disconnect supervision. Call your telco and ask them to add it.

What can NOT be easily detected is ANSWER supervision. This is when you place an outgoing call, knowing when the remote party picks up. (remember, when using a ‘dumb’ phone the only way you know is the ringing stops and someone says ‘hello?’). Some places allow you to get (if you want) a CPC signal for answer supervision but as I recall this is only detected on certain Sangoma cards. Could be wrong on that.

hope that helps

Try removing this line in your config.

hanguponpolarityswitch=yes

I finally had some time to revisit this.

Tested the line with a back-lit phone. Appears to be the same as with a voltmeter - when the calling (outside) party hangs up, voltage stays high for about 30 seconds. Then the voltage drops quickly and comes back. When it comes back up, the inside line gets a SIT tone and message to hang up the phone (“if you would like to make a call, please hang up and try again”).

I have tried changing hanguponpolarityswitch with no better results.

BellSouth has checked my lines and says everything is perfect :frowning:

if the keypad doesn’t blink then you are simply not getting disconnect supervision. might there be a pbx or something between the line and you, perhaps from your building or apartment?

If you call them again make sure you make it clear that you want to add the disconnect supervision feature to your line, which you don’t already have. This may also be called kewlstart signalling (loopstart with disconnect supervision).

[quote=“IronHelix”]if the keypad doesn’t blink then you are simply not getting disconnect supervision. might there be a pbx or something between the line and you, perhaps from your building or apartment?

If you call them again make sure you make it clear that you want to add the disconnect supervision feature to your line, which you don’t already have. This may also be called kewlstart signalling (loopstart with disconnect supervision).[/quote]If someone has a way of talking to BellSouth that they would understand, I would like to know it :smile:

I have asked for disconnect supervision (got a blank stare in reply) and for kewlstart signalling (let’s not even go into the response to that). They sent a tech to my office ($80 charge) who said everything was exactly as it should be. I showed him the voltmeter readings while a call / hangup was made - he said everything was exactly as it should be.

The tests were done directly from the demarc, so there is nothing else in the loop. My current PBX (Toshiba DK-280) does seem to clear the line right away however. I don’t know if it is an issue with the TDM400, the Asterisk config, or the POTS line.

I would go and edit your zaptel.conf file and make sure you are set up for Kewlstart signalling. I dont believe disconnect supervision is used unless this is the case… in zaptel.conf for the ports that your POTS liens are plugged into, you shoild see a line like fxsks=x meaning signalling for port x would be fxs kewlstart. that is usually the default that is created if you used genzaptelconf to create your zaptel file.

I also believe on some Central office switches that disconnect supervision is not available from the phone company… if memory serves me right some of the older 5ESS dont support it in all cases unless you were to go to ground start trunks.

-Christopher

[quote=“cadillackid”]I would go and edit your zaptel.conf file and make sure you are set up for Kewlstart signalling. I dont believe disconnect supervision is used unless this is the case… in zaptel.conf for the ports that your POTS liens are plugged into, you shoild see a line like fxsks=x meaning signalling for port x would be fxs kewlstart. that is usually the default that is created if you used genzaptelconf to create your zaptel file.

I also believe on some Central office switches that disconnect supervision is not available from the phone company… if memory serves me right some of the older 5ESS dont support it in all cases unless you were to go to ground start trunks.

-Christopher[/quote]As shown in my 1st post, the conf file is set for kewlstart (although in a different method than you indicate). Is there a difference between
fxsks=1
and
signalling=fxs_ks?
If so, maybe I’ve been losing hair over a simple fix :smile:

The CO is running a Siemens EWSD switch.

actually what I posted from is your /etc/zaptel.conf file.

you can however go into your command prompt and do a ztcfg -vv and that will tell you how the channels are loaded.
it will look similar to mine below

[root@pbx etc]# ztcfg -vv

Zaptel Version: 1.4.0
Echo Canceller: MG2
Configuration
======================


Channel map:

Channel 01: FXO Kewlstart (Default) (Slaves: 01)
Channel 02: FXO Kewlstart (Default) (Slaves: 02)
Channel 03: FXO Kewlstart (Default) (Slaves: 03)
Channel 04: FXS Kewlstart (Default) (Slaves: 04)

4 channels configured.

[root@pbx etc]#

-Christopher

two different files (default locations):

if channel 1 is an fxo port (connected to bell south co)
/etc/zaptel.conf:
fxsks=1
(other channels setup)
loadzone = us

in
/etc/asterisk/zapata.conf:
signalling=fxs_ks
callerid=asreceived
busydetect=yes
context=incoming-pstn
channel => 1

setup other channels, all the fxo ports can be listed at once like 1,3-8 in either file, unless they have different contexts

both settings specifying the correct signaling are required. your zapata.conf indicates channels 1-4 are all fxo ports.

I’d loose the hanguponpolarityswitch=yes and you can probably forget callprogress (I work with verizon and don’t use it) and make sure you restart * with unload/reload the wctdm and zaptel modules to reset, It is unlikely BS is using any non-standard stuff. The ztcfg -vvv command output should show something like:
ztcfg -vvv

Zaptel Configuration

Channel map:

Channel 01: FXS Kewlstart (Default) (Slaves: 01)

and the dmesg command should show:
Module 1: Installed – AUTO FXO (FCC mode)

Registered tone zone 0 (United States / North America)

when the modules load

Start with the simplest settings possible, unload the modules to reset the card, etc. to avoid confusion.

I appreciate the help!

I know I’ve seen the conf location for hanguponpolarityswitch and callprogress, but I can’t recall where (I know I had them, because I tried different permutations). If you could refresh my memory (age is a terrible thing, but you meet new people every day) it will be appreciated.

when you say ‘unload/reload the wctdm and zaptel modules to reset’, is this a procedure I need to do, or will a reboot take care of it?

My zaptel.conf file is (after stripping out all the commented lines):

fxsks=1-4 loadzone = us

The zapata.conf is:[code]

[channels]
language=en
#include zapata_additional.conf
context=from-pstn
signalling=fxs_ks
faxdetect=incoming
usecallerid=yes
callerid=asreceived
echocancel=yes
callprogress=yes
busydetect=yes
busycount=5
[/code]

Results of ztcfg -vv:

[code]
Zaptel Configuration

Channel map:

Channel 01: FXS Kewlstart (Default) (Slaves: 01)
Channel 02: FXS Kewlstart (Default) (Slaves: 02)
Channel 03: FXS Kewlstart (Default) (Slaves: 03)
Channel 04: FXS Kewlstart (Default) (Slaves: 04)

4 channels configured. [/code]

Ran dmesg:

Module 0: Installed -- AUTO FXO (FCC mode)
Module 1: Installed -- AUTO FXO (FCC mode)
Module 2: Installed -- AUTO FXO (FCC mode)
Module 3: Installed -- AUTO FXO (FCC mode)
Registered tone zone 0 (United States / North America)
Registered tone zone 0 (United States / North America)
Registered tone zone 0 (United States / North America)
Registered tone zone 0 (United States / North America)

im beginning to think after reading a previous post that the telco isnt providing the signal, after your test with the analog phone connected to the line. it sounds like they are sending a reversal only before the SIT tone. is there any way you can increase the disconnect time ofthe IVR, or is the IVR set to auto transfer to handle callers that do not press any digits?

I tested for reversal with my own POTS lines here and found I get a reversal within about 2-3 seconds of hangup and that is regardless of the calling source whether it be cell ,another POTS, or VOIP.

I have run into this issue in the past with Loop start trunks and many telcos wont support disconnect supervision on Loop start(POTS) lines or you cant get them to figure out what it is…

if these lines are business lines you might be better off converting your main incoming line to a ground start line. Ground start Lines actually drop talk battery altogether when a call is disconnected, and the line will remain “dead” until your equipment either grounds the ring lead or on incoming call the CO provides battery and then ringing voltage across the Tip side.

if the lines you are using are residential they may just not support it. I didnt look to see where you are but i run into this in the south and southeast a lot old bell atlantic areas I believe.

I dont know how many lines total you want to run eventually put any more than 8 or so lines and ordering in a partial T1 and channel banking it is an option and all major channel banks will send disconnect supervision out of their FXS ports…

but all in all im thinking this is a telco issue and not an asterisk Issue.
-Christopher

Hello All,

I have a similar issue with SIP and Linksys SPA942. I run a full VoIP setup (no analog or zaptel stuff) and X-Lite successfully detects hangups but the Linksys SPA942 never detects it. I always have to manually hang up the phone. Does anyone know what can be done to rectify this issue?