Group PJSIP_CONFIG

group PJSIP_CONFIG

PJSIP compile time configurations.

Defines

PJSIP_MAX_TSX_COUNT

Specify maximum transaction count in transaction hash table. For efficiency, the value should be 2^n-1 since it will be rounded up to 2^n.

Default value is 1023

PJSIP_MAX_DIALOG_COUNT

Specify maximum number of dialogs in the dialog hash table. For efficiency, the value should be 2^n-1 since it will be rounded up to 2^n.

Default value is 511.

PJSIP_MAX_TRANSPORTS

Specify maximum number of transports. Default value is equal to maximum number of handles in ioqueue. See also PJSIP_TPMGR_HTABLE_SIZE.

PJSIP_TPMGR_HTABLE_SIZE

Transport manager hash table size (must be 2^n-1). See also PJSIP_MAX_TRANSPORTS

PJSIP_MAX_URL_SIZE

Specify maximum URL size.

PJSIP_MAX_MODULE

Specify maximum number of modules. This mainly affects the size of mod_data array in various components.

PJSIP_MAX_PKT_LEN

Maximum packet length. We set it more than MTU since a SIP PDU containing presence information can be quite large (>1500).

PJSIP_DONT_SWITCH_TO_TCP

RFC 3261 section 18.1.1: If a request is within 200 bytes of the path MTU, or if it is larger than 1300 bytes and the path MTU is unknown, the request MUST be sent using an RFC 2914 [43] congestion controlled transport protocol, such as TCP.

Disable the behavior of automatic switching to TCP whenever UDP packet size exceeds the threshold defined in PJSIP_UDP_SIZE_THRESHOLD.

This option can also be controlled at run-time by the disable_tcp_switch setting in pjsip_cfg_t.

Default is 0 (no).

PJSIP_DONT_SWITCH_TO_TLS

As specified RFC 3261 section 8.1.2, when request-URI uses “sips” scheme, TLS must always be used regardless of the target-URI scheme or transport type. Update: Newer RFCs, such as RFC 5630 and 7118, expands this by allowing the use of other transports as long as the SIP resource designated by the target SIPS URI is contacted securely.

This option will specify whether the behavior of automatic switching to secure transport (such as TLS) should be disabled, i.e: regard the target-URI scheme or transport type.

This option can also be controlled at run-time by the disable_tls_switch setting in pjsip_cfg_t.

Default is 0 (no).

PJSIP_HANDLE_EVENTS_HAS_SLEEP_ON_ERR

Specify if pjsip_endpt_handle_events() should sleep if ioqueue poll returns error.

Default is 1 (yes).

PJSIP_FOLLOW_EARLY_MEDIA_FORK

Specify whether the call media session should be updated to the latest received early media SDP when receiving forked early media (multiple 183 responses with different To tag).

This option can also be controlled at run-time by the follow_early_media_fork setting in pjsip_cfg_t.

Default is PJ_TRUE.

PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS

Accept multiple SDP answers on non-reliable 18X responses and the 2XX response when they are all received from the same source (same To tag).

This option can also be controlled at run-time by the accept_multiple_sdp_answers setting in pjsip_cfg_t.

Default is PJ_TRUE.

PJSIP_REQ_HAS_VIA_ALIAS

Specify whether “alias” param should be added to the Via header in any outgoing request with connection oriented transport.

This option can also be controlled at run-time by the req_has_via_alias setting in pjsip_cfg_t.

Default is PJ_TRUE.

PJSIP_RESOLVE_HOSTNAME_TO_GET_INTERFACE

Resolve hostname when trying to get the network interface to be put in Via or Contact header.

This option can also be controlled at run-time by the resolve_hostname_to_get_interface setting in pjsip_cfg_t.

Default is PJ_FALSE.

PJSIP_ACCEPT_REPLACE_IN_EARLY_STATE

Accept call replace in early state when invite is not initiated by the user agent. RFC 3891 Section 3 disallows this, however, for better interoperability reason, this might be ignored.

