Login | Register

Documentation

Documentation -> Manuals -> Manual 2.2 -> Core Parameters

Pages for other versions: devel 3.5 3.4 Older versions: 3.3 3.2 3.1 3.0 2.4 2.3 2.2 2.1 1.11 1.10 1.9 1.8 1.7 1.6 1.5 1.4


Core Parameters v2.2
PrevNext

Table of Content (hide)

  1. 1. Core Keywords
    1. 1.1 af
    2. 1.2 dst_ip
    3. 1.3 dst_port
    4. 1.4 from_uri
    5. 1.5 method
    6. 1.6 msg:len
    7. 1.7 $retcode
    8. 1.8 proto
    9. 1.9 status
    10. 1.10 src_ip
    11. 1.11 src_port
    12. 1.12 to_uri
    13. 1.13 uri
  2. 2. Core Values
    1. 2.1 INET
    2. 2.2 INET6
    3. 2.3 TCP
    4. 2.4 UDP
    5. 2.5 max_len
    6. 2.6 myself
    7. 2.7 null
  3. 3. Core parameters
    1. 3.1 abort_on_assert
    2. 3.2 advertised_address
    3. 3.3 advertised_port
    4. 3.4 alias
    5. 3.5 auto_aliases
    6. 3.6 bin_listen (Removed in OpenSIPS 2.2)
    7. 3.7 bin_children (Removed in OpenSIPS 2.2)
    8. 3.8 cfg_file
    9. 3.9 cfg_line
    10. 3.10 check_via
    11. 3.11 children
    12. 3.12 chroot
    13. 3.13 debug_mode
    14. 3.14 db_version_table
    15. 3.15 db_default_url
    16. 3.16 db_max_async_connections
    17. 3.17 debug (Removed in OpenSIPS 2.2)
    18. 3.18 disable_503_translation
    19. 3.19 disable_core_dump
    20. 3.20 disable_dns_blacklist
    21. 3.21 disable_dns_failover
    22. 3.22 disable_stateless_fwd
    23. 3.23 dns
    24. 3.24 dns_retr_time
    25. 3.25 dns_retr_no
    26. 3.26 dns_servers_no
    27. 3.27 dns_try_ipv6
    28. 3.28 dns_try_naptr
    29. 3.29 dns_use_search_list
    30. 3.30 dst_blacklist
    31. 3.31 enable_asserts
    32. 3.32 event_pkg_threshold
    33. 3.33 event_shm_threshold
    34. 3.34 exec_dns_threshold
    35. 3.35 exec_msg_threshold
    36. 3.36 fork (Removed in OpenSIPS 2.2)
    37. 3.37 group gid (Removed in OpenSIPS 2.2)
    38. 3.38 include_file
    39. 3.39 import_file
    40. 3.40 listen
    41. 3.41 log_facility
    42. 3.42 log_level
    43. 3.43 log_name
    44. 3.44 log_stderror
    45. 3.45 max_while_loops
    46. 3.46 maxbuffer
    47. 3.47 mem-group
    48. 3.48 mem_warming
    49. 3.49 mem_warming_percentage
    50. 3.50 mem_warming_pattern_file
    51. 3.51 memdump | mem_dump
    52. 3.52 memlog | mem_log
    53. 3.53 mcast_loopback
    54. 3.54 mcast_ttl
    55. 3.55 mhomed
    56. 3.56 mpath
    57. 3.57 open_files_limit
    58. 3.58 poll_method
    59. 3.59 port
    60. 3.60 query_buffer_size
    61. 3.61 query_flush_time
    62. 3.62 rev_dns
    63. 3.63 server_header
    64. 3.64 server_signature
    65. 3.65 shm_hash_split_percentage
    66. 3.66 shm_secondary_hash_size
    67. 3.67 sip_warning
    68. 3.68 tcp_children
    69. 3.69 tcp_accept_aliases
    70. 3.70 tcp_listen_backlog
    71. 3.71 tcp_connect_timeout
    72. 3.72 tcp_connection_lifetime
    73. 3.73 tcp_max_connections
    74. 3.74 tcp_max_msg_time
    75. 3.75 tcp_no_new_conn_bflag
    76. 3.76 tcp_threshold
    77. 3.77 tcp_keepalive
    78. 3.78 tcp_keepcount
    79. 3.79 tcp_keepidle
    80. 3.80 tcp_keepinterval
    81. 3.81 tls_ca_list
    82. 3.82 tls_certificate
    83. 3.83 tls_ciphers_list
    84. 3.84 tls_domain
    85. 3.85 tls_handshake_timeout
    86. 3.86 tls_log
    87. 3.87 tls_method
    88. 3.88 tls_port_no
    89. 3.89 tls_private_key
    90. 3.90 tls_require_certificate
    91. 3.91 tls_send_timeout
    92. 3.92 tls_verify
    93. 3.93 tos
    94. 3.94 user uid (Removed in OpenSIPS 2.2)
    95. 3.95 user_agent_header
    96. 3.96 wdir
    97. 3.97 xlog_buf_size
    98. 3.98 xlog_force_color
    99. 3.99 xlog_default_level

