I have the following inconvenience, when I call my sip trunk, the call goes through fine, I transfer that same call to another extension and the communication is ok, but when I hang up the call on the IP phone, the call does not hang up on the device from where I made it. the call, for example my cell phone, that call remains there as if it were still active.
There are many ways of doing transfers when a SIP endpoint is the transferor:
Feature codes.
SIP REFER (for answered call blind transfers)
SIP INVITE, followed by REFER/Replaces (answered call attended transfers, and also used, in an automated way, for unattended ones)
Status 302, for unanswered (always blind) transfers
You didn’t say how you called your trunk (actually trunks don’t exist in SIP, but I assume you mean via an ITSP).
Do the extensions dial SIP devices?
In a pure SIP environment, the likely reason for hangup not to work is that the wrong Contact address was sent, but you would either expect the same problem if the call has hungup before the transfer, at least if the call was made directly to the final endpoint.
If analogue devices are involved, there are other mechanisms.
We basically need much more information about your configuration to do more than guess. We may well need SIP protocol traces.