This option can also be controlled at run-time by the accept_replace_in_early_state setting in pjsip_cfg_t.

Default is 0 (no).

PJSIP_UDP_SIZE_THRESHOLD

This setting controls the threshold of the UDP packet, which if it’s larger than this value the request will be sent with TCP. This setting is useful only when PJSIP_DONT_SWITCH_TO_TCP is set to 0.

Default is 1300 bytes.

PJSIP_ENCODE_SHORT_HNAME

Encode SIP headers in their short forms to reduce size. By default, SIP headers in outgoing messages will be encoded in their full names. If this option is enabled, then SIP headers for outgoing messages will be encoded in their short forms, to reduce message size. Note that this does not affect the ability of PJSIP to parse incoming SIP messages, as the parser always supports parsing both the long and short version of the headers.

This option can also be controlled at run-time by the use_compact_form setting in pjsip_cfg_t.

Default is 0 (no)

PJSIP_INCLUDE_ALLOW_HDR_IN_DLG

Send Allow header in dialog establishing requests? RFC 3261 Allow header SHOULD be included in dialog establishing requests to inform remote agent about which SIP requests are allowed within dialog.

Note that there is also an undocumented variable defined in sip_dialog.c to control whether Allow header should be included. The default value of this variable is PJSIP_INCLUDE_ALLOW_HDR_IN_DLG. To change PJSIP behavior during run-time, application can use the following construct:

  extern pj_bool_t pjsip_include_allow_hdr_in_dlg;

  // do not transmit Allow header
  pjsip_include_allow_hdr_in_dlg = PJ_FALSE;

Default is 1 (Yes)

PJSIP_SAFE_MODULE

Allow SIP modules removal or insertions during operation? If yes, then locking will be employed when endpoint need to access module.

PJSIP_CHECK_VIA_SENT_BY

Perform Via sent-by checking as specified in RFC 3261 Section 18.1.2, which says that UAC MUST silently discard responses with Via sent-by containing values that the UAC doesn’t recognize as its transport address.

In PJSIP, this will cause response to be discarded and a message is written to the log, saying something like: “Dropping response Response msg 200/INVITE/cseq=608594373 (rdata00A99EF4)

from 1.2.3.4:5060 because sent-by is mismatch”

The default behavior is yes, but when the UA supports IP address change for the SIP transport, it will need to turn this checking off since when the transport address is changed between request is sent and response is received, the response will be discarded since its Via sent-by now contains address that is different than the transport address.

Update: As of version 2.1, the default value is 0. This change was part of https://github.com/pjsip/pjproject/issues/1412

PJSIP_UNESCAPE_IN_PLACE

If non-zero, SIP parser will unescape the escape characters (‘’) in the original message, which means that it will modify the original message. Otherwise the parser will create a copy of the string and store the unescaped string to the new location.

Unescaping in-place is faster, but less elegant (and it may break certain applications). So normally it’s disabled, unless when benchmarking (to show off big performance).

Default: 0

PJSIP_ALLOW_PORT_IN_FROMTO_HDR

Specify port number should be allowed to appear in To and From header. Note that RFC 3261 disallow this, see Table 1 in section 19.1.1 of the RFC. This setting can also be altered at run-time via pjsip_cfg setting, see pjsip_cfg_t.allow_port_in_fromto_hdr field.

Default: 0

PJSIP_MAX_NET_EVENTS

This macro controls maximum numbers of ioqueue events to be processed in a single pjsip_endpt_handle_events() poll. When PJSIP detects that there are probably more events available from the network and total events so far is less than this value, PJSIP will call pj_ioqueue_poll() again to get more events.

Value 1 works best for ioqueue with select() back-end, while for IOCP it is probably best to set this value equal to PJSIP_MAX_TIMED_OUT_ENTRIES since IOCP only processes one event at a time.

Default: 1

PJSIP_MAX_TIMED_OUT_ENTRIES

Max entries to process in timer heap per poll.

Default: 10

PJSIP_TRANSPORT_IDLE_TIME