This section lists the all the parameters exported by OpenSIPS core for script usage (to be used in opensips.cfg)

  1. Core keywords
  2. Core values
  3. Core parameters

1.  Core Keywords

Keywords specific to SIP messages which can be used mainly in 'if' expressions.

1.1  af

The address family of the received SIP message. It is INET if the message was received over IPv4 or INET6 if the message was received over IPv6.

Exampe of usage:

    if(af==INET6) {
        log("Message received over IPv6 link\n");
    };

1.2 dst_ip

The IP of the local interface where the SIP message was received. When the proxy listens on many network interfaces, makes possible to detect which was the one that received the packet.

Example of usage:

   if(dst_ip==127.0.0.1) {
      log("message received on loopback interface\n");
   };

1.3 dst_port

The local port where the SIP packet was received. When OpenSIPS is listening on many ports, it is useful to learn which was the one that received the SIP packet.

Example of usage:

   if(dst_port==5061)
   {
       log("message was received on port 5061\n");
   };

1.4 from_uri

This script variable is a reference to the URI of 'From' header. It can be used to test 'From'- header URI value.

Example of usage:

    if(is_method("INVITE") && from_uri=~".*@opensips.org")
    {
        log("the caller is from opensips.org\n");
    };

1.5 method

The variable is a reference to the SIP method of the message.

Example of usage:

    if(method=="REGISTER")
    {
       log("this SIP request is a REGISTER message\n");
    };

1.6 msg:len

The variable is a reference to the size of the message. It can be used in 'if' constructs to test message's size.

Example of usage:

    if(msg:len>2048)
    {
        sl_send_reply("413", "message too large");
        exit;
    };

1.7 $retcode

It represents the value returned by last function executed (similar to $? from bash -- if you wish, you can use also $? in OpenSIPS config, both names '$retcode' and '$?' are supported). If tested after a call of a route, it is the value retuned by that route.

Example of usage:

   route {
       route(1);
       if($retcode==1)
       {
           log("The request is an INVITE\n");
       };
   }


   route[1] {
       if(is_method("INVITE"))
           return(1);
       return(2);
   }

1.8 proto

This variable can be used to test the transport protocol of the SIP message.

Example of usage:

    if(proto==UDP)
    {
        log("SIP message received over UDP\n");
    };

1.9 status

If used in onreply_route, this variable is a reference to the status code of the reply. If it used in a standard route block, the variable is a reference to the status of the last reply sent out for the current request.

Example of usage:

    if(status=="200")
    {
        log("this is a 200 OK reply\n");
    };

1.10 src_ip

Reference to source IP address of the SIP message.

Example of usage:

    if(src_ip==127.0.0.1)
    {
        log("the message was sent from localhost!\n");
    };

1.11  src_port

Reference to source port of the SIP message (from which port the message was sent by previous hop).

Example of usage:

    if(src_port==5061)
    {
        log("message sent from port 5061\n");
    }

1.12 to_uri

This variable can be used to test the value of URI from To header.

Example of usage:

  if(to_uri=~"sip:.+@opensips.org")
  {
      log("this is a request for opensips.org users\n");
  };

1.13 uri

This variable can be used to test the value of the request URI.

Example of usage:

    if(uri=~"sip:.+@opensips.org")
    {
        log("this is a request for opensips.org users\n");
    };

↑ Contents


2. Core Values

Values that can be used in 'if' expressions to check against Core Keywords

2.1 INET

This keyword can be used to test whether the SIP packet was received over an IPv4 connection.

Example of usage:

    if(af==INET)
    {
        log("the SIP message was received over IPv4\n");
    };

2.2 INET6

This keyword can be used to test whether the SIP packet was received over an IPv6 connection.

Example of usage:

  if(af==INET6)
  {
      log("the SIP message was received over IPv6\n");
  };

2.3 TCP

This keyword can be used to test the value of 'proto' and check whether the SIP packet was received over TCP or not.

Example of usage:

  if(proto==TCP)
  {
      log("the SIP message was received over TCP\n");
  };

2.4 UDP

This keyword can be used to test the value of 'proto' and check whether the SIP packet was received over UDP or not.

Example of usage:

  if(proto==UDP)
  {
      log("the SIP message was received over UDP\n");
  };

2.5 max_len

This keyword is set to the maximum size of an UDP packet. It can be used to test message's size.

Example of usage:

    if(msg:len>max_len)
    {
        sl_send_reply("413", "message too large to be forwarded over UDP without fragmentation");
        exit;
    }

2.6 myself

