pjsip_transport_management: Shutdown transport immediately on disconnect
authorSean Bright <sean.bright@gmail.com>
Fri, 18 Jan 2019 22:11:18 +0000 (17:11 -0500)
committerSean Bright <sean.bright@gmail.com>
Mon, 21 Jan 2019 13:57:12 +0000 (07:57 -0600)
commit20f672539ee00fef7205b12d8ed572421f941bd7
tree7e62640b620f81540e91392c2c0c8d2f73fe2cef
parent58b55f2a307d5b9d8c24b945802e40f4d5508f5b
pjsip_transport_management: Shutdown transport immediately on disconnect

The transport management code that checks for idle connections keeps a
reference to PJSIP's transport for IDLE_TIMEOUT milliseconds (32000 by
default). Because of this, if the transport is closed before this
timeout, the idle checking code will keep the transport from actually
being shutdown until the timeout expires.

Rather than passing the AO2 object to the scheduler task, we just pass
its key and look it up when it is time to potentially close the idle
connection. The other transport management code handles cleaning up
everything else for us.

Additionally, because we use the address of the transport when
generating its name, we concatenate an incrementing ID to the end of the
name to guarantee uniqueness.

Related to ASTERISK~28231

Change-Id: I02ee9f4073b6abca9169d30c47aa69b5e8ae9afb
res/res_pjsip/pjsip_transport_management.c
res/res_pjsip_transport_websocket.c