BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJSIP Reference

pjsip_transport Struct Reference

#include <sip_transport.h>

Data Fields

char obj_name [PJ_MAX_OBJ_NAME]
 
pj_pool_tpool
 
pj_atomic_tref_cnt
 
pj_lock_tlock
 
pj_grp_lock_tgrp_lock
 
pj_bool_t tracing
 
pj_bool_t is_shutdown
 
pj_bool_t is_destroying
 
pjsip_transport_key key
 
char * type_name
 
unsigned flag
 
char * info
 
int addr_len
 
pj_sockaddr local_addr
 
pjsip_host_port local_name
 
pjsip_host_port remote_name
 
pjsip_transport_dir dir
 
pjsip_endpointendpt
 
pjsip_tpmgrtpmgr
 
pjsip_tpfactoryfactory
 
pj_timer_entry idle_timer
 
pj_timestamp last_recv_ts
 
pj_size_t last_recv_len
 
void * data
 
pj_status_t(* send_msg )(pjsip_transport *transport, pjsip_tx_data *tdata, const pj_sockaddr_t *rem_addr, int addr_len, void *token, pjsip_transport_callback callback)
 
pj_status_t(* do_shutdown )(pjsip_transport *transport)
 
pj_status_t(* destroy )(pjsip_transport *transport)
 

Detailed Description

This structure represent the "public" interface of a SIP transport. Applications normally extend this structure to include transport specific members.

Forward declaration for SIP transport.

Field Documentation

◆ obj_name

char pjsip_transport::obj_name[PJ_MAX_OBJ_NAME]

Name.

◆ pool

pj_pool_t* pjsip_transport::pool

Pool used by transport.

◆ ref_cnt

pj_atomic_t* pjsip_transport::ref_cnt

Reference counter.

◆ lock

pj_lock_t* pjsip_transport::lock

Lock object.

◆ grp_lock

pj_grp_lock_t* pjsip_transport::grp_lock

Group lock for sync with ioqueue and timer.

◆ tracing

pj_bool_t pjsip_transport::tracing

Tracing enabled?

◆ is_shutdown

pj_bool_t pjsip_transport::is_shutdown

Being shutdown?

◆ is_destroying

pj_bool_t pjsip_transport::is_destroying

Destroy in progress?

◆ key

pjsip_transport_key pjsip_transport::key

Key for indexing this transport in hash table.

◆ type_name

char* pjsip_transport::type_name

Type name.

◆ flag

unsigned pjsip_transport::flag

◆ info

char* pjsip_transport::info

Transport info/description.

◆ addr_len

int pjsip_transport::addr_len

Length of addresses.

◆ local_addr

pj_sockaddr pjsip_transport::local_addr

Bound address.

◆ local_name

pjsip_host_port pjsip_transport::local_name

Published name (eg. STUN).

◆ remote_name

pjsip_host_port pjsip_transport::remote_name

Remote address name.

◆ dir

pjsip_transport_dir pjsip_transport::dir

Connection direction.

◆ endpt

pjsip_endpoint* pjsip_transport::endpt

Endpoint instance.

◆ tpmgr

pjsip_tpmgr* pjsip_transport::tpmgr

Transport manager.

◆ factory

pjsip_tpfactory* pjsip_transport::factory

Factory instance. Note: it may be invalid/shutdown.

◆ idle_timer

pj_timer_entry pjsip_transport::idle_timer

Timer when ref cnt is zero.

◆ last_recv_ts

pj_timestamp pjsip_transport::last_recv_ts

Last time receiving data.

◆ last_recv_len

pj_size_t pjsip_transport::last_recv_len

Last received data length.

◆ data

void* pjsip_transport::data

Internal transport data.

◆ send_msg

pj_status_t(* pjsip_transport::send_msg) (pjsip_transport *transport, pjsip_tx_data *tdata, const pj_sockaddr_t *rem_addr, int addr_len, void *token, pjsip_transport_callback callback)

Function to be called by transport manager to send SIP message.

Parameters
transportThe transport to send the message.
packetThe buffer to send.
lengthThe length of the buffer to send.
op_keyCompletion token, which will be supplied to caller when pending send operation completes.
rem_addrThe remote destination address.
addr_lenSize of remote address.
callbackIf supplied, the callback will be called once a pending transmission has completed. If the function completes immediately (i.e. return code is not PJ_EPENDING), the callback will not be called.
Returns
Should return PJ_SUCCESS only if data has been succesfully queued to operating system for transmission. Otherwise it may return PJ_EPENDING if the underlying transport can not send the data immediately and will send it later, which in this case caller doesn't have to do anything except wait the calback to be called, if it supplies one. Other return values indicate the error code.

◆ do_shutdown

pj_status_t(* pjsip_transport::do_shutdown) (pjsip_transport *transport)

Instruct the transport to initiate graceful shutdown procedure. After all objects release their reference to this transport, the transport will be deleted.

Note that application MUST use pjsip_transport_shutdown() instead.

Parameters
transportThe transport.
Returns
PJ_SUCCESS on success.

◆ destroy

pj_status_t(* pjsip_transport::destroy) (pjsip_transport *transport)

Forcefully destroy this transport regardless whether there are objects that currently use this transport. This function should only be called by transport manager or other internal objects (such as the transport itself) who know what they're doing. Application should use pjsip_transport_shutdown() instead.

Parameters
transportThe transport.
Returns
PJ_SUCCESS on success.

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.