pjsip logo pjsip.org
Open source SIP stack and media stack for presence, im/instant messaging, and multimedia communication

HOME

SIP/media Features
High Performance SIP
Small Footprint SIP
Symbian Port

FAQ

Documentation

Licensing

Download

Development (Trac)

Projects using pjsip

Mailing List

Open Source Links


About: PJLIB, PJLIB-UTIL, PJSIP, and PJMEDIA are created by: Benny Prijono
<bennylp@pjsip.org>


 

Home --> Documentations --> PJSIP Reference

PJSUA-API Signaling Transport
[PJSUA API - High Level Softphone API]


Detailed Description

PJSUA-API supports creating multiple transport instances, for example UDP, TCP, and TLS transport. SIP transport must be created before adding an account.


Data Structures

struct  pjsua_transport_config
struct  pjsua_transport_info

Typedefs

typedef int pjsua_transport_id

Functions

void pjsua_transport_config_default (pjsua_transport_config *cfg)
void pjsua_transport_config_dup (pj_pool_t *pool, pjsua_transport_config *dst, const pjsua_transport_config *src)
pj_status_t pjsua_transport_create (pjsip_transport_type_e type, const pjsua_transport_config *cfg, pjsua_transport_id *p_id)
pj_status_t pjsua_transport_register (pjsip_transport *tp, pjsua_transport_id *p_id)
pj_status_t pjsua_enum_transports (pjsua_transport_id id[], unsigned *count)
pj_status_t pjsua_transport_get_info (pjsua_transport_id id, pjsua_transport_info *info)
pj_status_t pjsua_transport_set_enable (pjsua_transport_id id, pj_bool_t enabled)
pj_status_t pjsua_transport_close (pjsua_transport_id id, pj_bool_t force)


Typedef Documentation

SIP transport identification.


Function Documentation

void pjsua_transport_config_default ( pjsua_transport_config cfg  ) 

Call this function to initialize UDP config with default values.

Parameters:
cfg The UDP config to be initialized.

void pjsua_transport_config_dup ( pj_pool_t pool,
pjsua_transport_config dst,
const pjsua_transport_config src 
)

Duplicate transport config.

Parameters:
pool The pool.
dst The destination config.
src The source config.

pj_status_t pjsua_transport_create ( pjsip_transport_type_e  type,
const pjsua_transport_config cfg,
pjsua_transport_id p_id 
)

Create and start a new SIP transport according to the specified settings.

Parameters:
type Transport type.
cfg Transport configuration.
p_id Optional pointer to receive transport ID.
Returns:
PJ_SUCCESS on success, or the appropriate error code.

pj_status_t pjsua_transport_register ( pjsip_transport tp,
pjsua_transport_id p_id 
)

Register transport that has been created by application. This function is useful if application wants to implement custom SIP transport and use it with pjsua.

Parameters:
tp Transport instance.
p_id Optional pointer to receive transport ID.
Returns:
PJ_SUCCESS on success, or the appropriate error code.

pj_status_t pjsua_enum_transports ( pjsua_transport_id  id[],
unsigned *  count 
)

Enumerate all transports currently created in the system. This function will return all transport IDs, and application may then call pjsua_transport_get_info() function to retrieve detailed information about the transport.

Parameters:
id Array to receive transport ids.
count In input, specifies the maximum number of elements. On return, it contains the actual number of elements.
Returns:
PJ_SUCCESS on success, or the appropriate error code.

pj_status_t pjsua_transport_get_info ( pjsua_transport_id  id,
pjsua_transport_info info 
)

Get information about transports.

Parameters:
id Transport ID.
info Pointer to receive transport info.
Returns:
PJ_SUCCESS on success, or the appropriate error code.

pj_status_t pjsua_transport_set_enable ( pjsua_transport_id  id,
pj_bool_t  enabled 
)

Disable a transport or re-enable it. By default transport is always enabled after it is created. Disabling a transport does not necessarily close the socket, it will only discard incoming messages and prevent the transport from being used to send outgoing messages.

Parameters:
id Transport ID.
enabled Non-zero to enable, zero to disable.
Returns:
PJ_SUCCESS on success, or the appropriate error code.

pj_status_t pjsua_transport_close ( pjsua_transport_id  id,
pj_bool_t  force 
)

Close the transport. If transport is forcefully closed, it will be immediately closed, and any pending transactions that are using the transport may not terminate properly (it may even crash). Otherwise, the system will wait until all transactions are closed while preventing new users from using the transport, and will close the transport when it is safe to do so.

Parameters:
id Transport ID.
force Non-zero to immediately close the transport. This is not recommended!
Returns:
PJ_SUCCESS on success, or the appropriate error code.

 


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