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/23 17:34] – miconda | tutorials:getting-started:main [2019/08/28 03:44] (current) – [Linux/Unix] ali | ||
---|---|---|---|
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 83: | 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 99: | Line 103: | ||
* [[install: | * [[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 | + | Kamailio is part of latest official stable Debian |
To use most recent Kamailio release, you can use the APT repositories hosted by Kamailio project, see details at: | To use most recent Kamailio release, you can use the APT repositories hosted by Kamailio project, see details at: | ||
- | * [[packages: | + | * [[packages: |
Then, the typical way of installing packages can be used: | Then, the typical way of installing packages can be used: | ||
Line 125: | Line 134: | ||
apt-get install kamailio-mysql-modules kamailio-tls-modules | 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 ===== | ||
Line 153: | Line 266: | ||
The tool can be used to create and manage the database structure needed by Kamailio, therefore it should be immediately after Kamailio installation, | 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/ | + | 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 ==== | ||
Line 176: | Line 289: | ||
===== Typical Use Cases ===== | ===== Typical Use Cases ===== | ||
- | |||
- | ==== 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 | ||
- | </ | ||
==== VoIP Provider ==== | ==== VoIP Provider ==== | ||
- | The default **kamailio.cfg** is practically an implementation of simple SIP operator services: | + | The default **kamailio.cfg** is practically an implementation of simple SIP |
- | + | operator services. See the section | |
- | * user authentication | + | file for more details. |
- | * IP authorization | + | |
- | * accounting | + | |
- | * registrar and location services | + | |
- | * attacks detection and blocking (anti-flood protection) | + | |
- | * NAT travesal | + | |
- | * 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 | + | |
==== Load Balancing ==== | ==== Load Balancing ==== | ||
Line 221: | Line 311: | ||
==== 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 ===== | ||
Line 236: | Line 345: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
+ | |||
+ | ==== Related Open Source Projects ==== | ||
+ | |||
+ | Open source projects embedding Kamailio that can help rolling out specific use cases. | ||
+ | |||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[http:// |
tutorials/getting-started/main.1437672867.txt.gz · Last modified: 2015/07/23 17:34 by miconda