SIP Server Build-up

Source: Internet
Author: User

we all know that a VoIP network call is required to connect to a SIP server so that the user can communicate with each other. here, I will briefly describe how to build a SIP server. under the Windows system can build Minisipserver, its official website is, we can choose the corresponding version, the specific configuration steps see Article/03b2f78c744ab55ea237aef3.html. Of course we can also download the Linux version, install and use the tutorial see, I will not repeat. Here I focus on how to build an O under Ubuntupenssips Server, Opensips is a mature open source SIP server that provides some application-level functionality in addition to the basic SIP proxy and SIP routing capabilities. Opensips's structure is very flexible, its core routing function is fully scripted, can flexibly customize various routing strategies, can be flexibly applied to many applications such as voice, video communication, IM and presence. At the same time, opensips performance is one of the fastest SIP servers, which can be used for carrier-grade product construction. With its scalable, modular system architecture, OPENSIPS provides a highly flexible, user-configurable routing engine that provides powerful, efficient routing, authentication, NAT, and Gateway protocol conversions for voice, video, IM, and presence services. Because of its stability and efficiency, opensips has been used by many telecom operators in its own network system. I. Prerequisites:

(1) MySQL is already configured.

1 sudo apt-get install mysql-server2 sudo apt-get isntall mysql-  Client3 sudo apt-get Install Libmysqlclient-dev

(2) If curses.h is not found, install sudo apt-get installation Libncurses5-dev

Two. Installation:1. Download OpensipsHttp://,I'm using version 1.8, which can git down
git clone 1.8 opensips_1_8

2. After decompression, enter the Opensips directory

Make all, if the error is generally missing some compilation tools, direct sudo apt-get install xxx (corresponding tool)Make Install may be set to insufficient permissions, in order to save trouble, we might as well under the root user to operateThree. Configuration1.opensips Databasecd/usr/local/etc/opensips/View found three files, respectively, Opensips.cfg OPENSIPSCTLRC Osipsconsolerc, and then vim changes its corresponding IP address to its own host.

2. Open the database/usr/local/sbin/opensipsdbctl CreateIf the following error occurs"Error:could not load the script in/usr/local/lib/opensips/opensipsctl/opensipsdbctl.mysql for database engine M Ysql
error:database engine not loaded-tried ' MYSQL ' "the
1 cd/usr/local/lib64/opensips/opensipsctl/2 CP $ (your opensips directory)/scrips/*MySQL  ./3mkdir mysql4CP  $ (your opensips directory)/scrips/mysql/*.sql./mysql5  cd/usr/local/share/opensips6CP $ (your opensips directory)/scrips/*.mysql  . 7 mkdir MySQL 8 CP  $ (your opensips directory)/scrips/mysql/*.sql./mysql
If Ubuntu is 32-bit, then/usr/local/lib/opensips/opensipsctl
after success, there will be two options, select All Y3. Check that the settings are correct/usr/local/sbin/opensipsctl-cFour. Use1. Turn on opensips service/usr/local/sbin/opensipsctl StartClose the Stop restart restartHere I met the ERROR: PID file/ var/run/ does not exist --opensips start Faile D. issues. Using Tail-n 20/var/log/syslog Here, you can see the cause of the error, I found the issue of permissions, and therefore sudo/usr/local/sbin/opensipsctl start.      2. Add SIP Users/usr/local/sbin/opensipsctl add username password such as:/usr/local/sbin/opensipsctl addYou can use/USR/LOCAL/SBIN/OPENSIPSCTL RM 100 to delete users.

If error:domain unknown:use usernames with domain or set Default domain in Sip_domainappears, the environment variable is not configured, so vim/etc/env Ironment, write sip_domain= "Your IP DOMAIN" in it, and then under source

The default database user is opensips, password is OPENSIPSRW, of course, you can also set the corresponding user, directly in the/usr/local/etc/opensips configuration file to modify the corresponding DBRWUSER,DBRWPW                               3. View SIP UsersYou can use the Mysql-u root-p and then enter your password, you can go through show databases, view the database, then use using Opensips, and show tables, you can view the table in the Opensips database, and finally use SE Lect * from subscriber to view added SIP user status4. Feel free to find an Internet phone to test, such as Sipdroid or Linphone, set up user information, found still not connected, what is the reason? I looked for a long time to find out because the corresponding default port 5060 is not open, so use sudo ufw allow 5060. Test again, finally connected to success, and then you can happily make a call!!! Here is the result of my test success:                

SIP Server Build-up

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.