Home --> Documentations --> PJSIP Reference
API for managing SIP transports.
More...
|
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_tpfactory_register (pjsip_tpfactory *tf, 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) |
|
pj_status_t | pjsua_transport_lis_start (pjsua_transport_id id, const pjsua_transport_config *cfg) |
|
PJSUA-API supports creating multiple transport instances, for example UDP, TCP, and TLS transport. SIP transport must be created before adding an account.
◆ pjsua_transport_id
SIP transport identification.
◆ pjsua_transport_config_default()
Call this function to initialize UDP config with default values.
- Parameters
-
cfg | The UDP config to be initialized. |
◆ pjsua_transport_config_dup()
Duplicate transport config.
- Parameters
-
pool | The pool. |
dst | The destination config. |
src | The source config. |
◆ pjsua_transport_create()
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.
◆ pjsua_transport_register()
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.
◆ pjsua_tpfactory_register()
Register transport factory that has been created by application. This function is useful if application wants to implement custom SIP transport and use it with pjsua.
- Parameters
-
tf | Transport factory instance. |
p_id | Optional pointer to receive transport ID. |
- Returns
- PJ_SUCCESS on success, or the appropriate error code.
◆ pjsua_enum_transports()
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.
◆ pjsua_transport_get_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.
◆ pjsua_transport_set_enable()
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.
◆ pjsua_transport_close()
Close the transport. 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.
NOTE: Forcefully closing transport (force = PJ_TRUE) is deprecated, since any pending transactions that are using the transport may not terminate properly and can even crash. Application wishing to immediately close the transport for the purpose of restarting it should use pjsua_handle_ip_change() instead.
- Parameters
-
id | Transport ID. |
force | Must be PJ_FALSE. force = PJ_TRUE is deprecated. |
- Returns
- PJ_SUCCESS on success, or the appropriate error code.
◆ pjsua_transport_lis_start()
Start the listener of the transport. This is useful when listener is not automatically started when creating the transport.
- Parameters
-
id | Transport ID. |
cfg | The new transport config used by the listener. Only port, public_addr and bound_addr are used at the moment. |
- 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.
|