Configuration

January 13, 2016 · View on GitHub

Keep in mind that installed plugins can add specific configuration options. See the plugins documentation.

Global configuration options

They are defined as standard Erlang environment variables for each of dependant Erlang applications, along with nksip application itself:

nkpacket

NameTypeDefaultComments
max_connectionsinteger()1024Maximum number of simultaneous connections
dns_cache_ttlinteger()30000DNS cache TTL (See nkpacket_dns) (msecs)
udp_timeoutinteger()30000Default UDP timeout (msecs)
tcp_timeoutinteger()180000Default TCP timeout (msecs)
sctp_timeoutinteger()180000Default SCTP timeout (msecs)
ws_timeoutinteger()180000Default WS timeout (msecs)
connect_timeoutinteger()30000Default connect timeout (msecs)
sctp_out_streamsinteger()10Default SCTP out streams
sctp_in_streamsinteger()10Default SCTP in streams
tls_certfilestring()-Custom certificate file
tls_keyfilestring()-Custom key file
tls_cacertfilestring()-Custom CA certificate file
tls_passwordstring()-Password fort the certificate
tls_verifyboolean()falseIf we must check certificate
tls_depthinteger()0TLS check depth

nkservice

NameTypeDefaultComments
log_pathstring"./log"Directory for NkSERVICE files (you must configure lager also)
log_leveldebug|info|notice|warning|errornoticeCurrent global log level

nksip

NameTypeDefaultComments
sync_call_timeinteger()30000Timeout for internal synchronous calls
global_max_callsinteger()100000Maximum number of simultaneous calls (for all services)
msg_routersinteger()16Number of parallel SIP processors
sip_allowstring()|binary()"INVITE,ACK,CANCEL,BYE,OPTIONS,INFO,UPDATE,SUBSCRIBE,NOTIFY,REFER,MESSAGE"Default Allow header
sip_supportedstring()|binary()"path"Default Supported header
sip_timer_t1integer()500Standar SIP T1 timer (msecs)
sip_timer_t2integer()4000Standar SIP T2 timer (msecs)
sip_timer_t4integer()5000Standar SIP T4 timer (msecs)
sip_timer_cinteger()180Standar SIP C timer (secs)
sip_trans_timeoutinteger()900Time to timeout non-refreshed dialogs (secs)
sip_dialog_timeoutinteger()1800Time to timeout non-refreshed dialogs (secs)
sip_event_expiresinteger()60Default Expires for events (secs)
sip_event_expires_offsetinteger()5Additional time to add to Expires header (secs)
sip_nonce_timeoutinteger()30Time a new nonce in an authenticate header will be usable (secs)
sip_fromnklib:user_uri()"NkSIP App sip:user@nksip"Default From to use in the requests
sip_acceptstring()|binary()"/"If defined, this value will be used instead of default when option accept is used
sip_eventsstring()|binary()""Lists the Event Packages this Service supports
sip_routeuser_uri()[]Route (outbound proxy) to use. Generates one or more Route headers in every request, for example <sip:1.2.3.4;lr>, <sip:abcd;lr> (you will usually append the lr option to use loose routing)
sip_no_100boolean()falseIf true, forbids the generation of automatic 100-type responses for INVITE requests
sip_max_callsinteger()100000Maximum number of simultaneous calls (for each service)
sip_local_hostauto|string()|binary()|autoDefault host or IP to use in headers like Via, Contact and Record-Route. If set to auto NkSIP will use the IP of the transport selected in every case. If that transport is listening on all addresses NkSIP will try to find the best IP using the first valid IP among the network interfaces ethX and enX, or localhost if none is found
sip_local_host6auto|string()|binary()autoDefault host or IP to use in headers like Via, Contact and Record-Route for IPv6 transports. See local_host option
sip_udp_max_sizeinteger()65507Maximum UDP packet size. Bigger packets will be sent using TCP

lager

See specific lager configuration

Service Configuration

When starting each service, all sip_-class global configuration options can be used, and also:

NameTypeDefaultComments
pluginsatom[]List of plugins to use
sip_listenatom"sip:all"List of transports to use.
service_idle_timeoutinteger()(depends on transport)Default connection idle timeout
service_connect_timeout(global)Default outbound connection idle timeout
service_sctp_out_streamsinteger()10Default SCTP out streams
service_sctp_in_streamsinteger()10Default SCTP in streams
tcp_listenersinteger()10Default number of TCP listenersº
tls_certfilestring()-Custom certificate file
tls_keyfilestring()-Custom key file
tls_cacertfilestring()-Custom CA certificate file
tls_passwordstring()-Password fort the certificate
tls_verifyboolean()falseIf we must check certificate
tls_depthinteger()0TLS check depth

See NkPACKET documentation for a description of allowed transports. Some examples are:

"<sip:127.0.0.1;transport=ws>;idle_timeout=5000"
"<sip:localhost:5060>, <sips:localhost:5061>;tls_password=pass"

All transport-related options above are allowed in URLs.

Reconfiguration

Any Service can be reconfigured on the fly.

Any of the previous parameters can be changed and the new options will be used fot the next call.

You can even change the plugin list on the fly, but you must be sure of the effects of such a change.

You can add transports at any time, but must stop manually any transport you don't want to use any more.