Asterisk wont hang up... sometimes. Close to switching

I’ve posted about this before, and I never got an answer. I need to restart Asterisk daily. This bothres me, and on top of that it isnt guarenteed to make asterisk act right.

I always make sure I’m using the latest asterisk, but no change to date.

I have completely reinstalled the OS on my ‘poorly behaved asterisk server’. I went with 32-bit this time. I also changed the hard disk and the power supply for lack of better ideas.

Nonetheless, my issues with chan_zap persist

claudia*CLI> show channels
Channel              Location             State   Application(Data)
Zap/7-1              (None)               Up      AppDial((Outgoing Line))
SIP/Aron-b5866550    919732667814@outboun Up      Dial(ZAP/g1/ww19732667814|60)
Zap/6-1              (None)               Up      AppDial((Outgoing Line))
SIP/Aron-b585fc48    919732667814@outboun Up      Dial(ZAP/g1/ww19732667814|60)
Zap/5-1              (None)               Up      AppDial((Outgoing Line))
SIP/Aron-b5856958    919737159071@outboun Up      Dial(ZAP/g1/ww19737159071|60)
6 active channels
3 active calls
claudia*CLI> core show version
Asterisk 1.4.22 built by root @ claudia on a i686 running Linux on 2008-10-13 05:53:27 UTC

That would be EVERY SINGLE ZAP LINE THAT I HAVE. No one is on the phone. Luckily I roll calls over to a voip provider at a few cents a minute when this happens.

This happens with either Sangoma or Digium hardware. The people at Sangoma can give me NO help. And using digium hardware may actually make it worse, if anything (which is why i switched).

I know it has nothing to do with my line voltage.

Restarting asterisk nightly seems to help the issue, but guarentees me NOTHING. It may still happen.

Nevertheless, this is not how services should be administered.

No one has been able to help me with this, and until I can get this resolved I don’t feel confident either recommending asterisk to anyone or deploying it myself. I used to love the idea of Asterisk, but in practice now I’m thinking of switching. I consider myself a pretty smart guy, but this is just out of my league.

I have no idea what might cause it, and it is just as likely to happen with inbound and outbound calls.

I have another server which I call ‘well behaved’ that has a similar problem. Thankfully it’s not with zap, so it doesn’t create any wierdness.

These servers are identical, except that now the poorly behaved server is running a 32bit OS. They both are Tyan S285 based servers with opteron 160s and a gig of ECC ram.

Again, NO ONE is on the phone. This totallty sucks.

If there is any good news it’s that asterisk stabity has greatly improved for me after consitently upgrading (occasionally it gets worse and I roll back), so i no longer live in fear of the deadlock.

Any help, as always, would be much appreciated.

So, we know the problem is with Disconect Supervision. So, your FXO ports are just not seeing the “clear down” or “Call Party Control” (CPC). In the UK this is often referred to as DCT meaning “Disconnect clear time.” This is where you are having the problem. What’s happening is your value here, most likely doesn’t jive with your providers value. (eg. Asterisk CPC=100ms and Telcom CPC=800ms)

Please answer the following Questions:

  1. What country are you in?
  2. What provider are you using?
  3. What type of Zap cards are you using? (eg TDM400)
  4. Can you please post your zapata.conf ?
  5. What is the square root of 169?

Okay, you only have to answer the first four. The last one just buys you some street cred. Answer this batch o’ prodding and there may be a shiny answer in store :smile:

maybe this is too obvious… but if you are having the same problem on two servers, one 32 bit, one 64 bit, one Zap, one Sip, perhaps there is something else in common which is causing your channels to get hung.

What does the dialplan look like?

But, isn’t it happening just on the two different Zap cards? One could reason that it’s not the server, or those cards. I am pretty sure it’s the CPC/DCT.

it looks from the log above that there are scenarios where pure SIP-to-SIP or IAX-to-SIP calls are getting hung as well. Those wouldn’t be affected by said card.

True. Hmmm, but it also said that the calls were overflowing onto SIP, so it might have been a screen shot from that time… I guess what we really need here is more input from FuriousGeorge!

Sorry for delay. I got sick as a dog the day after posting this.

