BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJSIP Reference

pjsip_tpselector Struct Reference

#include <sip_transport.h>

Data Fields

pjsip_tpselector_type type
 
pj_bool_t disable_connection_reuse
 
union {
   pjsip_transport *   transport
 
   pjsip_tpfactory *   listener
 
   void *   ptr
 
u
 

Detailed Description

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.

Field Documentation

◆ type

pjsip_tpselector_type pjsip_tpselector::type

The type of data in the union

◆ disable_connection_reuse

pj_bool_t pjsip_tpselector::disable_connection_reuse

Whether to disable reuse of an existing connection. This setting will be ignored if (type == PJSIP_TPSELECTOR_TRANSPORT) and transport in the union below is set.

◆ 

union { ... } pjsip_tpselector::u

Union representing the transport/listener criteria to be used.


The documentation for this struct was generated from the following file:

 


PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.