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_config Struct Reference
[PJSUA-API Basic API]

#include <pjsua.h>


Detailed Description

This structure describes the settings to control the API and user agent behavior, and can be specified when calling pjsua_init(). Before setting the values, application must call pjsua_config_default() to initialize this structure with the default values.

Python Sample Syntax:
The pjsua_config type in Python is py_pjsua.Config. Application creates the instance by calling py_pjsua.config_default():
    cfg = py_pjsua.config_default()

Data Fields

unsigned max_calls
unsigned thread_cnt
unsigned nameserver_count
pj_str_t nameserver [4]
pj_bool_t force_lr
unsigned outbound_proxy_cnt
pj_str_t outbound_proxy [4]
pj_str_t stun_domain
pj_str_t stun_host
int nat_type_in_sdp
pj_bool_t require_100rel
unsigned cred_count
pjsip_cred_info cred_info [8]
pjsua_callback cb
pj_str_t user_agent
pjmedia_srtp_use use_srtp
int srtp_secure_signaling
pj_bool_t hangup_forked_call

Field Documentation

Maximum calls to support (default: 4). The value specified here must be smaller than the compile time maximum settings PJSUA_MAX_CALLS, which by default is 32. To increase this limit, the library must be recompiled with new PJSUA_MAX_CALLS value.

Number of worker threads. Normally application will want to have at least one worker thread, unless when it wants to poll the library periodically, which in this case the worker thread can be set to zero.

Number of nameservers. If no name server is configured, the SIP SRV resolution would be disabled, and domain will be resolved with standard pj_gethostbyname() function.

Array of nameservers to be used by the SIP resolver subsystem. The order of the name server specifies the priority (first name server will be used first, unless it is not reachable).

Force loose-route to be used in all route/proxy URIs (outbound_proxy and account's proxy settings). When this setting is enabled, the library will check all the route/proxy URIs specified in the settings and append ";lr" parameter to the URI if the parameter is not present.

Default: 1

Number of outbound proxies in the outbound_proxy array.

Specify the URL of outbound proxies to visit for all outgoing requests. The outbound proxies will be used for all accounts, and it will be used to build the route set for outgoing requests. The final route set for outgoing requests will consists of the outbound proxies and the proxy configured in the account.

Specify domain name to be resolved with DNS SRV resolution to get the address of the STUN server. Alternatively application may specify stun_host instead.

If DNS SRV resolution failed for this domain, then DNS A resolution will be performed only if stun_host is specified.

Specify STUN server to be used, in "HOST[:PORT]" format. If port is not specified, default port 3478 will be used.

Support for adding and parsing NAT type in the SDP to assist troubleshooting. The valid values are:

  • 0: no information will be added in SDP, and parsing is disabled.
  • 1: only the NAT type number is added.
  • 2: add both NAT type number and name.

Default: 1

Specify whether support for reliable provisional response (100rel and PRACK) should be required by default. Note that this setting can be further customized in account configuration (pjsua_acc_config).

Default: PJ_FALSE

Number of credentials in the credential array.

Array of credentials. These credentials will be used by all accounts, and can be used to authenticate against outbound proxies. If the credential is specific to the account, then application should set the credential in the pjsua_acc_config rather than the credential here.

Application callback to receive various event notifications from the library.

Optional user agent string (default empty). If it's empty, no User-Agent header will be sent with outgoing requests.

Specify default value of secure media transport usage. Valid values are PJMEDIA_SRTP_DISABLED, PJMEDIA_SRTP_OPTIONAL, and PJMEDIA_SRTP_MANDATORY.

Note that this setting can be further customized in account configuration (pjsua_acc_config).

Default: PJSUA_DEFAULT_USE_SRTP

Specify whether SRTP requires secure signaling to be used. This option is only used when use_srtp option above is non-zero.

Valid values are: 0: SRTP does not require secure signaling 1: SRTP requires secure transport such as TLS 2: SRTP requires secure end-to-end transport (SIPS)

Note that this setting can be further customized in account configuration (pjsua_acc_config).

Default: PJSUA_DEFAULT_SRTP_SECURE_SIGNALING

Disconnect other call legs when more than one 2xx responses for outgoing INVITE are received due to forking. Currently the library is not able to handle simultaneous forked media, so disconnecting the other call legs is necessary.

With this setting enabled, the library will handle only one of the connected call leg, and the other connected call legs will be disconnected.

Default: PJ_TRUE (only disable this setting for testing purposes).


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

 


PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
(C)2003-2008 Benny Prijono