Ticket #390 (closed enhancement: fixed)
Register session will keep transport instance so that keep-alive is sent
|Reported by:||bennylp||Owned by:||bennylp|
|Backport to 1.x milestone:||Backported:|
Previously, the client registration session (pjsip_regc) doesn't keep track of which transport it uses, and the reference to the transport will be released once the REGISTER UAC transaction completes. With TCP and TLS transport, this will make transport manager to close down the transport after PJSIP_TRANSPORT_IDLE_TIME seconds, when there are no other SIP objects referencing the transport.
This is not ideal, since we want to keep the transport open (especially for TLS) so that server can send requests to us. Especially with the new keep-alive mechanism for TCP and TLS (in ticket #95), which will maintain the connection open for us.
With this ticket, the client registration session will keep the reference of the last transport used. This reference will be released either when the session is destroyed, or when it detects that the next request is using difference transport. In the later case, the registration session will update the reference to the last transport used.