-
Notifications
You must be signed in to change notification settings - Fork 499
Configuration
The configuration is located by default in ~/.baresip. This can be changed by command line argument -f.
baresip -f path_to_your_config
In your config directory you find these files:
| File | Description |
|---|---|
| config | Global configuration |
| accounts | User-Agents that should be created |
| contacts | Contacts (address book) |
| uuid | Universally Unique Identifier |
The file config in the configuration directory supports the following settings
for the core of baresip whose code is located in the src directory.
Configuration settings that are module specific can be found on the wiki pages
of the specific modules.
The accounts file is documented here Accounts.
You find an example for the config file in the baresip repository in:
docs/examples/config
values: epoll, kqueue, poll, select
The polling method used.
default: baresip detects the best polling method available on the system.
typical value: 0.0.0.0:5060
Optionally specify the local IP address and port to listen on incoming SIP requests. For TLS the port number +1 will be applied. If not set baresip opens a UDP, a TCP socket with arbitrary port number p. Each for the local IPv4 and IPv6 address. Additionally an IPv4 and an IPv6 socket for TLS are opened onport p+1.
E.g. to bind to socket 5060 use:
sip_listen 0.0.0.0:5060
This opens UDP and TCP sockets on port 5060 for IPv4 and IPv6 on the local IP
address of the network interface specified with net_interface. And this opens
also two TCP socket for TLS on port 5061, one for IPv4 and one for IPv6.
default: not set.
typical value: cert.pem
TLS certificate and private key used to identify this device.
default: not set.
typical value: /etc/ssl/certs/ca-certificates.crt
TLS trusted certificate file that may contain multiple CA certificates in PEM format.
default: not set
typical value: /etc/ssl/certs
TLS trusted certificate path that may contain multiple CA certificate files in PEM format.
default: not set
typical value: tls,wss
A comma separated list of supported transport protocols.
default: udp,tcp,tls,ws,wss
typical value: tcp,tls
A comma separated list of transport protocols. For all transport protocols in this list, incoming requests of that transport protocol are verified to have originated from a registered server's IP address and all other incoming requests are not accepted. Further, no listening socket is opened for the connection-oriented transport protocols listed in filter_registrar.
default: not set
values: udp, tcp, tls, ws, wss
The default transport protocol for outgoing peer-to-peer calls. This is used only if there are multiple local accounts (regint=0) with different transport protocols.
default: udp
values: yes, no
Set this to yes if for SIP TLS the peer certificate should be verified.
A value of no means that the peer is not verified. Then SIP TLS security is
reduced to only encrypt the SIP packets.
default: no
values: byte
Type of service field of the IPv4 header.
default: 0xa0=160
7 6 5 4 3 2 1 0
+-----+-----+-----+-----+-----+-----+-----+-----+
| PRECEDENCE | TOS | MBZ |
+-----+-----+-----+-----+-----+-----+-----+-----+
- TOS:
bit 4 - low delay
bit 3 - high throughput
bit 2 - high reliability
bit 1 - low cost - MBZ:
bit 0 - zero
values: yes, no
If yes adds a random suffix to the contact user for each UA. Per default (cuser_random=no) there is no contact user suffix as long if it is unique in the current runtime. Note: There are some SIP registrars that do not accept a SIP REGISTER with a contact user suffix. In such a case cuser_random must not be yes and the account user has to be set unique over all accounts to prevent that a suffix is added.
default: no
values in seconds.
Local timeout for incoming calls.
default: 120
values: positive integer
Maximum number of calls allowed. Used to reject incoming calls.
default: 4
values: yes, no
Ensures that only one call can be active (established and not put on-hold locally).
default: yes
value: <path>
typical value: /usr/local/share/baresip
Optionally you may specify the path where the audio files for the ring, ringback and error tones are located.
default: depends on the build target system
value: <module>,<device>
The baresip module and the speaker device used for audio playback of incoming speech and the ring, ringback and error tones.
default: alsa,default
value: <module>,<device>
The baresip module and the microphone device used for audio recording of the local speech.
default: alsa,default
value: <module>,<device>
The baresip module and the speaker device used for audio playback of the signal tone for an incoming SIP text message.
default: alsa,default
typical values: 16000, 32000, 48000, ...
Optionally bind the audio sample rate for the microphone recording to a specified value. If not set, the sample rate is chosen to fit the codecs sample rate. Thus no re-sampling has to be done.
default: not set
typical values: 16000, 32000, 48000, ...
Optionally bind the audio sample rate for the audio player to a specified value. If not set, the sample rate is chosen to fit the codecs sample rate. Thus no re-sampling has to be done.
default: not set
typical values: 0, 1, 2
Optionally set the number of channels of the microphone. A value of zero means that the channel number is chosen to fit the codecs channel number. Thus no re-sampling has to be done.
default: 0
typical values: 0, 1, 2
Optionally set the number of channels of the speaker device. A value of zero means that the channel number is chosen to fit the codecs channel number. Thus no re-sampling has to be done.
default: 0
values: poll, thread
The RTP transmission mode for audio.
-
poll: The microphone read thread also does RTP sending. Should be used for low latency sending. -
thread: A separate thread for RTP sending reduces the jitter for outgoing audio RTP packets. Should be used if the audio source device (the microphone) has too high jitter.
default: poll
values: yes, no
Enables client-to-mixer audio level RTP Header Extension. The audio volume is computed and sent with the RTP packet.
default: no
values: s16, float, s24_3le
Sample format of the microphone device.
default: s16
values: s16, float, s24_3le
Sample format of the speaker device.
default: s16
values: s16, float, s24_3le
Sample format of the audio encoder.
default: s16
values: s16, float, s24_3le
Sample format of the audio decoder.
default: s16
values: <min>-<max>
Optionally change the default audio buffer for the remote speech located before the speaker device. The audio buffer has to be chosen large enough to compensate the expected network jitter, except the jitter buffer is used.
Note: See also settings jitter_buffer_type and jitter_buffer_delay!
default: 20-160 # ms
value: fixed, adaptive
This settings configures the mode of the RX audio buffer. This audio buffer compensates the network jitter. The two modes are:
-
fixed: The audio buffer has fixed size. The minimum value has to be chosen large enough to compensate expected network jitter. -
adaptive: The audio buffer has a dynamic size which depends on the computed network jitter.
default: fixed
values: float in [dB]
The audio level for silence as negative dB value. The adaptive audio buffer only does its latency adjustment during periods of silence. This avoids unwanted audio artifacts. Set this value to 0.0 in order to disable the silence detection.
Note: If this value is chosen lower than the remote microphone noise floor, than the latency can't be adjusted according to the network jitter in adaptive mode.
default: -35.0
values: int
Payload type for telephone-event.
default: 101
- value:
<module>,<device> - typical value:
v4l2,/dev/video0
The camera module and device used for SIP video calls.
default: not set
- value:
<module>,<device> - typical value:
x11,-
The video display module and device used for SIP video calls.
default: not set
value: <width>,<height>
The camera resolution. Is also used for video filters and depends on the filter module how it is used.
default: 640,480
value: a integer in [bit/s]
The upper limit for bit rate of the outgoing video stream used by the encoder.
default: 1000000
value: a integer in [bit/s]
Bandwidth limit bitrate. Needs to be bigger than video_bitrate since
packetization/fragmentation adds a overhead.
default: 0
value: a float in [frames/s]
The video frame rate that will be offered during the SDP handshake. It will also be used if no frame rate was handled out during SDP handshake for:
- the camera frame rate
- the encoder frame rate
- for optional video filters
default: 30
values: yes, no
Full screen flag for the video display.
default: yes
values: yuv420p,yuyv422,uyvy422,rgb32,argb,rgb565,rgb555,nv12,nv21,yuv444p
Video camera and encoding pixel format. Also used for optional video filters. If, however the camera pixel format does not match the configured value, then a software pixel format conversion is applied before encoding.
default: yuv420p
Type Of Service (TOS) setting for audio RTP socket
default: 0xb8=184
Type Of Service (TOS) setting for video RTP socket
default: 0x88=136
value: <min>-<max>
The port range for RTP listen sockets.
default: 1024-49152
- value:
<min>,<max>in[kbit/s] - typical value:
512-1024
Optionally you may specify the RTP bandwidth that will be put in the SDP media
as bandwidth field for audio and video. If specified then the bandwidth for
audio is set to a fixed value of 128 kbit/s. The video gets the bandwidth
rtp_bandwidth - 128 kbit/s.
default: not set
Defines min./max. audio buffer delay in milliseconds
default: 100-200
Defines max. buffer size in packages (pre-allocated)
default: 50
Defines min./max buffer delay in milliseconds
default: 100-200
Defines max. buffer size in packages (pre-allocated)
default: 250
value: off, fixed, adaptive
The jitter buffer does packet reordering and thus have to be large enough to put RTP packets into correct order.
Select the type of jitter buffer used for incoming RTP audio or video.
-
off: No jitter buffer is used. -
fixed: The jitter buffer has fixed size. -
adaptive: The jitter buffer has a dynamic size which depends on the frequency of too late packets.
Note: See also setting audio_buffer_mode!
default: fixed
values: yes, no
Flag for an optional RTP statistics output at the end of the call.
default: no
value: integer in [s]
A optional timeout for incoming RTP packets after which a call should be terminated. A value of zero means that there is no timeout and a call without incoming RTP is kept running until terminated manually.
default: 0
values: main, thread
Selects if incoming RTP packets should be processed in the main thread or in a separate thread. This is currently used only for audio streams.
default: main
value: <IP>:<port>
Optionally specify up to four static DNS server. If not specified they are retrieved from the system (e.g. /etc/resolv.conf)
default: not specified
value: <IP>:<port>
If no dns server is detected/available the dns_fallback is used (extends the system ones).
default: not specified
value: yes or no
Use async getaddrinfo for A and AAAA records and considers /etc/hosts
default: no
- value:
ipv4 or ipv6
Optionally you may specify the address family (IPv4 or IPv6) that baresip is using.
default: If not specified, baresip uses IPv4 if only IPv4 is available, IPv6 if only IPv6 is available, and both if both are available.
- value: a string
- typical value:
eth0
Optionally you may specify the network interface used. If not specified baresip will detect the network interface that is connected to the internet.
default: not specified
value: <module>
typical values: gst,aufile, or any audio source that reads from a file
Optionally you may specify a module that should be used to read and decode an audio file in order to play ring or other tones. If not specified the internal WAV file reader that is provided by the library rem is used.
Note: If the internal WAV file reader is used, then the whole WAV file is read
and hold in RAM. Then the playback is done. Where as if file_ausrc is set,
then reading and decoding of samples is done in junks which are written to the
audio speaker immediately.
default: not specified
typical values: 8000,16000,32000,...
Optional sample rate for tones played with module defined with file_ausrc.
It depends on the module used if this setting is used or not. E.g.
- module
aufileis able to read the sample rate form the WAV header and use this for the playback, - in contrast to module
gst. This uses16000as default sample rate which can be overwritten by this setting. If the sample rate of the file does not match this setting, gstreamer will do re-sampling.
values: 1, 2
Optional number of channels for tones played with module specified with
file_ausrc. Similar statements as for file_srate apply also here.
There are three different kinds of modules
-
normal modules: Are loaded and initialized first and hold in a module list. These kind of modules implement baresip audio/video sources, filter, codecs and player. They may also register User-Interfaces or media encryption processors. Sometimes they also register commands.
-
temporary modules: Are loaded at startup and after initialization immediately unloaded. They are not kept in the module list.
-
application modules: Are loaded and initialized last and also put in the module list. They contain application specific functions. The main purpose of an application module is to register commands that define the API to the user or an external application process. These commands can be called via a User-Interface module by the user or by a module that provides an interprocess communication channel.
value:
typical value: /usr/local/lib/baresip/modules
Optionally specify the path where your module libraries are located.
default: depends on the build target system
value: .so
Loads a normal module.
value: .so
Loads a temporary module.
value: .so
Loads an application module.