# Parameters

## `binrpc` (string)

Specifies the transport used for the binrpc protocol. The following transport protocol are supported: Unix datagram sockets, Unix stream sockets, UDP and TCP.

The format is: [ protocol:] address_port|path .

- For Unix sockets: [unixd|unixs|unix]:path where `"unixd"` means Unix datagram sockets and `"unix"` `"unixs"` mean Unix stream sockets. Examples: "unixd:/tmp/unix_dgram", "unixs:/tmp/unix_stream", "unix:/tmp/unix_stream".

- For UDP or TCP sockets: [udp|tcp]:address:port. If the address is "*" or missing, it will bind to all the local addresses (0.0.0.0). Examples: "udp:localhost:2046", "tcp:localhost:2046", "tcp:3012", "udp:*:3012".

If the protocol part is missing and the address/path part looks like a file system path it will default to a Unix stream socket and if not to a Unix UDP socket. Examples:

- "/tmp/unix_test" - equivalent to "unixs:/tmp/unix_test".
- "localhost:3000" - equivalent to "udp:localhost:3000".

Multiple transports / listen addresses can be specified, just by setting the parameter multiple times.

Default: "unix:/run/&kamailiobinary;/&kamailiobinary;_ctl" (Unix stream socket). The default value is used only if no `binrpc` parameter is found in the config file.

### Set `binrpc` parameter

    loadmodule "ctl"
    # optional listen addresses, if no one is specified,
    # ctl will listen on unixs:/tmp/kamailio_ctl

    modparam("ctl", "binrpc", "unix:/run/&kamailiobinary;/&kamailiobinary;_ctl") # default
    modparam("ctl", "binrpc", "udp:localhost:2046")
    modparam("ctl", "binrpc", "tcp:localhost:2046")
    modparam("ctl", "binrpc", "unixd:/tmp/unix_dgram")  # unix datagram
    modparam("ctl", "binrpc", "unixs:/tmp/unix_stream") # unix stream
    modparam("ctl", "binrpc", "unix:/tmp/unix_default") # unix stream
    modparam("ctl", "binrpc", "/tmp/unix_test")         # unix stream
    modparam("ctl", "binrpc", "localhost:3000")         # udp
    modparam("ctl", "binrpc", "tcp:3012")               # tcp any , port 3012
    modparam("ctl", "binrpc", "udp:*:3012")             # udp any , port 3012

## `binrpc_buffer_size` (integer)

The size of the internal buffer used for printing elements of the RPC response (e.g., internal RPC printf()). The value is given in bytes.

Default: 1024.

### Set `binrpc_buffer_size` parameter

                ...
                modparam("ctl", "binrpc_buffer_size", 4096)
                ...

## `mode` (integer)

Permissions used for the created Unix sockets or for the fifo.

Default: 0600.

### Set `mode` parameter

    modparam("ctl", "mode", 0600) # permissions

## `user` (integer or string)

Username or uid used for the created Unix sockets or for the fifo.

Default: not set (the user under which &ser; runs).

### Set `user` parameter

    ...
    modparam("ctl", "user", "andrei")
    ...

## `group` (integer or string)

Group name or gid used for the created Unix sockets or for the fifo.

Default: not set (the group under which &ser; runs).

### Set `group` parameter

    ...
    modparam("ctl", "group", 100)
    ...

## `fifo` (integer)

fifo used for the obsolete fifo protocol. The fifo protocol can be run over a real fifo, over UDP or over TCP. Format: [protocol:]path|address. If no protocol is specified the default is "fifo". Examples: "fifo:/tmp/kamailio_fifo", "/tmp/kamailio_fifo2", "udp:*:2050", "tcp:localhost:2050". For more details on the UDP and TCP formats see `binrpc`. Multiple fifos or fifo transports can be used in the same time (just by setting the `fifo` parameter multiple times in the config).

Default: not set (no fifo will be used).

### Set `fifo` parameter

    ...
    # old fifo support
    modparam("ctl", "fifo", "fifo:/tmp/kamailio_fifo")      # classic fifo
    modparam("ctl", "fifo", "/tmp/kamailio_fifo2")
    modparam("ctl", "fifo", "udp:*:2050")              # fifo protocol over udp
    modparam("ctl", "fifo", "tcp:*:2050")              # fifo over tcp
    ...

## `autoconversion` (integer)

Enable or disable automatic type conversion globally, for all the methods parameters. If on, a type mismatch in a method parameter will not cause a fault if it is possible to automatically convert it to the expected type.

Default: off

It is recommended to leave this parameter to its default off value and fix instead the client application (which should use the proper types) or to modify the target rpc to accept any type (see the rpc scan '.' modifier).

### Set the `autoconversion` parameter

    ...
    modparam("ctl", "autoconversion", 1)
    ...

## `binrpc_max_body_size` (integer)

Set the size of binrpc buffer for RPC reply. Value represents kilobytes.

Default: 32 (meaning 32KB);

### Set the `binrpc_max_body_size` parameter

    ...
    modparam("ctl", "binrpc_max_body_size", 16)
    ...

## `binrpc_struct_max_body_size` (integer)

Set the size of binrpc structure buffer for RPC reply. Value represents kilobytes.

Default: 8 (meaning 8KB);

### Set the `binrpc_struct_max_body_size` parameter

    ...
    modparam("ctl", "binrpc_struct_max_body_size", 4)
    ...