Idle timeout interval to be applied to outgoing transports (i.e. client side) with no usage before the transport is destroyed. Value is in seconds.

Note that if the value is put lower than 33 seconds, it may cause some pjsip test units to fail. See the comment on the following link: https://github.com/pjsip/pjproject/issues/1465#comment:4

Default: 33

PJSIP_TRANSPORT_SERVER_IDLE_TIME

Idle timeout interval to be applied to incoming transports (i.e. server side) with no usage before the transport is destroyed. Server typically should let client close the connection, hence set this interval to a large value. Value is in seconds.

Default: 600

PJSIP_TRANSPORT_SERVER_IDLE_TIME_FIRST

The initial timeout interval for incoming TCP/TLS transports (i.e. server side) in the event that no valid SIP message is received following a successful connection. The value is in seconds. Disable the timeout by setting it to 0.

Note that even if this is disabled, the connection might still get closed when it is idle or not referred anymore. Have a look at PJSIP_TRANSPORT_SERVER_IDLE_TIME.

Notes:

  • keep-alive packet is not considered as a valid message.

Default: 0

PJSIP_MAX_TRANSPORT_USAGE

Maximum number of usages for a transport before a new transport is created. This only applies for ephemeral transports such as TCP.

Currently this is not used.

Default: -1

PJSIP_TCP_TRANSPORT_BACKLOG

The TCP incoming connection backlog number to be set in accept().

Default: 5

PJSIP_TCP_TRANSPORT_REUSEADDR

Specify whether TCP listener should use SO_REUSEADDR option. This constant will be used as the default value for the “reuse_addr” field in the pjsip_tcp_transport_cfg structure.

Default is 0 on Windows and 1 on non-Windows.

PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER

Specify whether TCP transport should skip creating the listener. Not having a listener means that application will not be able to function in server mode and accept incoming connections.

When enabling this setting, if you use PJSUA, it is recommended to set pjsua_acc_config.contact_use_src_port to PJ_TRUE. Warning: If contact_use_src_port is disabled or failed (because it’s unsupported in some platforms or automatically turned off due to DNS server resolution), Contact header will be generated from pj_getipinterface()/pj_gethostip(), but the address will not be able to accept connections.

Default is 0 (listener will be created).

PJSIP_TLS_TRANSPORT_DONT_CREATE_LISTENER

Specify whether TLS transport should skip creating the listener. Not having a listener means that application will not be able to function in server mode and accept incoming connections.

When enabling this setting, if you use PJSUA, it is recommended to set pjsua_acc_config.contact_use_src_port to PJ_TRUE. Warning: If contact_use_src_port is disabled or failed (because it’s unsupported in some platforms or automatically turned off due to DNS server resolution), Contact header will be generated from pj_getipinterface()/pj_gethostip(), but the address will not be able to accept connections.

Default is 0 (listener will be created).

PJSIP_TCP_KEEP_ALIVE_INTERVAL

Set the interval to send keep-alive packet for TCP transports. If the value is zero, keep-alive will be disabled for TCP.

This option can be changed in run-time by settting tcp.keep_alive_interval field of pjsip_cfg().

Default: 90 (seconds)

PJSIP_TCP_KEEP_ALIVE_DATA

Set the payload of the TCP keep-alive packet.

Default: CRLF

PJSIP_TCP_INITIAL_TIMEOUT

The initial timeout interval for incoming TCP transports (i.e. server side) in the event that no valid SIP message is received following a successful connection. The value is in seconds. Disable the timeout by setting it to 0.

Note that even if this is disabled, the connection might still get closed when it is idle or not referred anymore. Have a look at PJSIP_TRANSPORT_SERVER_IDLE_TIME.

Notes:

  • keep-alive packet is not considered as a valid message.

  • This macro is specific to TCP usage and takes precedence over a\ PJSIP_TRANSPORT_SERVER_IDLE_TIME_FIRST when both are set.

Default: 0 (disabled)

PJSIP_TLS_KEEP_ALIVE_INTERVAL

