Problem in session termination

Hi,
I am working in asterisk version 1.2.1.3. Calls are successfully made using asterisk manager API’s. Normally successful calls are made with proper hangup events. At times the hangup events are received but the session is not terminated by BYE message. So could’nt start a new session. I am using RTC agent and respondent through a third party sip server. Tell me how culd i overcome this problem… Kindly help me.

Thanks,
Karthik