Instead of BYE use INVITE

I have Asterisk version 1.2.26.1. The problem is: after the end of conversation Asterisk is sending messages Invite istead of BYE. What is the problem?