Still monitoring the channel after hang up

Hello guys, maybe somebody will be able to help me on this one:

When I originate a call from my ZAP channel to an extension that also monitors the conversation in a wav file, I get cca. 20 seconds of “beep beep beep beep” sounds (hang up beeping sounds) after the both parties have already hung up their phones. Is there a way to avoid this? Apparently the DIAL command is still active, eventhough in fact it shouldn’t be, in my problematic extension that looks like this:

exten => _82.,1,Answer()
exten => _82.,n,Monitor(wav,0_${EXTEN:2}_${UNIQUEID}_${TIMESTAMP},mb)
exten => _82.,n,Dial(ZAP/g2/0${EXTEN:2},,tT)
exten => _82.,n,StopMonitor()
exten => _82.,n,HangUp()

Thanks for any suggestions you might have!

Sorry, for spamming this forum, but I think I have solved the problem myself:

busydetect and busycount parameters in the zapata.conf seem to do the trick.