tutorials:getting-started:main
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:getting-started:main [2015/07/22 06:41] – miconda | tutorials:getting-started:main [2019/08/28 03:44] (current) – [Linux/Unix] ali | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Getting Started | + | ====== |
A collection of guidelines and useful links to smoothen the understanding and | A collection of guidelines and useful links to smoothen the understanding and | ||
Line 7: | Line 7: | ||
The first version of the tutorial was written for Kamailio v4.3.x. | The first version of the tutorial was written for Kamailio v4.3.x. | ||
+ | |||
+ | It is recommended that you read first all the content of this tutorial and | ||
+ | then start installing Kamailio, because some more relevant information might be | ||
+ | found later for specific use cases. | ||
===== Prerequisites ===== | ===== Prerequisites ===== | ||
Line 46: | Line 50: | ||
Other online SIP learning resources: | Other online SIP learning resources: | ||
- | * http:// | + | * [[http:// |
+ | * [[http:// | ||
+ | * [[http:// | ||
SIP Books: | SIP Books: | ||
- | * SIP Beyond VoIP | + | * [[http:// |
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
==== Logical Programming ==== | ==== Logical Programming ==== | ||
Line 79: | Line 87: | ||
Troubleshooting Kamailio and SIP requires knowledge of various tools for | Troubleshooting Kamailio and SIP requires knowledge of various tools for | ||
- | reading and searching log files (e.g., grep, awk), sniffing the network (e.g., | + | reading and searching log files (e.g., grep, awk), sniffing the network (e.g., sngrep, |
ngrep, tcpdump, wireshark). Of course, knowing to work with text editor, | ngrep, tcpdump, wireshark). Of course, knowing to work with text editor, | ||
especially the ones for terminal if the server is remote, is quite obvious | especially the ones for terminal if the server is remote, is quite obvious | ||
Line 88: | Line 96: | ||
==== From Sources ==== | ==== From Sources ==== | ||
+ | Install current stable version: | ||
+ | |||
+ | * [[install: | ||
+ | |||
+ | Install development version (master branch): | ||
+ | |||
+ | * [[install: | ||
+ | |||
+ | When installing from sources: | ||
+ | |||
+ | * configuration files are deployed in: / | ||
+ | * binary files are deployed in: / | ||
==== Debian ==== | ==== Debian ==== | ||
+ | |||
+ | Kamailio is part of latest official stable Debian distributions (and its Ubuntu cousin), but might be an older version. | ||
+ | |||
+ | To use most recent Kamailio release, you can use the APT repositories hosted by Kamailio project, see details at: | ||
+ | |||
+ | * [[packages: | ||
+ | |||
+ | Then, the typical way of installing packages can be used: | ||
+ | |||
+ | < | ||
+ | apt-get update | ||
+ | apt-get install kamailio | ||
+ | </ | ||
+ | |||
+ | Various modules are packaged separately, you can search the repository to see what is available: | ||
+ | |||
+ | < | ||
+ | apt-cache search kamailio | ||
+ | </ | ||
+ | |||
+ | Install the other packages of the modules you may need, like mysql or tls modules -- they can be installed with: | ||
+ | |||
+ | < | ||
+ | apt-get install kamailio-mysql-modules kamailio-tls-modules | ||
+ | </ | ||
+ | |||
+ | When installing from deb packages: | ||
+ | |||
+ | * configuration files are deployed in: / | ||
+ | * binary files are deployed in: /usr/sbin/ | ||
==== CentoOS ==== | ==== CentoOS ==== | ||
+ | Kamailio RPMs are available for several distributions, | ||
+ | Enterprise, CentOS, OpenSuse and Fedora. For more details, see: | ||
+ | |||
+ | * [[packages: | ||
+ | |||
+ | You can add them to YUM configuration and then install Kamailio with usual yum | ||
+ | commands: | ||
+ | |||
+ | < | ||
+ | yum install kamailio | ||
+ | ... | ||
+ | yum install kamailio-mysql-modules kamailio-tls-modules | ||
+ | </ | ||
+ | |||
+ | When installing from rpm packages: | ||
+ | |||
+ | * configuration files are deployed in: / | ||
+ | * binary files are deployed in: /usr/sbin/ | ||
===== Configuration File ===== | ===== Configuration File ===== | ||
==== Overview ==== | ==== Overview ==== | ||
+ | If you installed from sources, then the configuration file is located at: | ||
+ | |||
+ | * / | ||
+ | |||
+ | If you installed from packages, then the configuration file is located at: | ||
+ | |||
+ | * / | ||
+ | |||
+ | ==== Configuration Scripting Language ==== | ||
+ | |||
+ | Kamailio uses its own configuration file language. Its structure is described in the Core Cookbook: | ||
+ | |||
+ | * [[cookbooks: | ||
==== Default Configuration File ==== | ==== Default Configuration File ==== | ||
+ | |||
+ | The default configuration file is trying to provide the features for a simple | ||
+ | VoIP (telephony) provider. | ||
+ | |||
+ | |||
+ | * user authentication | ||
+ | * IP authorization | ||
+ | * accounting | ||
+ | * registrar and location services | ||
+ | * attacks detection and blocking (anti-flood protection) | ||
+ | * NAT traversal | ||
+ | * short dialing on server | ||
+ | * multiple identities (aliases) for subscribers | ||
+ | * multi-domain support | ||
+ | * routing to a PSTN gateway | ||
+ | * routing to a voicemail server | ||
+ | * TLS encryption | ||
+ | * instant messaging (pager mode with MESSAGE requests) | ||
+ | * presence services | ||
+ | |||
+ | Not all the above features are enabled by default -- read the comments at the | ||
+ | top of **kamailio.cfg** in order to find what tokens must be defined. | ||
+ | |||
+ | === Enabling User Authentication === | ||
+ | |||
+ | Initial installation doesn' | ||
+ | Enabling that means defining WITH_MYSQL and WITH_AUTH -- | ||
+ | that means adding the next two lines after the first line (after the one with | ||
+ | # | ||
+ | |||
+ | <code c> | ||
+ | #!define WITH_MYSQL | ||
+ | #!define WITH_AUTH | ||
+ | </ | ||
+ | |||
+ | Obviously, for the above to really work, you need to install MySQL server and | ||
+ | create the database required by Kamailio (see **kamdbctl** tool). You need | ||
+ | also to add subscribers (username/ | ||
+ | can use **kamctl** tool for managing subscriber records. | ||
+ | |||
+ | |||
+ | === Enabling Persistent Location === | ||
+ | |||
+ | Initial installation doesn' | ||
+ | you restart Kamailio, the registration records are lost. If you enable it, | ||
+ | registration records are saved to database and reload at restart. | ||
+ | |||
+ | To enable persistent location records, you have to define WITH_USRLOCDB -- add | ||
+ | the next line in **kamailio.org** after those line you added in the previous | ||
+ | section: | ||
+ | |||
+ | <code c> | ||
+ | #!define WITH_USRLOCDB | ||
+ | </ | ||
+ | |||
+ | === Enabling NAT Traversal === | ||
+ | |||
+ | The default **kamailio.cfg** comes with NAT traversal support, relying on | ||
+ | RTPProxy for RTP relaying. The NAT traversal support has to be enabled by | ||
+ | defining WITH_NAT: | ||
+ | |||
+ | <code c> | ||
+ | #!define WITH_NAT | ||
+ | </ | ||
+ | |||
+ | You have to install RTPProxy applicationand configure it to use the same | ||
+ | control socket as in **kamailio.cfg** parameter for **rtpproxy** module. | ||
===== Tools ===== | ===== Tools ===== | ||
==== kamctl ==== | ==== kamctl ==== | ||
+ | |||
+ | Kamctl is part of Kamailio project (in the same source tree) and installed by default. | ||
+ | |||
+ | It has a configuration file named **kamctlrc**, | ||
+ | |||
+ | This is the tool to manage kamailio from command line, providing lots of operations, such as adding/ | ||
+ | |||
+ | When needed to interact with Kamailio, it does it via FIFO file created by **mi_fifo** module. Operations to the database are done by connecting directly to the database server. | ||
+ | |||
+ | ==== kamdbctl ==== | ||
+ | |||
+ | Kamctl is part of Kamailio project (in the same source tree) and installed by default. | ||
+ | |||
+ | It uses the same configuration file like **kamctl**, respectively the **kamctlrc**. | ||
+ | |||
+ | The tool can be used to create and manage the database structure needed by Kamailio, therefore it should be immediately after Kamailio installation, | ||
+ | |||
+ | It is not used for managing the records inside the database tables, just for database structure and access to the database (e.g., granting/ | ||
==== kamcmd ==== | ==== kamcmd ==== | ||
+ | |||
+ | Kamctl is part of Kamailio project (in the same source tree) and installed by default. | ||
+ | |||
+ | This is an application that can send RPC commands to Kamailio from command line. It requires that the **ctl** module is loaded by Kamailio. | ||
==== siremis ==== | ==== siremis ==== | ||
+ | |||
+ | It is a web management interface for Kamailio, written in PHP -- more at: | ||
+ | |||
+ | * http:// | ||
==== kamcli ==== | ==== kamcli ==== | ||
- | ===== Typical Use Cases ===== | + | It is a command line application write in Python, more or less an alternative to **kamctl**. It has a modular architecture, |
- | ==== NAT Traversal | + | See more at: |
+ | |||
+ | * https:// | ||
+ | |||
+ | ===== Typical Use Cases ===== | ||
==== VoIP Provider ==== | ==== VoIP Provider ==== | ||
+ | |||
+ | The default **kamailio.cfg** is practically an implementation of simple SIP | ||
+ | operator services. See the section above dedicated to default configuration | ||
+ | file for more details. | ||
==== Load Balancing ==== | ==== Load Balancing ==== | ||
+ | |||
+ | See dispatcher module: | ||
+ | |||
+ | * http:// | ||
==== Least Cost Routing ==== | ==== Least Cost Routing ==== | ||
+ | |||
+ | See the modules: | ||
+ | |||
+ | * http:// | ||
+ | * http:// | ||
+ | * http:// | ||
==== IMS/VoLTE ==== | ==== IMS/VoLTE ==== | ||
+ | |||
+ | Look at the modules that have the name prefixed with **ims_** or starting with | ||
+ | **cdp** (the later are for Diameter): | ||
+ | |||
+ | * http:// | ||
+ | |||
+ | Example of configuration files for different IMS roles (eg., ICSCF, PCSCF, | ||
+ | SCSCF) are available in the source tree, look inside the sub-directory | ||
+ | **examples/ | ||
==== Instant Messaging and Presence ==== | ==== Instant Messaging and Presence ==== | ||
+ | |||
+ | Look at the modules that have the name prefixed with **presence** (presence | ||
+ | server) or **pua** (presence user agent): | ||
+ | |||
+ | * http:// | ||
+ | |||
==== WebRTC ==== | ==== WebRTC ==== | ||
+ | |||
+ | See the module: | ||
+ | |||
+ | * http:// | ||
===== Useful Resources ===== | ===== Useful Resources ===== | ||
- | ==== Books ==== | + | ==== Kamailio |
+ | |||
+ | * [[http:// | ||
- | * SIP Routing with Kamailio | + | ==== Kamailio |
- | ==== Online ==== | + | * [[http:// |
+ | * [[http:// | ||
- | * Kamailio Devel Tutorial | + | ==== Related Open Source Projects ==== |
- | * SER Getting Started | + | |
+ | Open source projects embedding Kamailio that can help rolling out specific use cases. | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[http:// |
tutorials/getting-started/main.1437547319.txt.gz · Last modified: 2015/07/22 06:41 by miconda