BLOG | DOCUMENTATION | TRAC

Home --> Documentations --> PJSIP Reference

#include <endpoint.hpp>

Inheritance diagram for pj::UaConfig:
pj::PersistentObject

Public Member Functions

 UaConfig ()
 
void fromPj (const pjsua_config &ua_cfg)
 
pjsua_config toPj () const
 
virtual void readObject (const ContainerNode &node) PJSUA2_THROW(Error)
 
virtual void writeObject (ContainerNode &node) const PJSUA2_THROW(Error)
 
- Public Member Functions inherited from pj::PersistentObject
virtual ~PersistentObject ()
 

Data Fields

unsigned maxCalls
 
unsigned threadCnt
 
bool mainThreadOnly
 
StringVector nameserver
 
StringVector outboundProxies
 
string userAgent
 
StringVector stunServer
 
bool stunTryIpv6
 
bool stunIgnoreFailure
 
int natTypeInSdp
 
bool mwiUnsolicitedEnabled
 

Detailed Description

SIP User Agent related settings.

Constructor & Destructor Documentation

◆ UaConfig()

pj::UaConfig::UaConfig ( )

Default constructor to initialize with default values.

Member Function Documentation

◆ fromPj()

void pj::UaConfig::fromPj ( const pjsua_config ua_cfg)

Construct from pjsua_config.

◆ toPj()

pjsua_config pj::UaConfig::toPj ( ) const

Export to pjsua_config

◆ readObject()

virtual void pj::UaConfig::readObject ( const ContainerNode node)
virtual

Read this object from a container.

Parameters
nodeContainer to write values from.

Implements pj::PersistentObject.

◆ writeObject()

virtual void pj::UaConfig::writeObject ( ContainerNode node) const
virtual

Write this object to a container.

Parameters
nodeContainer to write values to.

Implements pj::PersistentObject.

Field Documentation

◆ maxCalls

unsigned pj::UaConfig::maxCalls

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.

◆ threadCnt

unsigned pj::UaConfig::threadCnt

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.

◆ mainThreadOnly

bool pj::UaConfig::mainThreadOnly

When this flag is non-zero, all callbacks that come from thread other than main thread will be posted to the main thread and to be executed by Endpoint::libHandleEvents() function. This includes the logging callback. Note that this will only work if threadCnt is set to zero and Endpoint::libHandleEvents() is performed by main thread. By default, the main thread is set from the thread that invoke Endpoint::libCreate()

Default: false

◆ nameserver

StringVector pj::UaConfig::nameserver

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).

◆ outboundProxies

StringVector pj::UaConfig::outboundProxies

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.

◆ userAgent

string pj::UaConfig::userAgent

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

◆ stunServer

StringVector pj::UaConfig::stunServer

Array of STUN servers to try. The library will try to resolve and contact each of the STUN server entry until it finds one that is usable. Each entry may be a domain name, host name, IP address, and it may contain an optional port number. For example:

  • "pjsip.org" (domain name)
  • "sip.pjsip.org" (host name)
  • "pjsip.org:33478" (domain name and a non-standard port number)
  • "10.0.0.1:3478" (IP address and port number)

When nameserver is configured in the pjsua_config.nameserver field, if entry is not an IP address, it will be resolved with DNS SRV resolution first, and it will fallback to use DNS A resolution if this fails. Port number may be specified even if the entry is a domain name, in case the DNS SRV resolution should fallback to a non-standard port.

When nameserver is not configured, entries will be resolved with pj_gethostbyname() if it's not an IP address. Port number may be specified if the server is not listening in standard STUN port.

◆ stunTryIpv6

bool pj::UaConfig::stunTryIpv6

This specifies if the library should try to do an IPv6 resolution of the STUN servers if the IPv4 resolution fails. It can be useful in an IPv6-only environment, including on NAT64.

Default: FALSE

◆ stunIgnoreFailure

bool pj::UaConfig::stunIgnoreFailure

This specifies if the library startup should ignore failure with the STUN servers. If this is set to PJ_FALSE, the library will refuse to start if it fails to resolve or contact any of the STUN servers.

Default: TRUE

◆ natTypeInSdp

int pj::UaConfig::natTypeInSdp

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

◆ mwiUnsolicitedEnabled

bool pj::UaConfig::mwiUnsolicitedEnabled

Handle unsolicited NOTIFY requests containing message waiting indication (MWI) info. Unsolicited MWI is incoming NOTIFY requests which are not requested by client with SUBSCRIBE request.

If this is enabled, the library will respond 200/OK to the NOTIFY request and forward the request to Endpoint::onMwiInfo() callback.

See also AccountMwiConfig.enabled.

Default: PJ_TRUE


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.