Asterisk does not react to Zap channel hangup


I have small problem with my asterisk box: when a incoming call on a Zap channel from my telco (TP S.A. Poland) side is hanged up before being picked up, asterisk doesn’t stop ringing the target extension. This results in “ghost calls” - called person picks up the phone only to find the other side already disconnected. The strange think is everything worked perfectly with asterisk 1.2.5 (I’m using 1.2.10 now) and that asterisk seems to detect the hangup (as seen in a debug below), but does not react to it.

   -- Accepting voice call from '627373737' to '798' on channel 0/13, span 1
    -- Executing Goto("Zap/13-1", "softphone|898|1") in new stack
    -- Goto (softphone,898,1)
    -- Executing Macro("Zap/13-1", "stdexten|SIP/test") in new stack
    -- Executing Dial("Zap/13-1", "SIP/test|20") in new stack
    -- Called test
    -- SIP/test-081f83d8 is ringing
    -- Channel 0/13, span 1 got hangup ACK <-- Hangup of the person calling from 627373737
    -- Got SIP response 603 "Decline" back from
    -- SIP/test-081f83d8 is busy
  == Everyone is busy/congested at this time (2:1/0/1)
    -- Executing Goto("Zap/13-1", "s-BUSY|1") in new stack
    -- Goto (macro-stdexten,s-BUSY,1)
    -- Executing VoiceMail("Zap/13-1", "b898") in new stack
    -- Playing 'vm-theperson' (language 'pl')
    -- Playing 'digits/8' (language 'pl')
    -- Playing 'digits/9' (language 'pl')
    -- Playing 'digits/8' (language 'pl')
    -- Playing 'vm-isonphone' (language 'pl')
    -- Playing 'vm-intro' (language 'pl')
    -- Playing 'beep' (language 'pl')
    -- Recording the message
    -- x=0, open writing:  /var/spool/asterisk/voicemail/default/898/tmp/dlkZym format: wav49, 0x820ed50
    -- Registered SIP 'mwegrzynek' at port 5067 expires 3600
    -- Saved useragent "Ekiga/2.0.1" for peer test
    -- Took too long, cutting it short...
    -- Playing 'auth-thankyou' (language 'pl')
    -- Executing Goto("Zap/13-1", "default|s|1") in new stack
    -- Goto (default,s,1)

I’m using Digium TE210P card.

Thanks in advance for any help,


The cause of all theses problems were bri patches added by default by Gentoo ebuild. After adding “-bri” USE flag to libpri, asterisk and zaptel, and recompilation of all three programs everything is working as intended.