Set the interval to send keep-alive packet for TLS transports. If the value is zero, keep-alive will be disabled for TLS.

This option can be changed in run-time by settting tls.keep_alive_interval field of pjsip_cfg().

Default: 90 (seconds)

PJSIP_TLS_KEEP_ALIVE_DATA

Set the payload of the TLS keep-alive packet.

Default: CRLF

PJSIP_HAS_RESOLVER

This macro specifies whether full DNS resolution should be used. When enabled, pjsip_resolve() will perform asynchronous DNS SRV and A (or AAAA, when IPv6 is supported) resolution to resolve the SIP domain.

Note that even when this setting is enabled, asynchronous DNS resolution will only be done when application calls pjsip_endpt_create_resolver(), configure the nameservers with pj_dns_resolver_set_ns(), and configure the SIP endpoint’s DNS resolver with pjsip_endpt_set_resolver(). If these steps are not followed, the domain will be resolved with normal pj_gethostbyname() function.

Turning off this setting will save the footprint by about 16KB, since it should also exclude dns.o and resolve.o from PJLIB-UTIL.

Default: 1 (enabled)

PJSIP_MAX_RESOLVED_ADDRESSES

Maximum number of addresses returned by the resolver. The number here will slightly affect stack usage, since each entry will occupy about 32 bytes of stack memory.

Default: 16 (or 32 if IPv6 support is enabled)

PJSIP_HAS_TLS_TRANSPORT

Enable TLS SIP transport support. For most systems this means that OpenSSL must be installed.

Default: follow PJ_HAS_SSL_SOCK setting, which is 0 (disabled) by default.

PJSIP_TLS_TRANSPORT_BACKLOG

The TLS pending incoming connection backlog number to be set in accept().

Default: 5

PJSIP_TLS_TRANSPORT_REUSEADDR

Specify whether TLS listener should use SO_REUSEADDR option.

Default is 0 on Windows and 1 on non-Windows.

PJSIP_DLG_EVENT_DEFAULT_EXPIRES

Specify the default expiration time for dialog event subscription.

Default: 600 seconds (10 minutes)

PJSIP_MAX_TIMER_COUNT

Specify the maximum number of timer entries initially allocated by endpoint. If the application registers more entries during runtime, then the timer will automatically resize.

Default: (2*pjsip_cfg()->tsx.max_count) + (2*PJSIP_MAX_DIALOG_COUNT)

PJSIP_POOL_LEN_ENDPT

Initial memory block for the endpoint.

PJSIP_POOL_INC_ENDPT

Memory increment for endpoint.

PJSIP_POOL_RDATA_LEN

Initial memory block for rdata.

PJSIP_POOL_RDATA_INC

Memory increment for rdata.

PJSIP_POOL_LEN_TRANSPORT

Initial memory block for SIP transport.

PJSIP_POOL_INC_TRANSPORT

Memory increment for SIP transport.

PJSIP_POOL_LEN_TDATA

Initial memory block size for tdata.

PJSIP_POOL_INC_TDATA

Memory increment for tdata.

PJSIP_POOL_LEN_UA

Initial memory size for UA layer

PJSIP_POOL_INC_UA

Memory increment for UA layer.

PJSIP_POOL_EVSUB_LEN

Initial memory block for event subscription module.

PJSIP_POOL_EVSUB_INC

Memory increment for event subscription module.

PJSIP_MAX_FORWARDS_VALUE

Default value for Max-Forwards header

PJSIP_RFC3261_BRANCH_ID

Via branch parameter prefix

PJSIP_RFC3261_BRANCH_LEN

Length of PJSIP_RFC3261_BRANCH_ID

PJSIP_POOL_TSX_LAYER_LEN

Initial memory size for transaction layer. The bulk of pool usage for transaction layer will be used to create the hash table, so setting this value too high will not help too much with reducing fragmentation and the memory will most likely be wasted.

PJSIP_POOL_TSX_LAYER_INC

Memory increment for transaction layer. The bulk of pool usage for transaction layer will be used to create the hash table, so setting this value too high will not help too much with reducing fragmentation and the memory will most likely be wasted.