[quote=“Mark_Logan”]So, we know the problem is with Disconect Supervision. So, your FXO ports are just not seeing the “clear down” or “Call Party Control” (CPC). In the UK this is often referred to as DCT meaning “Disconnect clear time.” This is where you are having the problem. What’s happening is your value here, most likely doesn’t jive with your providers value. (eg. Asterisk CPC=100ms and Telcom CPC=800ms)

  1. US
  2. At&T
  3. Sangoma A200, also tried TDM400 before.
# cat /etc/zaptel.conf
# Autogenerated by /usr/local/sbin/sangoma/setup-sangoma -- do not hand edit
# Zaptel Channels Configurations (zaptel.conf)

#Sangoma A200 [slot:9 bus:1 span:1] <wanpipe1>
  1. For extra credit: 13

So, you have this hooked to a bunch of analog POTS line, not a PRI/BRI or the like?

The well behaved only has hangup detection issues with SIP, usually between two extensions, when xferring.

Analog lines, three to be exact. I’ll be back with that dialplan in an hour or so.





exten=> 8882717336,1,goto(open,s,1) ;use toll free for failover

; First, let’s do the holidays
include => holiday|||1|jan
include => holiday|||28|may
include => holiday|||4|jul
include => holiday|||4|sep
include => holiday|||23|nov
include => holiday|||25|dec
include => holiday|||31|dec

; these are the days we’re open
include => open|06:20-18:45|mon-fri||
include => open|06:20-13:45|sat||

; if we’re not open, we’re closed (duh!)
include => closed

exten => s,1,Answer
exten => s,n,wait(1)
exten => s,n,Dial(zap/1&zap/2&sip/carmen&sip/aron&sip/maria&sip/register,25)
exten => s,n,voicemail(b0)
exten => s,n,hangup

exten => s,1,Answer
exten => s,n,wait(1)
exten => s,n(dial),Dial(zap/1&zap/2&zap/3&sip/carmen&sip/aron&sip/maria&sip/register,3)
exten => s,n,voicemail(u00)
exten => s,n,hangup

