Asterisk AMI Hook Helper Problem

Hi,

I try to improve an asterisk plugin which simply does recording. To be able to put VOX feature into the existing recording module, I’ve explored event listening mechanisms.
I’ve used amihook helper.So, I can easily detect talking status by listening and catching related events. But the problem is as follows ;

I can make and record a call successfully, but I can not make a second call. It seems like the call is in calling state. I’ve captured network packets, and analyzed it in Wireshark;

According to the packets, for the second call; client sends SIP INVITE message, but Asterisk server does not respond him.
When I remove amihook helper impl, I can make call records recurrently( without VOX feature )
Most probably, some connections are pending, or AMI sockets are not closed. Additionally, I register to amihook helper when recording module is loaded, and unregister when it is unloaded. Should it be on call basis ?

After hangig up the first call, I check the connections ;

tcp 0 0 0.0.0.0:5038 0.0.0.0:* LISTEN 22253/asterisk
tcp 0 0 0.0.0.0:2000 0.0.0.0:* LISTEN 22253/asterisk
tcp 0 0 127.0.0.1:5038 127.0.0.1:59002 ESTABLISHED 22253/asterisk

By the way, manager conf settings are as follows;

[general]
enabled = yes
webenabled = yes

port = 5038
bindaddr = 0.0.0.0

Actually, I don’t know what is wrong. There isn’t any error logs regarding the problem. I can not find any useful documents about AMI events listening mechanism.
Could you please help me to elaborate and solve this problem ?