- Building Telephony Systems with OpenSIPS(Second Edition)
- Flavio E. Goncalves Bogdan-Andrei Iancu
- 1222字
- 2021-08-20 10:43:15
Hardware and software requirements
There are no minimum hardware requirements for OpenSIPS. It can even run on an ordinary PC. On a server containing an Intel i7 920 @ 2.67GHz CPU with 6 GB of available RAM, OpenSIPS is capable of an astonishing 13,000 calls per second. The complete results can be found at http://www.opensips.org/About/PerformanceTests-StressTests.
The OpenSIPS software runs on a variety of Linux, BSD, and Solaris platforms. Some generic packages are available to a few varieties of Linux and Solaris. These packages can be downloaded from www.opensips.org/Resources/Downloads. The following packages are required to compile OpenSIPS:
- GCC (or any other C compiler such as suncc or icc)
- Bison or Yacc (Berkley yacc)
- Flex
- GNU make
- GNU tar
- GNU install
- libxml2-dev (if you are planning to use Presence)
Some modules such as MySQL, Postgres, RADIUS, dialplan, and others will require additional packages to compile. In the installation in this chapter, we will provide a string with all the modules required for this book. The module dependencies information is available in the module documentation (refer to http://www.opensips.org/Documentation/Modules-2-1).
Installing Linux for OpenSIPS
We recommend the usage of a virtual machine prepared using any hypervisor (VMware, VirtualBox, and so on) with the latest version of Debian installed (Version 7.7 at the time of writing this book). You can download it from http://cdimage.debian.org/debian-cd/.
Note
Warning: The instructions for this lab formats the computer. Back up all the data on your PC in a virtual environment such as VMware or Xen before proceeding to follow these instructions.
Carry out the following steps to install Linux for OpenSIPS:
- Insert the CD and boot the computer using Debian. Press Enter to start the installation:
In this screen, you can also select the boot and installation options. Sometimes, you will need to choose some hardware-specific parameters for your installation. Press F1 for help if needed.
- In the following Select your location screen, choose your location to be used in the installation process:
- Choose the keyboard layout, as shown in the following screenshot:
Note
It is very common to have to choose a keyboard layout, mainly in European and Asian countries.
- Choose Hostname, as follows:
Choose the name of the server. It is important because you will need to use this name later to access the server.
- Choose your Domain name, as shown in the following screenshot:
The domain name is obvious but important.
- Choose a time zone, as shown here:
Select the time zone. It is important to have the correct time zone, mainly for reports. If you don't do it correctly, you will end up with voicemail messages with the wrong time.
- Choose Partitioning method, as follows:
We could write a whole chapter about partitioning. Linux geeks will certainly use the manual option. For the purpose of learning, you can simply select the Guided - use entire disk option. Consult a Linux specialist for the best partitioning scheme for your server.
- Next, select the Select disk to partition option, as shown in the following screenshot:
Now, just select the disk being used to install Linux.
- In the following screen, select the All files in one partition (recommended for new users) option:
You can choose how to partition the system again. Let's stick with the default installation. Some advanced users may want to change it a bit.
- Select the Finish partitioning and write changes to disk option, as follows:
Never select this option if you want to preserve your disk. After the partitioning, all the pre-existing contents of the disk will be erased. So do it wisely. I use VMware to test OpenSIPS as it is free and creates a virtual machine where I can
- For the Write the changes to disks? option, select Yes, as shown here:
Now comes the scary part. Confirm that you want to erase all the contents of the disk. Well, think twice, or even three times, before saying yes.
Note
Warning: All the data on the disk will be destroyed!
- Set Root password to OpenSIPS, as follows:
Choose a password for your root user. This is the most important password on the system.
- Select the Re-enter password to verify option, as shown here:
Re-enter the password for confirmation purposes. Try to use a password that is hard to crack (minimum eight characters, letters, numbers, and some kind of special characters, such as * or #).
- Enter the full name for the user account as
opensips
, as shown in the following screenshot:Some systems require you to create at least one user. Let's do it, starting with full user name.
- Enter the name for the opensips user account:
- Enter the password for the opensips user account and re-enter to confirm:
Enter the password and confirm it. Try to use a password that is hard to crack.
- Next, you will be directed to the Configure the package manager screen, as follows:
During the process of installation, we will use several packages distributed by Debian.
- Select a mirror country, as shown in the following screenshot:
This screen will allow you to select from where you can download the packages.
- Select ftp.debian.org or your preferred mirror. Select the nearest one to speed up the downloading of the packages:
- Leave the HTTP proxy blank or fill in with the appropriate parameters:
If you use an HTTP proxy such as Squid or Microsoft ISA server, fill in the appropriate parameters in order to allow Internet access for the downloads.
- Select No for the package popularity survey:
The package popularity survey generates statistics about the most downloaded packages.
- Select Standard system utilities and SSH server:
Debian comes in several predefined installations such as desktop. The desktop installations, for example, installs a GUI for Linux such as GNOME or KDE. We don't need this for our installation. So, choose Standard system utilities and SSH server. Later, we will manually install components such as the Web server, Mail server, and SQL database.
- Select Yes to install the GRUB boot loader:
GRUB is a boot load manager for your server. It allows you to dual boot systems and to do some tricks during the boot process.
- At last, you will see Finish the installation screen, as follows:
Finish the installation and boot the system.
Downloading and installing OpenSIPS v2.1.x
It is even easier to install OpenSIPS using the Debian packages. We will go through the compilation process. It is more flexible and we may need to recompile OpenSIPS a few times in this material to include other modules. The installation process is shown step by step as follows:
Note
Warning: Detailed instructions change very often. Check the OpenSIPS website for updates.
- Update the operating system libraries by running the following command:
apt-get update
- Install the dependencies:
apt-get install gcc bison flex make openssl libmysqlclient-dev perl libdbi-perl libdbd-mysql-perl libdbd-pg-perl libfrontier-rpc-perl libterm-readline-gnu-perl libberkeleydb-perl mysql-server ssh libxml2 libxml2-dev libxmlrpc-core-c3-dev libpcre3 libpcre3-dev subversion libncurses5-dev git ngrep libssl-dev
Note
The MySQL server is not really a dependency, but we will install it in order to use later.
- Download the source code, as follows:
cd /usr/src git clone https://github.com/OpenSIPS/opensips.git -b 2.1 opensips_21
- Compile and install the core and modules. Include the
db_mysql
anddialplan
modules:cd opensips_21 make menuconfig
- Select Configure Compile Options | Configure Excluded Modules and select dialplan and db_mysql:
- Select the Compile And Install OpenSIPS option:
- Create the directory for the process identification file Process Identifier (PID):
mkdir /var/run/opensips
- 造個小程序:與微信一起干件正經事兒
- Hands-On RESTful Web Services with Go
- Learning Network Forensics
- 蘋果的產品設計之道:創建優秀產品、服務和用戶體驗的七個原則
- Programming with CodeIgniterMVC
- Learning iOS Security
- Python自然語言理解:自然語言理解系統開發與應用實戰
- HTML5移動前端開發基礎與實戰(微課版)
- MongoDB Cookbook
- Instant Pygame for Python Game Development How-to
- 自己動手構建編程語言:如何設計編譯器、解釋器和DSL
- Raspberry Pi Robotic Projects
- Learning GraphQL and Relay
- Mastering VMware vSphere Storage
- Python深度學習:基于PyTorch