exten => s,1,Answer
exten => s,n,wait(1)
exten => s,n(dial),Dial(zap/1&zap/2&zap/3&sip/carmen&sip/aron&sip/maria&sip/register&sip
exten => s,n,voicemail(u0)
exten => s,n,hangup
exten => asterisk,1,VoiceMailMain("${CALLERIDNUM}")

exten => 100,hint,SIP/Aron
exten => 101,hint,SIP/Carmen
exten => 103,hint,SIP/Register
exten => 109,hint,SIP/Maria

exten => 701,1,ParkedCall(701)
exten => 701,hint,park:701@parkedcalls
exten => 702,1,ParkedCall(702)
exten => 702,hint,park:702@parkedcalls
exten => 703,1,ParkedCall(703)
exten => 703,hint,park:703@parkedcalls

exten => 00,1,goto(700,1)
exten => 01,1,goto(701,1)
exten => 02,1,goto(702,1)
exten => 03,1,goto(703,1)

include => emergency
include => parkedcalls
include => inside
include => local
include => toll

include => emergency
include => parkedcalls
include => inside
include => local

include => emergency
include => parkedcalls
include => inside

exten => _011.,1,macro(voip_call,${EXTEN})

;Force use of POTS with “9” prefix, w/ or w/o “1” prefix
exten => _91NXXNXXXXXX,1,Dial(${POTSOUT}/ww${EXTEN:1},60)
exten => _91NXXNXXXXXX,2,hangup
exten => _9NXXNXXXXXX,1,Dial(${POTSOUT}/ww${EXTEN:1},60)
exten => _9NXXNXXXXXX,2,hangup

exten => _1NXXNXXXXXX,1,macro(voip_call,${EXTEN})
exten => _NXXNXXXXXX,1,macro(voip_call,1${EXTEN})
exten => _81NXXNXXXXXX,1,macro(voip_call,${EXTEN:1})
exten => _8NXXNXXXXXX,1,macro(voip_call,1${EXTEN:1})

exten => _71NXXNXXXXXX,1,set(CALLERID(num)=9734651640)
exten => _71NXXNXXXXXX,n,dial(${VOIPOUT3}/${EXTEN:1})
exten => _7NXXNXXXXXX,1,dial(${VOIPOUT3}/1${EXTEN:1})
exten => _71NXXNXXXXXX,1,dial(${VOIPOUT3}/${EXTEN:1})
exten => _7NXXNXXXXXX,1,dial(${VOIPOUT3}/1${EXTEN:1})

;Internal Extensions
exten => 0,1,Dial(zap/G2,60)
exten => 00,1,Dial(SIP/Carmen&SIP/Aron&SIP/Carlos&SIP/Maria&SIP/Register,60)

exten => 100,1,macro(internal_extension,100,${ARON})
exten => 101,1,macro(internal_extension,101,${CARMEN})
exten => 102,1,macro(internal_extension,102,${CARLOS})
exten => 103,1,macro(internal_extension,103,sip/Register)
exten => 104,1,macro(internal_extension,104,zap/1)
exten => 105,1,macro(internal_extension,105,zap/2)
exten => 106,1,macro(internal_extension,106,zap/3)

exten => 109,1,macro(internal_extension,109,${MARIA})
exten => 108,1,macro(internal_extension,108,${BRIAN})

exten => 999,1,dial(zap/4) ;the horn
exten => 999,n,hangup

exten => _*10[0-9],1,voicemail(b${EXTEN:1})
exten => _**10[0-9],1,voicemail(u${EXTEN:2})
exten => *0,1,voicemail(b${EXTEN:1})
exten => **0,1,voicemail(u${EXTEN:2})
exten => *00,1,voicemail(b${EXTEN:1})
exten => **00,1,voicemail(u${EXTEN:2})

exten => 199,1,answer
exten => 199,n,wait(2)
exten => 199,n,Set(CALLERID(name)=M-${CALLERIDNAME})
exten => 199,n,sipaddheader(“Alert-Info:;info=alert-external;x-line-id=0”) ;DISTINCT RING
exten => 199,n,dial(sip/maria&sip/carmen,15)
exten => 199,n,voicemail(u109)

;snom PAGE
exten => _910[0-9],1,SIPAddHeader(Call-Info:sip:domain;answer-after=0)
exten => _910[0-9],n,goto(inside,${EXTEN:1},1)
exten => _910[0-9],n,hangup

exten=> _50X,1,meetme(${EXTEN})

;Voicemail System
exten => 5000,1,answer()
exten => 5000,2,voicemailmain()
exten => 5000,3,hangup()

exten => 900,1,goto(func,s,1)

[func] ;I have the func
exten => s,1,Answer
exten => s,n,Background(func_instruct) ;1 for away vm, 2 for busy vm, 3 to page
exten => s,n,Set(TIMEOUT(response)=15)
exten => s,n,Set(TIMEOUT(digit)=3)

exten => _[123],1,Set(DB(FLAGS/${CALLERID(num)})=${EXTEN}) ;set db vals and hangup so some channels get dialtone ASAP
exten => _[123],n,hangup

exten => s,1,dial(${POTSOUT}/${ARG1},60)
exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status
exten => s-CHANUNAVAIL,1,playback(tt-somethingwrong)
exten => s-CHANUNAVAIL,2,wait(5)
exten => s-CHANUNAVAIL,3,macro(voip_call,${ARG1})
exten => s.,1,hangup

exten => s,1,set(CALLERID(num)=9734651640)
exten => s,n,set(PROV_COUNT=1)
exten => s,n(start),dial(${VOIPOUT${PROV_COUNT}}/${ARG1},60)
exten => s,n,Goto(s-${DIALSTATUS},1) ; Jump based on status
exten => s-CHANUNAVAIL,1,set(PROV_COUNT=$[${PROV_COUNT}+1])
exten => s-CHANUNAVAIL,n,gotoif($[${PROV_COUNT}<4]?s,start)
exten => s-CHANUNAVAIL,playback(please-hold)
exten => s-CHANUNAVAIL,n,macro(pots_call,${ARG1})
exten => s.,1,hangup

exten => s,1,Gotoif($[${DB(FLAGS/${CALLERID(num)})}=1]?s-NOANSWER,1) ; if flag set call VM
exten => s,n,Gotoif($[${DB(FLAGS/${CALLERID(num)})}=2]?s-BUSY,1) ; do same but lie and say busy
exten => s,n,Gotoif($[${DB(FLAGS/${CALLERID(num)})}=3]?s-PAGE,1) ; page the guy, or just dial the interface as per usual
exten => s,n(dial),Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
exten => s,n,Goto(s-${DIALSTATUS},1) ; Jump based on status

exten => s-BUSY,1,Set(DB(FLAGS/${CALLERID(num)})=0)
exten => s-BUSY,n,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,n,Hangup

exten => s-NOANSWER,1,Set(DB(FLAGS/${CALLERID(num)})=0)
exten => s-NOANSWER,n,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail
exten => s-NOANSWER,n,Hangup

exten => s-PAGE,1,Set(DB(FLAGS/${CALLERID(num)})=0)
exten => s-PAGE,n,SIPAddHeader(Call-Info:sip:domain;answer-after=0) ;substitute YOUR hardware’s SDP page value
exten => s-PAGE,n,goto(s,dial)

exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer

exten => 911,1,dial(zap/G1/ww911)
exten => 911,n,wait(2)
exten => 911,n,dial(zap/G1/ww911)
exten => 911,n,dial(${VOIPOUT}/ww19733667111,g) ; non-emergency is the next best thing
exten => 911,n,goto(emergency,911,1)

Here it is today. As you can see the poorly behaved server has once again tied up all the channels. There is even some bonus chan_sip and res_park stupidity:

claudia*CLI> show channels
Channel              Location             State   Application(Data)
SIP/Carmen-b5887ef8  702@outbound:1       Up      ParkedCall(702)
SIP/Maria-b5870bd0   s@outbound:1         Up      (None)
Zap/7-1              (None)               Up      AppDial((Outgoing Line))
SIP/Maria-b586cc58   918002738439@outboun Up      Dial(ZAP/g1/ww18002738439|60)
Zap/6-1              (None)               Up      AppDial((Outgoing Line))
SIP/Aron-08317b88    919737336520@outboun Up      Dial(ZAP/g1/ww19737336520|60)
Zap/5-1              (None)               Up      AppDial((Outgoing Line))
SIP/Aron-082e22d0    918004397734@outboun Up      Dial(ZAP/g1/ww18004397734|60)
8 active channels
4 active calls

…and the ‘well behaved’ server:

juanita*CLI> show channels
Channel              Location             State   Application(Data)
SIP/Maria-008b6e80   (None)               Up      Bridged Call(SIP/Steve-008b55c
SIP/Steve-008b55c0   s@macro-internal_ext Up      Dial(sip/Maria|20|tT)
SIP/Maria-008b1280   (None)               Up      Bridged Call(SIP/Steve-008a4c9
SIP/Steve-008a4c90   s@macro-internal_ext Up      Dial(sip/Maria|20|tT)
SIP/steve-00898a70   (None)               Up      Bridged Call(SIP/Maria-0089473
SIP/Maria-00894730   s@macro-internal_ext Up      Dial(sip/steve|20|tT)
SIP/Maria-00888510   (None)               Up      Bridged Call(SIP/Steve-0081816
SIP/Steve-00818160   s@macro-internal_ext Up      Dial(sip/Maria|20|tT)
SIP/Maria-0080e290   (None)               Up      Bridged Call(SIP/Steve-0086858
SIP/Steve-00868580   s@macro-internal_ext Up      Dial(sip/Maria|20|tT)
SIP/steve-00879870   (None)               Up      Bridged Call(SIP/Maria-0087553
SIP/Maria-00875530   s@macro-internal_ext Up      Dial(sip/steve|20|tT)
SIP/Maria-008162d0   (None)               Up      Bridged Call(SIP/Steve-0080a85
SIP/Steve-0080a850   s@macro-internal_ext Up      Dial(sip/Maria|20|tT)
SIP/steve-008076d0   (None)               Up      Bridged Call(SIP/Maria-b4dd515
SIP/Maria-b4dd5150   s@macro-internal_ext Up      Dial(sip/steve|20|tT)
SIP/Maria-00808f90   (None)               Up      Bridged Call(SIP/Steve-b4ee803
SIP/Steve-b4ee8030   s@macro-internal_ext Up      Dial(sip/Maria|20|tT)
SIP/Maria-007d9b50   (None)               Up      Bridged Call(SIP/Steve-af9d878
SIP/Steve-af9d8780   s@macro-internal_ext Up      Dial(sip/Maria|20|tT)
SIP/Maria-007aee40   (None)               Up      Bridged Call(SIP/Steve-b4dd341
SIP/Steve-b4dd3410   s@macro-internal_ext Up      Dial(sip/Maria|20|tT)
SIP/Maria-007c7be0   (None)               Up      Bridged Call(SIP/Steve-af9d4de
SIP/Steve-af9d4de0   s@macro-internal_ext Up      Dial(sip/Maria|20|tT)
SIP/steve-0075b990   (None)               Up      Bridged Call(SIP/Maria-b4e2cd8
SIP/Maria-b4e2cd80   s@macro-internal_ext Up      Dial(sip/steve|20|tT)
SIP/steve-007bb530   (None)               Up      Bridged Call(SIP/Maria-b4e311a
SIP/Maria-b4e311a0   s@macro-internal_ext Up      Dial(sip/steve|20|tT)
SIP/steve-007f75f0   (None)               Up      Bridged Call(SIP/Maria-b4dcef0
SIP/Maria-b4dcef00   s@macro-internal_ext Up      Dial(sip/steve|20|tT)
SIP/steve-0082f6d0   (None)               Up      Bridged Call(SIP/Maria-b4e2b4c
SIP/Maria-b4e2b4c0   s@macro-internal_ext Up      Dial(sip/steve|20|tT)
SIP/steve-0078db70   (None)               Up      Bridged Call(SIP/Maria-af9ec63
SIP/Maria-af9ec630   s@macro-internal_ext Up      Dial(sip/steve|20|tT)
SIP/Maria-00838c80   (None)               Up      Bridged Call(SIP/Steve-b4ddc03
SIP/Steve-b4ddc030   s@macro-internal_ext Up      Dial(sip/Maria|20|tT)
SIP/Maria-00752b50   (None)               Up      Bridged Call(SIP/Steve-af98749
SIP/Steve-af987490   s@macro-internal_ext Up      Dial(sip/Maria|20|tT)
SIP/steve-00767140   (None)               Up      Bridged Call(SIP/Maria-b4d580e
SIP/Maria-b4d580e0   s@macro-internal_ext Up      Dial(sip/steve|20|tT)
40 active channels
20 active calls

Is there any hope for me?

Switched from AT&T to Verizon. It costs me more, but so does taking calls in over voip because all my PSTN lines are tied up.

I guess life is about compromises.

Here it is today:

Poorly Behaved Server was kind. Allowed me Zap6 all day.

claudia*CLI> show channels Channel Location State Application(Data) Zap/7-1 s@inbound:4 Up VoiceMail(u0) SIP/register-082aee1 (None) Up AppDial((Outgoing Line)) Zap/5-1 s@inbound:3 Up Dial(zap/1&zap/2&sip/carmen&si SIP/Aron-081ae790 (None) Up AppDial((Outgoing Line)) SIP/Aron-08335bc8 SIP/Aron@park-dial:1 Up Dial(SIP/Aron|30|t) 5 active channels 3 active calls

Well behaved server managed to not hang any channels:

juanita*CLI> show channels Channel Location State Application(Data) 0 active channels 0 active calls

The returned parked call is making it difficult to work out exactly what has happened here (at least without some of the individual core show channel information), but the voicemail problem suggests a problem with disconnect surpervision, for which you will need at least the zaptel equivalent of dahdi show channels, but maybe also the low level driver debug output.

I am assuming that your service provide does provide some sort of disconnect supervision, in which case the problem is probably that the zaptel drivers aren’t configured to match their disconnect supervision mechanism. You will need to ask the SP about how they provide disconnect supervision.

The good news is that changing PSTN Service Provider seems to have fixed the issue of hangup detection on Zap on the ‘poorly behaved server’. It makes sense since this was the only difference between the poorly and well behaved servers,

The bad news is that now I may have some new issues, though I’m not sure…

It deserves its own thread, and I’ll link to the new thread in here when I complete it.

UPDATE: Here is the new post about the new problems since switching PSTN providers: