50-56 Seconds delay in asterisk

CASE: Hi, i have an ATA from analog Nortel PBAX to one FXO port in my asterisk box.
When i dial from the Nortel PABX throught the ATA From FXS Nortel to --> FXO Asterisk
The call is begin answered perfectly and works fine.

PROBLEM: When i dial from Nortel PABX FXS to -->FXO Asterisk the call is answered and ring a phone 201. I have this
exten=>s,1,Answer
exten=>s,2,Dial(SIP/201)

BUG: When i dial from Nortel to asterisk, and the SIP/201 start ringing, I hangup the handset in the NORTEL and the SIP/201 keep ringing…

WTF: I’am very smart, i use tools Digium provide, i was monitoring the channel in real time using this:
dahdi_monitor 3 -v using this tool i saw that the FXO port in Asterisk is keeping sending data on it
Then betwen 50 or 56 seconds, i can see that the line get busy tones for at least many times, 4 or 5.

QUESTION: Why if i hangup from the Nortel PABX the asterisk keep sending data via the FXO port in asterisk? Where configure that delay to a new one more low

What i Need?: I need that when i dial from my PBX to the asterisk, and i hangup the asterisk hangup too inmediatly i hangup in the NORTEL FXS port or play busytones to asterisk detects the hangup.

What i have to edit and where. Example chan_dahdi.c channel.c etc where where???

In asterisk my FXO config is:

[code];;; line="3 WCTDM/4/2 FXSKS"
signalling=fxs_ks
callerid=asreceived
group=0
waitfordialtone=no
qsigchannelmapping=logical
callwaitingcallerid=yes
ringtimeout=500
busycount = 3
busydetect = yes
callprogress=yes
context=from-pstn3
cidstart=ring

busypattern = 500,500
echotraining=no
echocancel=no
answeronpolarityswitch = no
hanguponpolarityswitch = yes

; Max amount of ANI to ask for
mfcr2_max_ani=2

; Max amount of DNIS to ask for
; mfcr2_max_dnis=2
channel => 3

[/code]

You don’t have disconnect supervision on the line. If this is an extension circuit from the Nortel, I would be rather surprised to find any disconnect supervision present.

Also note that you do not need to Answer() the call; it will be answered at a more appropriate time by the Dial application, in this case, when the SIP phone answers.

The premature Answer() compounds the problem, as the Nortel sees the line as being busy, whereas if it were in a ringing state, it would release the line immediately when the caller went away. A problem does arise if he outgoing side were an analogue line without answer supervision, as Asterisk itself, would need to do a premature answer.

I’m not sure if “you must always Answer() as the first step in a dialplan” is in the list of common Asterisk fallacies, but it should be.

Note. I would have seen this before if it had been on the Asterisk Support forum.