PJSIP_POOL_TSX_LEN

Initial memory size for a SIP transaction object.

PJSIP_POOL_TSX_INC

Memory increment for transaction object.

PJSIP_TSX_1XX_RETRANS_DELAY

Delay for non-100 1xx retransmission, in seconds. Set to 0 to disable this feature.

Default: 60 seconds

PJSIP_TSX_UAS_CONTINUE_ON_TP_ERROR

Setting to determine if certain SIP UAS transaction, such as INVITE UAS tsx that hasn’t been confirmed, is allowed to continue upon transport error. If disabled, the transaction will always be terminated, which is the default behavior prior to the introduction of this setting.

Default: 1 (transaction will continue)

PJSIP_MAX_TSX_KEY_LEN
PJSIP_POOL_LEN_USER_AGENT
PJSIP_POOL_INC_USER_AGENT
PJSIP_MAX_CALL_ID_LEN

Message/URL related constants.

PJSIP_MAX_TAG_LEN

Message/URL related constants.

PJSIP_MAX_BRANCH_LEN

Message/URL related constants.

PJSIP_MAX_HNAME_LEN

Message/URL related constants.

PJSIP_POOL_LEN_DIALOG

Dialog’s pool setting.

PJSIP_POOL_INC_DIALOG

Dialog’s pool setting.

PJSIP_MAX_HEADER_TYPES

Maximum header types.

PJSIP_MAX_URI_TYPES

Maximum URI types.

PJSIP_T1_TIMEOUT

Transaction T1 timeout value.

PJSIP_T2_TIMEOUT

Transaction T2 timeout value.

PJSIP_T4_TIMEOUT

Transaction completed timer for non-INVITE

PJSIP_TD_TIMEOUT

Transaction completed timer for INVITE.

This setting is also used for transaction timeout timer for both INVITE and non-INVITE.

PJSIP_AUTH_HEADER_CACHING

If this flag is set, the stack will keep the Authorization/Proxy-Authorization headers that are sent in a cache. Future requests with the same realm and the same method will use the headers in the cache (as long as no qop is required by server).

Turning on this flag will make authorization process goes faster, but will grow the memory usage undefinitely until the dialog/registration session is terminated.

Default: 0

PJSIP_AUTH_AUTO_SEND_NEXT

If this flag is set, the stack will proactively send Authorization/Proxy- Authorization header for next requests. If next request has the same method with any of previous requests, then the last header which is saved in the cache will be used (if PJSIP_AUTH_CACHING is set). Otherwise a fresh header will be recalculated. If a particular server has requested qop, then a fresh header will always be calculated.

If this flag is NOT set, then the stack will only send Authorization/Proxy- Authorization headers when it receives 401/407 response from server.

Turning ON this flag will grow memory usage of a dialog/registration pool indefinitely until it is terminated, because the stack needs to keep the last WWW-Authenticate/Proxy-Authenticate challenge.

Default: 0

PJSIP_AUTH_QOP_SUPPORT

Support qop=”auth” directive. This option also requires client to cache the last challenge offered by server.

Default: 1

PJSIP_MAX_STALE_COUNT

Maximum number of stale retries when server keeps rejecting our request with stale=true.

Default: 3

PJSIP_HAS_DIGEST_AKA_AUTH

Specify support for IMS/3GPP digest AKA authentication version 1 and 2 (AKAv1-MD5 and AKAv2-MD5 respectively).

Note that if this is enabled, application would need to link with libmilenage library from third_party directory.

Default: 0 (for now)

PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH

Specify the number of seconds to refresh the client registration before the registration expires.

Default: 5 seconds

PJSIP_REGISTER_CLIENT_CHECK_CONTACT

Specify whether client registration should check for its registered contact in Contact header of successful REGISTE response to determine whether registration has been successful. This setting may be disabled if non-compliant registrar is unable to return correct Contact header.

This setting can be changed in run-time by settting regc.check_contact field of pjsip_cfg().