It is a reference to the list of local IP addresses, hostnames and aliases that has been set in OpenSIPS configuration file. This lists contain the domains served by OpenSIPS.

The variable can be used to test if the host part of an URI is in the list. The usefulness of this test is to select the messages that has to be processed locally or has to be forwarded to another server.

See "alias" to add hostnames,IP addresses and aliases to the list.

Example of usage:

    if(uri==myself) {
        log("the request is for local processing\n");
    };

2.7 null

Can be used in assignment to reset the value of a per-script variable or to delete an avp.

Example of usage:

    $avp(i:12) = null;
    $var(x) = null;

↑ Contents


3. Core parameters

Global parameters that can be set in configuration file. Accepted values are, depending on the actual parameters strings, numbers and yes/ no. If you need to specify either "yes" or "no" as part of a string, wrap this in double quotes.

3.1 abort_on_assert

Default value: false


Only relevant if asserts are enabled. Set to true in order to make OpenSIPS shut down immediately in case a script assert fails.

Example of usage:

    abort_on_assert = true

3.2 advertised_address

It can be an IP address or string and represents the address advertised in Via header and other destination lumps (e.g RR header). If empty or not set (default value) the socket address from where the request will be sent is used.

WARNING:

  - don't set it unless you know what you are doing (e.g. nat traversal)
  - you can set anything here, no check is made (e.g. foo.bar will be
  accepted even if foo.bar doesn't exist)

Example of usage:

    advertised_address="opensips.org"

NOTE: Aside this global approach, you can also define an advertise IP and port in a per-interface manner (see the "listen" parameter). When advertise values are defined per interface, they will be used only for traffic leaving that interface only.

3.3 advertised_port

The port advertised in Via header and other destination lumps (e.g. RR). If empty or not set (default value) the port from where the message will be sent is used. Same warnings as for 'advertised_address'.

Example of usage:

    advertised_port=5080

NOTE: Aside this global approach, you can also define an advertise IP and port in a per-interface manner (see the "listen" parameter). When advertise values are defined per interface, they will be used only for traffic leaving that interface only.

3.4 alias

Parameter to set alias hostnames for the server. It can be set many times, each value being added in a list to match the hostname when 'myself' is checked.

It is necessary to include the port (the port value used in the "listen=" definitions) in the alias definition, otherwise the loose_route() function will not work as expected for local forwards!

Example of usage:

    alias=udp:other.domain.com:5060
    alias=tcp:another.domain.com:5060

3.5 auto_aliases

This parameter controls if aliases should be automatically discovered and added during fixing listening sockets. The auto discovered aliases are result of the DNS lookup (if listen is a name and not IP) or of a reverse DNS lookup on the listen IP.

Far backward compatibility reasons, the default value is "on".

Example of usage:

    auto_aliases=no
    auto_aliases=0

3.6 bin_listen (Removed in OpenSIPS 2.2)

Replaced by the bin_port module parameter from proto_bin module (as a result of migrating the BIN implementation from core into a separate module).

3.7 bin_children (Removed in OpenSIPS 2.2)

Obsolete, simply removed.

3.8 cfg_file

Returns the name of the corresponding OpenSIPS config file (useful when multiple config files are included).

3.9 cfg_line

Returns the corresponding line inside the OpenSIPS config file.

3.10 check_via

Check if the address in top most via of replies is local. Default value is 0 (check disabled).

Example of usage:

    check_via=1 

3.11 children

Number of worker processes (children) to be created for each UDP or SCTP interface you have defined. Default value is 8.

Example of usage:

    children=16

NOTE: this global value (applicable for all UDP/SCTP interfaces) can be override if you set a different number of children in the definition of a specific interface - so actually you can define a different number of children for each interface (see the "listen" parameter for syntax).

3.12 chroot

The value must be a valid path in the system. If set, OpenSIPS will chroot (change root directory) to its value.

Example of usage:

    chroot=/other/fakeroot

3.13 debug_mode

Enabling the debug_mode option is a fast way to debug your OpenSIPS. This option will automatically force:

  • staying in foreground (do not detach from console)
  • set logging level to 4 (debug)
  • set logging to standard error
  • enable core dumping
  • set UDP worker processes to 2
  • set TCP worker processes to 2

Default value is false/0 (disabled).

NOTE that enabling this option will override all the other individual parameters like foreground mode, log level, children, etc. This parameter was introduced as a replacement for the old fork options.

3.14 db_version_table

The name of the table version to be used by the DB API to check the version of the used tables.
Default value is "version"

Example of usage:

    db_version_table="version_1_8"

3.15 db_default_url

The default DB URL to be used by modules if no per-module URL is given. Default is NULL (not defined)

Example of usage:

    db_default_url="mysql://opensips:opensipsrw@localhost/opensips"

3.16 db_max_async_connections

Maximum number of TCP connections opened from a single OpenSIPS worker to each individual SQL backend. Default value is 10.

Individual backends are determined from DB URLs as follows:

        [ scheme, user, pass, host, port, database ]

Example of usage:

    db_max_async_connections=220

3.17 debug (Removed in OpenSIPS 2.2)

Replaced by log_level parameter.

3.18 disable_503_translation

If 'yes', OpenSIPS will not translate the received 503 replies into 500 replies (RFC 3261 clearly states that a proxy should never relay a 503 response, but instead it must transform it into a 500).

Default value is 'no' (do translation).

3.19 disable_core_dump

Can be 'yes' or 'no'. By default core dump limits are set to unlimited or a high enough value. Set this config variable to 'yes' to disable core dump-ing (will set core limits to 0).

Default value is 'no'.

Example of usage:

    disable_core_dump=yes

3.20 disable_dns_blacklist

The DNS resolver, when configured with failover, can automatically store in a temporary blacklist the failed destinations. This will prevent (for a limited period of time) OpenSIPS to send requests to destination known as failed. So, the blacklist can be used as a memory for the DNS resolver.

The temporary blacklist created by DNS resolver is named "dns" and it is by default selected for usage (no need use the use_blacklist()) function. The rules from this list have a life time of 4 minutes - you can change it at compile time, from resolve.c .

Can be 'yes' or 'no'. By default the blacklist is disabled (Default value is 'yes').

Example of usage:

    disable_dns_blacklist=no

3.21 disable_dns_failover

Can be 'yes' or 'no'. By default DNS-based failover is enabled. Set this config variable to 'yes' to disable the DNS-based failover. This is a global option, affecting the core and the modules also.

Default value is 'no'.

Example of usage:

    disable_dns_failover=yes

3.22 disable_stateless_fwd

Can be 'yes' or 'no'. This parameter controls the handling of stateless replies:

    yes - drop stateless replies if stateless fwd functions (like forward) are not used in script
    no - forward stateless replies

Default value is 'yes'.

3.23 dns

This parameter controls if the SIP server should attempt to lookup its own domain name in DNS. If this parameter is set to yes and the domain name is not in DNS a warning is printed on syslog and a "received=" field is added to the via header.

Default is no.

3.24 dns_retr_time

Time in seconds before retrying a dns request. Default value is system specific, depends also on the '/etc/resolv.conf' content (usually 5s).

Example of usage:

    dns_retr_time=3

3.25 dns_retr_no

Number of dns retransmissions before giving up. Default value is system specific, depends also on the '/etc/resolv.conf' content (usually 4).

Example of usage:

    dns_retr_no=3

3.26 dns_servers_no

How many dns servers from the ones defined in '/etc/resolv.conf' will be used. Default value is to use all of them.

Example of usage:

    dns_servers_no=2

3.27 dns_try_ipv6

Can be 'yes' or 'no'. If it is set to 'yes' and a DNS lookup fails, it will retry it for ipv6 (AAAA record). Default value is 'no'.

Example of usage:

    dns_try_ipv6=yes

3.28 dns_try_naptr

Disables the NAPTR lookups when doing DNS based routing for SIP requests - if disabled, the DNS lookup will start with SRV lookups. Can be 'yes' or 'no'. By default it is enabled, value 'yes'.

Example of usage:

    dns_try_naptr=no

3.29 dns_use_search_list

Can be 'yes' or 'no'. If set to 'no', the search list in '/etc/resolv.conf' will be ignored (=> fewer lookups => gives up faster). Default value is 'yes'.

HINT: even if you don't have a search list defined, setting this option to 'no' will still be "faster", because an empty search list is in fact search "" (so even if the search list is empty/missing there will still be 2 dns queries, eg. foo+'.' and foo+""+'.')

Example of usage:

    dns_use_search_list=no

3.30 dst_blacklist

Definition of a static (read-only) IP/destination blacklist. These lists can be selected from script (at runtime) to filter the outgoing requests, based on IP, protocol, port, etc.

Its primary purposes will be to prevent sending requests to critical IPs (like GWs) due DNS or to avoid sending to destinations that are known to be unavailable (temporary or permanent).

Example of usage:

   # filter out requests going to ips of my gws
   dst_blacklist = gw:{( tcp , 192.168.2.200 , 5060 , "" ),( any , 192.168.2.201 , 0 , "" )}
   # block requests going to "evil" networks
   dst_blacklist = net_filter:{ ( any , 192.168.1.120/255.255.255.0 , 0 , "" )}
   # block message requests with nasty words
   dst_blacklist = msg_filter:{ ( any , 192.168.20.0/255.255.255.0 , 0 , "MESSAGE*ugly_word" )}
   # block requests not going to a specific subnet
   dst_blacklist = net_filter2:{ !( any , 192.268.30.0/255.255.255.0 , 0 , "" )}

Each rule is defined by:

  • protocol : TCP, UDP, TLS or "any" for anything
  • port : number or 0 for any
  • ip/mask
  • test patter - is a filename like matching (see "man 3 fnmatch") applied on the outgoing request buffer (first_line+hdrs+body)

3.31 enable_asserts

Default value: false


Set to true in order to enable the assert script statement.

Example of usage:

    enable_asserts = true

3.32 event_pkg_threshold

A number representing the percentage threshold above which the E_CORE_PKG_THRESHOLD event is raised, warning about low amount of free private memory. It accepts integer values between 0 and 100.

Default value is 0 ( event disabled ).

Example of usage:

    event_pkg_threshold = 90

3.33 event_shm_threshold

A number representing the percentage threshold above which the E_CORE_SHM_THRESHOLD event is raised, warning about low amount of free shared memory. It accepts integer values between 0 and 100.

Default value is 0 ( event disabled ).

Example of usage:

    event_shm_threshold = 90

3.34 exec_dns_threshold

A number representing the maximum number of microseconds a DNS query is expected to last. Anything above the set number will trigger a warning message to the logging facility.

Default value is 0 ( logging disabled ).

Example of usage:

    exec_dns_threshold = 60000

3.35 exec_msg_threshold

A number representing the maximum number of microseconds the processing of a SIP msg is expected to last. Anything above the set number will trigger a warning message to the logging facility. Aside from the message and the processing time, the most time consuming function calls from the script will also be logged.

Default value is 0 ( logging disabled ).

Example of usage:

    exec_msg_threshold = 60000

3.36 fork (Removed in OpenSIPS 2.2)

Replaced by debug_mode parameter.

3.37 group gid (Removed in OpenSIPS 2.2)

Use the -u command line parameter instead.

3.38 include_file

Can be called from outside route blocks to load additional routes/blocks or from inside them to simply preform more functions. The file path can be relative or absolute. If it is not an absolute path, first attempt is to locate it relative to current directory. If that fails, second try is relative to directory of the file that includes it. Will throw an error if file is not found.

Example of usage:

    include_file "proxy_regs.cfg"

3.39 import_file

Same as include_file but will not throw an error if file is not found.

Example of usage:

    import_file "proxy_regs.cfg"

3.40 listen

Set the network addresses the SIP server should listen to. Its syntax is protocol:address[:port], where:

  • protocol: should be one of the transport modules loaded in the config file (e.g., udp, tcp, tls)
  • address: can be an IP address, a hostname, a network interface id, or the * wildcard which makes OpenSIPS listen on all possible interfaces for that protocol
  • port: optional, the port used by the listener - if absent, the default port exported by the transport module is used.

This parameter can be set multiple times in same configuration file, the server listening on all addresses specified.

The listen definition may accept several optional parameters for:

  • configuring an advertised IP and port only for an interface. Syntax "AS 11.22.33.44:5060"
  • setting a different number of children for this interface only (for UDP, SCTP and HEP_UDP interfaces only). This will override the global "children" parameter. Syntax "use_children 5"

Remember that the above parameters only affect the interface they are configured for; if they are not defined for a given interface, the global values will be used instead.

Examples of usage:

    listen = udp:*
    listen = udp:eth1
    listen = tcp:eth1:5062
    listen = tls:localhost:5061
    listen = hep_udp:10.10.10.10:5064
    listen = ws:127.0.0.1:5060 use_children 5
    listen = sctp:127.0.0.1:5060 as 99.88.44.33:5060 use_children 3

On startup, OpenSIPS reports all the interfaces that it is listening on. The TCP engine processes will be created regardless if you specify only UDP interfaces here.

3.41 log_facility

If OpenSIPS logs to syslog, you can control the facility for logging. Very useful when you want to divert all OpenSIPS logs to a different log file. See the man page syslog(3) for more details.

Default value is LOG_DAEMON.

Example of usage:

    log_facility=LOG_LOCAL0

3.42 log_level

Set the logging level (how verbose OpenSIPS should be). Higher values make OpenSIPS to print more messages.

Examples of usage:

    log_level=1 -- print only important messages (like errors or more critical situations) 
    - recommended for running proxy as daemon

    log_level=4 -- print a lot of debug messages - use it only when doing debugging sessions

Actual values are:

  • -3 - Alert level
  • -2 - Critical level
  • -1 - Error level
  • 1 - Warning level
  • 2 - Notice level
  • 3 - Info level
  • 4 - Debug level

The 'log_level' parameter is usually used in concordance with 'log_stderror' parameter.

Value of 'log_level' parameter can also be get and set dynamically using log_level Core MI function or $log_level script variable.

3.43 log_name

Set the id to be printed in syslog. The value must be a string and has effect only when OpenSIPS runs in daemon mode (fork=yes), after daemonize. Default value is argv[0].

Example of usage:

    log_name="osips-5070"

3.44 log_stderror

With this parameter you can make OpenSIPS to write log messages to standard error. Possible values are:

- "yes" - write the messages to standard error

- "no" - write the messages to syslog

Default value is "no".

Example of usage:

    log_stderror=yes

3.45 max_while_loops

The parameters set the value of maximum loops that can be done within a "while". Comes as a protection to avoid infinite loops in config file execution. Default is 100.

Example of usage:

    max_while_loops=200

3.46 maxbuffer

The size in bytes not to be exceeded during the auto-probing procedure of discovering the maximum buffer size for receiving UDP messages. Default value is 262144.

Example of usage:

    maxbuffer=65536

3.47 mem-group

Defines a group of modules (by name) to get separate memory statistics. OpenSIPS will provide per-group memory information - the number of allocated fragments, the amount of used memory and the amount of real used memory (with memory manager overhead). This is useful if you want to monitor the memory usage of a certain module (or group of modules).

In order for the feature to work you have to run "make generate-mem-stats" and complile with the variable SHM_EXTRA_STATS defined.

Usage example:

    mem-group = "interest": "core" "tm"
    mem-group = "runtime": "dialog" "usrloc" "tm"

For the above example the generated statistics will be named: shmem_group_interest:fragments, shmem_group_interest:memory_used, shmem_group_interest:real_used.

Multiple groups can be defined, but they must not have the same name.

If you want to generate the statistics for the default group (all the other modules not included in a group) you have to complile with the variable SHM_SHOW_DEFAULT_GROUP defined.

3.48 mem_warming

Default value: off


Only relevant when the HP_MALLOC compile flag is enabled. If set to "on", on each startup, OpenSIPS will attempt to restore the memory fragmentation pattern it had before the stop/restart. If no pattern_file from a previous run is found, memory warning is skipped, and the memory allocator simply starts with a big chunk of memory, like all other allocators.


Memory warming is useful when dealing with high volumes of traffic (thousands of cps on multi-core machines - the more cores, the more useful), because processes must mutually exclude themselves when chopping up the initial big memory chunk. By performing fragmentation on startup, OpenSIPS will also behave optimally in the first minute(s) after a restart. Fragmentation usually lasts a few seconds (e.g. ~5 seconds on an 8GB shm pool and 2.4Ghz CPU) - traffic will not be processed at all during this period.

Example of usage:

    mem_warming = on

3.49 mem_warming_percentage

Default value: 75


How much of OpenSIPS's memory should be fragmented with the pattern of the previous run, upon a restart. Used at startup, if mem_warming is enabled.

Example of usage:

    mem_warming_percentage = 50

3.50 mem_warming_pattern_file

Default value: "CFG_DIR/mem_warming_pattern"


The memory fragmentation pattern of a previous OpenSIPS run. Used at startup, if mem_warming is enabled.

Example of usage:

    mem_warming_pattern_file = "/var/tmp/my_memory_pattern"

mem_dump

3.51 memdump | mem_dump

Log level to print memory status information (runtime and shutdown). It has to be less than the value of 'log_level' parameter if you want memory info to be logged. Default: memdump=L_DBG (4)

Example of usage:

    memdump=2

NOTE that setting memlog (see below), will also set the memdump parameter - if you want different values for memlog and memdump, you need to first set memlog and then memdump.

mem_log

3.52 memlog | mem_log

Log level to print memory debug info. It has to be less than the value of 'log_level' parameter if you want memory info to be logged. Default: memlog=L_DBG (4)

Example of usage:

    memlog=2

NOTE: by setting memlog parameter, the memdump will automatically be set to the same value (see memdump docs).

3.53 mcast_loopback

It can be 'yes' or 'no'. If set to 'yes', multicast datagram are sent over loopback. Default value is 'no'.

Example of usage:

    mcast_loopback=yes

3.54 mcast_ttl

Set the value for multicast ttl. Default value is OS specific (usually 1).

Example of usage:

    mcast_ttl=32

3.55 mhomed

Set the server to try to locate outbound interface on multihomed host. By default is not (0) - it is rather time consuming.

Example of usage:

    mhomed=1

3.56 mpath

Set the module search path. This can be used to simplify the loadmodule parameter

Example of usage:

    mpath="/usr/local/lib/opensips/modules"
    loadmodule "mysql.so"
    loadmodule "uri.so"
    loadmodule "uri_db.so"
    loadmodule "sl.so"
    loadmodule "tm.so"
    ...

3.57 open_files_limit

If set and bigger than the current open file limit, OpenSIPS will try to increase its open file limit to this number. Note: OpenSIPS must be started as root to be able to increase a limit past the hard limit (which, for open files, is 1024 on most systems).

Example of usage:

    open_files_limit=2048

3.58 poll_method

The poll method to be used by the I/O internal reactor - by default the best one for the current OS is selected. The available types are: poll, epoll_lt, sigio_rt, select, kqueue, /dev/poll.

Starting with version 2.2, epoll_et is deprecated and if it is used in the script, it will be automatically replaced by epoll_lt.

Example of usage:

    poll_method=select

3.59 port

The port the SIP server listens to. The default value for it is 5060.

Example of usage:

    port=5080

3.60 query_buffer_size

If set to a value greater than 1, inserts to DB will not be flushed one by one. Rows to be inserted will be kept in memory until until they gather up to query_buffer_size rows, and only then they will be flushed to the database.

Example of usage:

    query_buffer_size=5

3.61 query_flush_time

If query_buffer_size is set to a value greater than 1, a timer will trigger once every query_flush_time seconds, ensuring that no row will be kept for too long in memory.

Example of usage:

     query_flush_time=10

3.62 rev_dns

This parameter controls if the SIP server should attempt to lookup its own IP address in DNS. If this parameter is set to yes and the IP address is not in DNS a warning is printed on syslog and a "received=" field is added to the via header.

Default is no.

3.63 server_header

The body of Server header field generated by OpenSIPS when it sends a request as UAS. It defaults to "OpenSIPS (<version> (<arch>/<os>))".

Example of usage:

server_header="Server: My Company SIP Proxy"

Please note that you have to add the header name "Server:", otherwise OpenSIPS will just write a header like:

My Company SIP Proxy

3.64 server_signature

This parameter controls the "Server" header in any locally generated message.

Example of usage:

     server_signature=no

If it is enabled (default=yes) a header is generated as in the following example:

     Server: OpenSIPS (0.9.5 (i386/linux))

3.65 shm_hash_split_percentage

Only relevant when the HP_MALLOC compile flag is enabled. It controls how many memory buckets will be optimized. (e.g. setting it to 2% will optimize the first 81 most used buckets as frequency). The default value is 1.

3.66 shm_secondary_hash_size

Only relevant when the HP_MALLOC compile flag is enabled. It represents the optimization factor of a single bucket (e.g. setting it to 4 will cause the optimized buckets to be further split into 4). The default value is 8.

3.67 sip_warning

Can be 0 or 1. If set to 1 (default value is 0) a 'Warning' header is added to each reply generated by OpenSIPS. The header contains several details that help troubleshooting using the network traffic dumps.

Example of usage:

    sip_warning=0

3.68 tcp_children

Number of children processes to be created for reading from TCP connections. If no value is explicitly set, the same number of TCP children as UDP children (see "children" parameter) will be used.

Example of usage:

    tcp_children=4

3.69 tcp_accept_aliases

Default value 0 (disabled). If enabled, OpenSIPS will enforce RFC 5923 behaviour when detecting an ";alias" Via header field parameter and will reuse any TCP (or TLS, WS, WSS) connection opened for such SIP requests (source IP + Via port + proto) when sending other SIP requests backwards, towards the same (source IP + Via port + proto) pair. The final purpose of RFC 5923, after all, is to minimize the number of TLS connections a SIP proxy must open, due to the large CPU overhead of the connection setup phase.


On top of RFC 5923's connection reusage (aliasing) mechanism, TCP connections in OpenSIPS are also persistent across multiple SIP dialogs. This can be controlled with the tcp_connection_lifetime global parameter.


WARNING! Enabling the global tcp_accept_aliases parameter (RFC 5923) for end-user initiated connections (who are most likely grouped by one or more public IPs) is an open vector for call hijacking! In such platforms, we recommend using the force_tcp_alias() core function, in order to employ RFC 5923 behaviour only in conjunction with adjacent SIP proxies.

3.70 tcp_listen_backlog

The backlog argument defines the maximum length to which the queue of pending connections for the TCP listeners may grow. If a connection request arrives when the queue is full, the client may receive an error with an indication of ECONNREFUSED or, if the underlying protocol supports retransmission, the request may be ignored so that a later reattempt at connection succeeds.

Default configured value is 10.

3.71 tcp_connect_timeout

Time in milliseconds before an ongoing blocking attempt to connect will be aborted. Default value is 100ms.

Example of usage:

    tcp_connect_timeout = 5

3.72 tcp_connection_lifetime

Lifetime in seconds for TCP sessions. TCP sessions which are inactive for > tcp_connection_lifetime will be closed by OpenSIPS. Default value is defined in tcp_conn.h: #define DEFAULT_TCP_CONNECTION_LIFETIME 120. Setting this value to 0 will close the TCP connection pretty quick ;-). You can also set the TCP lifetime to the expire value of the REGISTER by using the tcp_persistent_flag parameter of the registrar module.

Example of usage:

    tcp_connection_lifetime = 3600

3.73 tcp_max_connections

Maximum number of active TCP accepted connections (i.e. initiated by remote endpoints). Once the limit is reached, any new incoming TCP connections will be rejected. The default is 2048. For outgoing TCP connections (initiated by OpenSIPS), there is currently no limit.

Example of usage:

    tcp_max_connections = 4096

3.74 tcp_max_msg_time

The maximum number of seconds that a SIP message is expected to arrive via TCP. If a single SIP packet is still not fully received after this number of seconds, the connection is dropped ( either the connection is very overloaded and this leads to high fragmentation - or we are the victim of an ongoing attack where the attacker is sending the traffic very fragmented in order to decrease our performance ). Default value is 4

Example of usage:

    tcp_max_msg_time = 8

3.75 tcp_no_new_conn_bflag

A branch flag to be used as marker to instruct OpenSIPS not to attempt to open a new TCP connection when delivering a request, but only to reuse an existing one (if available). If no existing conn, a generic send error will be returned.

This is intended to be used in NAT scenarios, where makes no sense to open a TCP connection towards a destination behind a NAT (like TCP connection created during registration was lost, so there is no way to contact the device until it re-REGISTER). Also this can be used to detect when a NATed registered user lost his TCP connection, so that opensips can disable his registration as useless.

Example of usage:

     tcp_no_new_conn_bflag = TCP_NO_CONNECT
     ...
     route {
         ...
         if (isflagset(DST_NATED) && $proto == "TCP")
             setbflag(TCP_NO_CONNECT);
         ...
         t_relay("0x02"); # no auto error reply
         $var(retcode) = $rc;
         if ($var(retcode) == -6) {
             #send error
             xlog("unable to send request to destination");
             send_reply("404", "Not Found");
             exit;
         } else if ($var(retcode) < 0) {
             sl_reply_error();
             exit;
         }
     }

3.76 tcp_threshold

A number representing the maximum number of microseconds sending of a TCP request is expected to last. Anything above the set number will trigger a warning message to the logging facility.

Default value is 0 ( logging disabled ).

Example of usage:

    tcp_threshold = 60000

3.77 tcp_keepalive

Enable or disable TCP keepalive (OS level).

Enabled by default.

Example of usage:

    tcp_keepalive = 1

3.78 tcp_keepcount

Number of keepalives to send before closing the connection (Linux only).

Default value: 0 (not set). Setting tcp_keepcount to any value will enable tcp_keepalive.

Example of usage:

    tcp_keepcount = 5

3.79 tcp_keepidle

Amount of time before OpenSIPS will start to send keepalives if the connection is idle (Linux only).

Default value: 0 (not set). Setting tcp_keepidle to any value will enable tcp_keepalive.

Example of usage:

    tcp_keepidle = 30

3.80 tcp_keepinterval

Interval between keepalive probes, if the previous one failed (Linux only).

Default value: 0 (not set). Setting tcp_keepinterval to any value will enable tcp_keepalive.

Example of usage:

    tcp_keepinterval = 10

3.81 tls_ca_list

3.82 tls_certificate

3.83 tls_ciphers_list

3.84 tls_domain

3.85 tls_handshake_timeout

3.86 tls_log

3.87 tls_method

3.88 tls_port_no

3.89 tls_private_key

3.90 tls_require_certificate

3.91 tls_send_timeout

3.92 tls_verify

3.93 tos

The TOS (Type Of Service) to be used for the sent IP packages (both TCP and UDP).

Example of usage:

    tos=IPTOS_LOWDELAY
    tos=0x10
    tos=IPTOS_RELIABILITY

#user uid

3.94 user uid (Removed in OpenSIPS 2.2)

Use the -u command line parameter instead.

3.95 user_agent_header

The body of User-Agent header field generated by OpenSIPS when it sends a request as UAC. It defaults to "OpenSIPS (<version> (<arch>/<os>))".

Example of usage:

user_agent_header="User-Agent: My Company SIP Proxy"

Please note that you have to include the header name "User-Agent:" as OpenSIPS does not add it and you will get an erroneous header like:

My Company SIP Proxy

3.96 wdir

The working directory used by OpenSIPS at runtime. You might find it usefull when come to generating core files :)

Example of usage:

     wdir="/usr/local/opensips"
     or
     wdir=/usr/opensips_wd

3.97 xlog_buf_size

Default value: 4096


Size of the buffer used to print a single line on the chosen logging facility of OpenSIPS. If the buffer is too small, an overflow error will be printed, and the concerned line will be skipped.

Usage example:

    xlog_buf_size = 8388608 #given in bytes

3.98 xlog_force_color

Default value: false


Only relevant when xlog is set to true. Enables the use of the color escape sequences, otherwise they will have no effect.

Usage example:

    xlog_force_color = true

3.99 xlog_default_level

Default value: -1


Default value for the logging level of the xlog core function, when the log_level parameter is omitted.

Usage example:

    xlog_default_level = 2 #L_NOTICE

↑ Contents


Page last modified on March 06, 2019, at 01:33 PM