官术网_书友最值得收藏!

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:

  1. 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.

  2. In the following Select your location screen, choose your location to be used in the installation process:
  3. 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.

  4. 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.

  5. Choose your Domain name, as shown in the following screenshot:

    The domain name is obvious but important.

  6. 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.

  7. 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.

  8. Next, select the Select disk to partition option, as shown in the following screenshot:

    Now, just select the disk being used to install Linux.

  9. 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.

  10. 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

  11. 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!

  12. Set Root password to OpenSIPS, as follows:

    Choose a password for your root user. This is the most important password on the system.

  13. 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 #).

  14. 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.

  15. Enter the name for the opensips user account:
  16. 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.

  17. 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.

  18. Select a mirror country, as shown in the following screenshot:

    This screen will allow you to select from where you can download the packages.

  19. Select ftp.debian.org or your preferred mirror. Select the nearest one to speed up the downloading of the packages:
  20. 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.

  21. Select No for the package popularity survey:

    The package popularity survey generates statistics about the most downloaded packages.

  22. 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.

  23. 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.

  24. 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.

  1. Update the operating system libraries by running the following command:
    apt-get update
    
  2. 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.

  3. Download the source code, as follows:
    cd /usr/src
    git clone https://github.com/OpenSIPS/opensips.git -b 2.1 opensips_21
    
  4. Compile and install the core and modules. Include the db_mysql and dialplan modules:
    cd opensips_21
    make menuconfig
    
  5. Select Configure Compile Options | Configure Excluded Modules and select dialplan and db_mysql:
  6. Select the Compile And Install OpenSIPS option:
  7. Create the directory for the process identification file Process Identifier (PID):
    mkdir /var/run/opensips
    
主站蜘蛛池模板: 贵定县| 稷山县| 育儿| 晋城| 农安县| 渭源县| 青冈县| 西林县| 乳源| 云霄县| 通山县| 韶山市| 岳普湖县| 南城县| 日喀则市| 建德市| 肥东县| 凤凰县| 天柱县| 衡东县| 新兴县| 大渡口区| 桐庐县| 澄城县| 甘泉县| 社会| 合水县| 皋兰县| 甘谷县| 广灵县| 三穗县| 文水县| 喀什市| 亳州市| 长乐市| 舟曲县| 海盐县| 渝北区| 报价| 彰武县| 洮南市|