Default is 1

PJSIP_REGISTER_CLIENT_ADD_XUID_PARAM

Specify whether client registration should add “x-uid” extension parameter in all Contact URIs that it registers to assist the matching of Contact URIs in the 200/OK REGISTER response, in case the registrar is unable to return exact Contact URI in the 200/OK response.

This setting can be changed in run-time by setting regc.add_xuid_param field of pjsip_cfg().

Default is 0.

PJSIP_REGISTER_ALLOW_EXP_REFRESH

Allow client to send refresh registration when the registrar sent a Contact header with expire parameter 0 in the 200/OK REGISTER response. Refer to https://github.com/pjsip/pjproject/pull/2809 for more info.

Default is 1.

PJSIP_AUTH_CACHED_POOL_MAX_SIZE

Maximum size of pool allowed for auth client session in pjsip_regc. After the size exceeds because of Digest authentication processing, the pool is reset.

Default is 20 kB

PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY

Specify whether the cnonce used for SIP authentication contain digits only. The “cnonce” value is setup using GUID generator, i.e: pj_create_unique_string(), and the GUID string may contain hyphen character (“-“). Some SIP servers do not like this GUID format, so this option will strip any hyphens from the GUID string.

Default is 1 (cnonce will not contain any hyphen characters).

PJSIP_AUTH_ALLOW_MULTIPLE_AUTH_HEADER

Allow client to send multiple Authorization header when receiving multiple WWW-Authenticate header fields. If this is disabled, the stack will send Authorization header field containing credentials that match the topmost header field.

Default is 0

PJSIP_EVSUB_TIME_UAC_REFRESH

Specify the time (in seconds) to send SUBSCRIBE to refresh client subscription before the actual interval expires.

Default: 5 seconds

PJSIP_PUBLISHC_DELAY_BEFORE_REFRESH

Specify the time (in seconds) to send PUBLISH to refresh client publication before the actual interval expires.

Default: 5 seconds

PJSIP_EVSUB_TIME_UAC_TERMINATE

Specify the time (in seconds) to wait for the final NOTIFY from the server after client has sent un-SUBSCRIBE request.

Default: 5 seconds

PJSIP_EVSUB_TIME_UAC_WAIT_NOTIFY

Specify the time (in seconds) for client subscription to wait for another NOTIFY from the server, if it has rejected the last NOTIFY with non-2xx final response (such as 401). If further NOTIFY is not received within this period, the client will unsubscribe.

Default: 5 seconds

PJSIP_PRES_DEFAULT_EXPIRES

Specify the default expiration time for presence event subscription, for both client and server subscription. For client subscription, application can override this by specifying positive non-zero value in “expires” parameter when calling pjsip_pres_initiate(). For server subscription, we would take the expiration value from the Expires header sent by client in the SUBSCRIBE request if the header exists and its value is less than this setting, otherwise this setting will be used.

Default: 600 seconds (10 minutes)

PJSIP_PRES_BAD_CONTENT_RESPONSE

Specify the status code value to respond to bad message body in NOTIFY request for presence. Scenarios that are considered bad include non- PIDF/XML and non-XPIDF/XML body, multipart message bodies without PIDF/XML nor XPIDF/XML part, and bad (parsing error) PIDF and X-PIDF bodies themselves.

Default value is 488. Application may change this to 200 to ignore the unrecognised content (this is useful if the application wishes to handle the content itself). Only non-3xx final response code is allowed here.

Default: 488 (Not Acceptable Here)

PJSIP_DLG_EVENT_BAD_CONTENT_RESPONSE

Specify the status code value to respond to bad message body in NOTIFY request for dialog event.

Default: 488 (Not Acceptable Here)

PJSIP_PRES_PIDF_ADD_TIMESTAMP

Add “timestamp” information in generated PIDF document for both server subscription and presence publication.

Default: 1 (yes)

PJSIP_SESS_TIMER_DEF_SE

