# The Ctl Module

Andrei
Pelinescu-Onciul
iptelorg GmbH

    			andrei@iptel.org

2009
iptelorg GmbH

## Admin Guide

### Overview

This module implements the binrpc transport interface for &kamailio; RPCs. It supports various transports over which it speaks binrpc: Unix datagram sockets, Unix stream sockets, UDP and TCP. It also supports a backward compatible FIFO interface (using the old &kamailio; FIFO protocol).

By default (if no parameters are changed in the config file) it uses a Unix stream socket under /run/&kamailiobinary;: /run/&kamailiobinary;/&ctlsocket;. This socket is also the default for &sercmd;.

In general it's used in conjunction with &sercmd;. &sercmd; is a Unix tool for invoking &kamailio; RPC functions. It can be used both in interactive mode (supports tab-completion and history) or command line mode.

#### `&sercmd; example` usage

    $ &sercmd; ps
    11262	attendant
    11268	udp receiver child=0 sock=127.0.0.1:5060
    11269	udp receiver child=1 sock=127.0.0.1:5060
    11270	udp receiver child=0 sock=192.168.1.101:5060
    11271	udp receiver child=1 sock=192.168.1.101:5060
    11272	slow timer
    11273	timer
    11274	ctl handler
    11275	tcp receiver child=0
    11276	tcp receiver child=1
    11277	tcp main process

See utils/&sercmd;/EXAMPLES for more examples.

### BINRPC

binrpc is a &kamailio; proprietary binary protocol for invoking rpcs. It was designed such that it would minimize the packet sizes and it would be very fast to parse (as opposed to XML-rpc).

The binrpc encoding format is fully documented inside modules/ctl/binrpc.h.