Build, Install and Run Opensips

1. Download the source tree

  • Read-only:  git clone git://opensips.git.sourceforge.net/gitroot/opensips/sip_server sip_server_2
  • Read-write:  git clone ssh://SF_USERNAME@opensips.git.sourceforge.net/gitroot/opensips/sip_server sip_server_2

2. Make

  • make all:  under “sip_server_2” directory, run “make all”
  • make modules: under “sip_server_2” directory, run “make <module>”, where
   make protos - compile only protocol libraries (TCP and UDP)
   make modules - compile only core modules (only mi_fifo for the moment)
   make - compile only core

3. Config: opensips config file is in “sip_server_2/etc/opsnsips.cfg”

3.1 “core” section

  • daemon = 1/0 – if OpenSIPS should become daemon
  • chidlren = N – how many worker threads should be created
  • working_dir = path – directory to be used as working direction by OpenSIPS at runtime
  • chroot_dir = path – directory to change do after OpenSIPS starts
  • user = ID/name – system user to be used by OpenSIPS at runtime
  • group = ID/name – system group to be used by OpenSIPS at runtime
  • do_coredump = 1/0 – if OpenSIPS should coredump when crashing
  • rt_coredump = 1/0 – if OpenSIPS should do realtime coredump (per thread) or at the end (per process)
  • open_files = N – limit of open files
  • pid_file = file – file for OpenSIPS to write its PID
  • pgid_file = file – file for OpenSIPS to write its PGID

3.2 “log” section

  • debug = N – logging level to be used by OpenSIPS (4=DBG, 3=INFO, 2=NOTICE, 2=WARN, -1=ERR, -2=CRIT, -3=ALERT)
  • memlog = N – log level to be used for printing memory debug info
  • memdump = N – log level to be used for printing memory dumps
  • log_syslog = 0/1 – if OpenSIPS should log to syslog or standard error
  • log_name = NAME – what name to be used by OpenSIPS when logging to syslog
  • log_facility = FACILITY = – what log facility to be used by OpenSIPS when logging to syslog

3.3 “net” section

  • listen = [proto:]IP[:port] – listening interface to be used by OpenSIPS
  • net_tos = N – TOS to be used for sending traffic
  • udp_maxbuffer = N – size in bytes for the maximum size of the UDP buffer
  • udp_min_size = N – what’s the minim size of a UDP SIP message in order to be considered valid (otherwise discarded)
  • tcp_max_size = N – maximum size (in bytes) for a TCP package
  • tcp_via_alias = 1/0 – if OpenSIPS should do aliasing for the TCP connections
  • tcp_lifetime = N – lifetime (seconds) of a TCP connection after the last data sent/received
  • tcp_max_connections = N – maximum number of TCP connections to be allowed

3.4 “modules” section

  • path = PATH – path where the core modules are installed
  • load = MODULE_NAME – load a given core module

4. Run run multiple instances of opensips in daemon mode ( fork = yes )