One of the goals for the OpenSIPS project is to make the software simpler to use. A great milestone in this direction was the script generator. Now, we can generate scripts for several scenarios. This can save a lot of time in coding and reduce errors. This book will use the Residential Script as the basis for most of the chapters. So, let's generate a residential script to start with:
Navigate to Generate OpenSIPS Script | Residential Script | Configure Residential Script. For now, just enable TCP:
Generate the script and copy it to /usr/local/etc/opensips and change the specific date generated by your installation:
Edit /etc/default/opensips and change the shared memory parameter to 128 MB, packaged memory to 4 MB, and RUN_OPENSIPS to yes. You can check the usage of the shared memory and package memory using the following commands:
It is hard to predict exactly how much memory your system will consume. It depends on the routing script, caching, and number of transactions and routes. You will probably be surprised on how low the memory requirements are.
To simplify the access, create a symbolic link to /usr/local/etc/opensips at /etc/opensips:
ln –s /usr/local/etc/opensips /etc/opensips
Restart the computer to see if OpenSIPS starts. Confirm using the following command:
ps-ef |grep opensips
Note
It is highly recommended that you change the username and group used to run OpenSIPS in the /etc/init.d/opensips file.
The OpenSIPS v2.1.x directory structure
After the installation, OpenSIPS will create a file structure. It is important to understand the file structure in order to locate the main folders where the system is stored. You will need this information to update or remove the software.
The configuration files
This is the directory of the configuration files with their respective samples:
opensips-1:/etc/opensips# ls -l-rw------- 1 root root 6226 Dec 22 09:55 opensips.cfg-rw------- 1 root staff 6078 Dec 22 10:05 opensips.cfg.sample-rw-r--r-- 1 root staff 3696 Dec 22 09:41 opensipsctlrc-rw-r--r-- 1 root staff 3696 Dec 22 10:05 opensipsctlrc.sample-rw-r--r-- 1 root staff 3028 Dec 22 09:41 osipsconsolerc-rw-r--r-- 1 root staff 3028 Dec 22 10:05 osipsconsolerc.sampledrwxr-sr-x 4 root staff 4096 Dec 22 10:05 tls
Modules
This is the directory for the modules. It is important to check if all the required modules are present after compilation: