BLOG | DOCUMENTATION | TRAC

Home --> Documentations --> PJSIP Reference

pjsip_tx_data Struct Reference

#include <sip_transport.h>

Public Member Functions

 PJ_DECL_LIST_MEMBER (struct pjsip_tx_data)
 

Data Fields

pj_pool_tpool
 
char obj_name [PJ_MAX_OBJ_NAME]
 
char * info
 
pj_time_val rx_timestamp
 
pjsip_tpmgrmgr
 
pjsip_tx_data_op_key op_key
 
pj_lock_tlock
 
pjsip_msgmsg
 
pjsip_route_hdrsaved_strict_route
 
pjsip_buffer buf
 
pj_atomic_tref_cnt
 
int is_pending
 
void * token
 
void(* cb )(void *, pjsip_tx_data *, pj_ssize_t)
 
struct {
   pj_str_t   name
 
   pjsip_server_addresses   addr
 
   unsigned   cur_addr
 
dest_info
 
struct {
   pjsip_transport *   transport
 
   pj_sockaddr   dst_addr
 
   int   dst_addr_len
 
   char   dst_name [PJ_INET6_ADDRSTRLEN]
 
   int   dst_port
 
tp_info
 
pjsip_tpselector tp_sel
 
pj_bool_t auth_retry
 
void * mod_data [PJSIP_MAX_MODULE]
 
pjsip_host_port via_addr
 
const void * via_tp
 

Detailed Description

Data structure for sending outgoing message. Application normally creates this buffer by calling pjsip_endpt_create_tdata.

The lifetime of this buffer is controlled by the reference counter in this structure, which is manipulated by calling pjsip_tx_data_add_ref and pjsip_tx_data_dec_ref. When the reference counter has reached zero, then this buffer will be destroyed.

A transaction object normally will add reference counter to this buffer when application calls pjsip_tsx_send_msg, because it needs to keep the message for retransmission. The transaction will release the reference counter once its state has reached final state.

Forward declaration for transmit data/buffer (sip_transport.h).

Member Function Documentation

◆ PJ_DECL_LIST_MEMBER()

pjsip_tx_data::PJ_DECL_LIST_MEMBER ( struct pjsip_tx_data  )

This is for transmission queue; it's managed by transports.

Field Documentation

◆ pool

pj_pool_t* pjsip_tx_data::pool

Memory pool for this buffer.

◆ obj_name

char pjsip_tx_data::obj_name[PJ_MAX_OBJ_NAME]

A name to identify this buffer.

◆ info

char* pjsip_tx_data::info

Short information describing this buffer and the message in it. Application should use pjsip_tx_data_get_info() instead of directly accessing this member.

◆ rx_timestamp

pj_time_val pjsip_tx_data::rx_timestamp

For response message, this contains the reference to timestamp when the original request message was received. The value of this field is set when application creates response message to a request by calling pjsip_endpt_create_response.

◆ mgr

pjsip_tpmgr* pjsip_tx_data::mgr

The transport manager for this buffer.

◆ op_key

pjsip_tx_data_op_key pjsip_tx_data::op_key

Ioqueue asynchronous operation key.

◆ lock

pj_lock_t* pjsip_tx_data::lock

Lock object.

◆ msg

pjsip_msg* pjsip_tx_data::msg

The message in this buffer.

◆ saved_strict_route

pjsip_route_hdr* pjsip_tx_data::saved_strict_route

Strict route header saved by pjsip_process_route_set(), to be restored by pjsip_restore_strict_route_set().

◆ buf

pjsip_buffer pjsip_tx_data::buf

Buffer to the printed text representation of the message. When the content of this buffer is set, then the transport will send the content of this buffer instead of re-printing the message structure. If the message structure has changed, then application must invalidate this buffer by calling pjsip_tx_data_invalidate_msg.

◆ ref_cnt

pj_atomic_t* pjsip_tx_data::ref_cnt

Reference counter.

◆ is_pending

int pjsip_tx_data::is_pending

Being processed by transport?

◆ token

void* pjsip_tx_data::token

Transport manager internal.

◆ cb

void(* pjsip_tx_data::cb) (void *, pjsip_tx_data *, pj_ssize_t)

Callback to be called when this tx_data has been transmitted.

◆ name

pj_str_t pjsip_tx_data::name

Server name.

◆ addr

pjsip_server_addresses pjsip_tx_data::addr

Server addresses resolved.

◆ cur_addr

unsigned pjsip_tx_data::cur_addr

Current server address being tried.

◆ dest_info

struct { ... } pjsip_tx_data::dest_info

Destination information, to be used to determine the network address of the message. For a request, this information is initialized when the request is sent with pjsip_endpt_send_request_stateless() and network address is resolved. For CANCEL request, this information will be copied from the original INVITE to make sure that the CANCEL request goes to the same physical network address as the INVITE request.

◆ transport

pjsip_transport* pjsip_tx_data::transport

Transport being used.

◆ dst_addr

pj_sockaddr pjsip_tx_data::dst_addr

Destination address.

◆ dst_addr_len

int pjsip_tx_data::dst_addr_len

Length of address.

◆ dst_name

char pjsip_tx_data::dst_name[PJ_INET6_ADDRSTRLEN]

Destination address.

◆ dst_port

int pjsip_tx_data::dst_port

Destination port.

◆ tp_info

struct { ... } pjsip_tx_data::tp_info

Transport information, only valid during on_tx_request() and on_tx_response() callback.

◆ tp_sel

pjsip_tpselector pjsip_tx_data::tp_sel

Transport selector, to specify which transport to be used. The value here must be set with pjsip_tx_data_set_transport(), to allow reference counter to be set properly.

◆ auth_retry

pj_bool_t pjsip_tx_data::auth_retry

Special flag to indicate that this transmit data is a request that has been updated with proper authentication response and is ready to be sent for retry.

◆ mod_data

void* pjsip_tx_data::mod_data[PJSIP_MAX_MODULE]

Arbitrary data attached by PJSIP modules.

◆ via_addr

pjsip_host_port pjsip_tx_data::via_addr

If via_addr is set, it will be used as the "sent-by" field of the Via header for outgoing requests as long as the request uses via_tp transport. Normally application should not use or access these fields. Via address.

◆ via_tp

const void* pjsip_tx_data::via_tp

Via transport.


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.