This structure describes the transport/listener preference to be used when sending outgoing requests.
Normally transport will be selected automatically according to rules about sending requests. But some applications (such as proxies or B2BUAs) may want to explicitly use specific transport to send requests, for example when they want to make sure that outgoing request should go from a specific network interface.
The pjsip_tpselector structure is used for that purpose, i.e. to allow application specificly request that a particular transport/listener should be used to send request. This structure is used when calling pjsip_tsx_set_transport() and pjsip_dlg_set_transport().
If application disables connection reuse and wants to force creating a new transport, it needs to consider the following couple of things:
- If it still wants to reuse an existing transport (if any), it needs to keep a reference to that transport and specifically set the transport to be used for sending requests.
- Delete those existing transports manually when no longer needed.