Thank you Daniel. Now it works correct, it creates BYE with correct ruri and send it to correct port, without creation of new connection.
In my kamailio configuration I using fix_nated_contact(). Do I need switch to set_contact_alias() and if so, how I can do this with minimal changes?
Also for best perfomance I had to add some indexes to topos_d and topos_t tables. I have attached my structure to this message.
Thank you. [topos_db.sql.gz](https://github.com/kamailio/kamailio/files/1538888/topos_db.sql.gz)