Default session interval for Session Timer (RFC 4028) extension, in seconds. As specified in RFC 4028 Section 4, this value must not be less than the absolute minimum for the Session-Expires header field 90 seconds, and the recommended value is 1800 seconds.

Default: 1800 seconds

PJSIP_SESS_TIMER_RETRY_DELAY

Default delay for retrying session refresh request upon receiving transport error (503). Set it to -1 to end the session immediately instead.

Default: 10 seconds

PJSIP_PUBLISHC_QUEUE_REQUEST

Specify whether the client publication session should queue the PUBLISH request should there be another PUBLISH transaction still pending. If this is set to false, the client will return error on the PUBLISH request if there is another PUBLISH transaction still in progress.

Default: 1 (yes)

PJSIP_MWI_DEFAULT_EXPIRES

Specify the default expiration time for Message Waiting Indication (RFC 3842) event subscription, for both client and server subscription. For client subscription, application can override this by specifying positive non-zero value in “expires” parameter when calling pjsip_mwi_initiate(). For server subscription, we would take the expiration value from the Expires header sent by client in the SUBSCRIBE request if the header exists and its value is less than this setting, otherwise this setting will be used.

Default: 3600 seconds

PJSIP_HAS_TX_DATA_LIST

Specify whether transport manager should maintain a list of transmit buffer instances, so any possible dangling instance can be cleaned up when the transport manager is shutdown (see also ticket #1671). Note that this feature will have slight impact on the performance as mutex is employed in updating the list, i.e: on creation and destruction of transmit data.

Default: 0 (no)

PJSIP_INV_ACCEPT_UNKNOWN_BODY

Specify whether to accept INVITE/re-INVITE with unknown content type, by default the stack will reject this type of message as specified in RFC3261 section 8.2.3. Application that wishes to process the body could set this to PJ_TRUE, be informed that SDP offer/answer will still be present.

Default: PJ_FALSE

PJSIP_INV_UPDATE_EARLY_CHECK_RELIABLE

Specify whether to check if UPDATE sent in EARLY state has already completed SDP negotiation using reliable provisional responses, as specified in RFC3311 section 5.1.

By default, the library will disable the check and allow the UPDATE to be sent for backward compatibility.

Default: 0 (disabled)

Functions

pjsip_cfg_t *pjsip_cfg(void)

Get pjsip configuration instance. Application may modify the settings before creating the SIP endpoint and modules.

Returns:

Configuration instance.

void pjsip_dump_config(void)

Dump configuration to log with verbosity equal to info(3).

Variables

pjsip_cfg_t pjsip_sip_cfg_var
struct pjsip_cfg_t
#include <sip_config.h>

This structure describes PJSIP run-time configurations/settings. Application may use pjsip_cfg() function to modify the settings before creating the stack.

Public Members

pj_bool_t allow_port_in_fromto_hdr

Specify port number should be allowed to appear in To and From header. Note that RFC 3261 disallow this, see Table 1 in section 19.1.1 of the RFC.

Default is PJSIP_ALLOW_PORT_IN_FROMTO_HDR.

pj_bool_t accept_replace_in_early_state

Accept call replace in early state when invite is not initiated by the user agent. RFC 3891 Section 3 disallows this, however, for better interoperability reason, this might be ignored.

Default is PJSIP_ACCEPT_REPLACE_IN_EARLY_STATE.

pj_bool_t allow_tx_hash_in_uri

Allow hash character (‘#’) to appear in outgoing URIs. See https://github.com/pjsip/pjproject/issues/1569.

Default is PJ_FALSE.

pj_bool_t disable_rport

Disable rport in request.

Default is PJ_FALSE.

pj_bool_t disable_tcp_switch

Disable automatic switching from UDP to TCP if outgoing request is greater than 1300 bytes.

Default is PJSIP_DONT_SWITCH_TO_TCP.

pj_bool_t disable_tls_switch

Disable automatic switching to secure transport (such as TLS) if target-URI does not use “sips” scheme nor secure transport, even when request-URI uses “sips” scheme.

Default is PJSIP_DONT_SWITCH_TO_TLS.

pj_bool_t follow_early_media_fork

Enable call media session to always be updated to the latest received early media SDP when receiving forked early media (multiple 183 responses with different To tag).

Default is PJSIP_FOLLOW_EARLY_MEDIA_FORK.

pj_bool_t req_has_via_alias

Specify whether “alias” param should be added to the Via header in any outgoing request with connection oriented transport.

Default is PJSIP_REQ_HAS_VIA_ALIAS.

pj_bool_t resolve_hostname_to_get_interface

Resolve hostname when trying to get the network interface to be put in Via or Contact header.

Default is PJSIP_RESOLVE_HOSTNAME_TO_GET_INTERFACE.

pj_bool_t disable_secure_dlg_check

Disable security check on incoming messages in a secure dialog. A secure dialog is created when the request that creates the dialog uses “sips” scheme in its request URI. Contact URI should use “sips” scheme and the top-most Record-Route URI, if any, should use either “sips” scheme or “transport=tls” param. See also https://github.com/pjsip/pjproject/issues/1735.

Default is PJ_FALSE.

pj_bool_t use_compact_form

Encode SIP headers in their short forms to reduce size. By default, SIP headers in outgoing messages will be encoded in their full names. If this option is enabled, then SIP headers for outgoing messages will be encoded in their short forms, to reduce message size. Note that this does not affect the ability of PJSIP to parse incoming SIP messages, as the parser always supports parsing both the long and short version of the headers.

Default is PJSIP_ENCODE_SHORT_HNAME

pj_bool_t accept_multiple_sdp_answers

Accept multiple SDP answers on non-reliable 18X responses and the 2XX response when they are all received from the same source (same To tag).

See also: https://tools.ietf.org/html/rfc6337#section-3.1.1

Default is PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS.

pj_bool_t keep_inv_after_tsx_timeout

Don’t disconnect the INVITE session after an outgoing request gets timed out or responded with 408 (request timeout).

Default is PJ_FALSE.

struct pjsip_cfg_t::[anonymous] endpt

Global settings.

unsigned max_count

Maximum number of transactions. The value is initialized with PJSIP_MAX_TSX_COUNT

unsigned t1

Transaction T1 timeout, in msec. Default value is PJSIP_T1_TIMEOUT

unsigned t2

Transaction T2 timeout, in msec. Default value is PJSIP_T2_TIMEOUT

unsigned t4

Transaction completed timer for non-INVITE, in msec. Default value is PJSIP_T4_TIMEOUT

unsigned td

Transaction completed timer for INVITE, in msec. Default value is PJSIP_TD_TIMEOUT.

This setting is also used for transaction timeout timer for both INVITE and non-INVITE.

struct pjsip_cfg_t::[anonymous] tsx

Transaction layer settings.

pj_bool_t check_contact

Specify whether client registration should check for its registered contact in Contact header of successful REGISTER response to determine whether registration has been successful. This setting may be disabled if non-compliant registrar is unable to return correct Contact header.

Default is PJSIP_REGISTER_CLIENT_CHECK_CONTACT

pj_bool_t add_xuid_param

Specify whether client registration should add “x-uid” extension parameter in all Contact URIs that it registers to assist the matching of Contact URIs in the 200/OK REGISTER response, in case the registrar is unable to return exact Contact URI in the 200/OK response.

Default is PJSIP_REGISTER_CLIENT_ADD_XUID_PARAM.

struct pjsip_cfg_t::[anonymous] regc

Client registration settings.

long keep_alive_interval

Set the interval to send keep-alive packet for TCP transports. If the value is zero, keep-alive will be disabled for TCP.

Default is PJSIP_TCP_KEEP_ALIVE_INTERVAL.

Set the interval to send keep-alive packet for TLS transports. If the value is zero, keep-alive will be disabled for TLS.

Default is PJSIP_TLS_KEEP_ALIVE_INTERVAL.

struct pjsip_cfg_t::[anonymous] tcp

TCP transport settings

struct pjsip_cfg_t::[anonymous] tls

TLS transport settings