Sun Java Solaris Communities My SDN Account Join SDN
 
Article

Solaris 10 OS As a SIP Server

 
By Ezhilan Narasimhan, Mayank Gupta, Prameet Chhabra, June, 2005  

Abstract: This article explains how to set up a system running the Solaris 10 OS as a Session Initiation Protocol (SIP) server, with persistence via the MySQL database, which is bundled with the Solaris 10 release. The authors also show the setup of SIP-based clients to use SER on the Solaris 10 OS and demonstrate voice communications.

Contents:

  1. Overview
  2. What Is SIP?
  3. SIP Building Blocks
  4. Lab Setup
  5. Installing MySQL
  6. Installing SER and Connecting to MySQL
  7. Administering SER
  8. User Agents -- Softphones
  9. Setting Up and Configuring SIP Communicator Clients
  10. Conclusion
  11. References
1.0 Overview

The Solaris 10 Operating System -- considered the most advanced UNIX operating system ever -- provides a set of new features of interest to telecommunications operators. Of particular importance to operators of converged voice/data services in the telecommunications industry is the SIP server called SIP Express Router (SER). A SER software package is offered by iptelorg GmbH. See the iptel.org portal for more information. (In this scenario, we use the open source version of this product.) SER acts as a SIP proxy, registrar or redirect server.

In this article, we show how to set up a system running the Solaris 10 OS as a SIP server, with persistence via the MySQL database, which is also bundled with the Solaris 10 release. We also set up SIP-based clients to use SER on the Solaris 10 OS and demonstrate voice communications as an example.

You can find a brief introduction to SIP in the next section. This is not intended as a tutorial on SIP or the details of the protocol. This article does not cover any performance characteristics or capacity planning for the SIP Express Router.

2.0 What Is SIP?

Session Initiation Protocol or SIP is an HTTP-like protocol developed by the Internet Engineering Task Force (IETF) for session management. Sessions could be VoIP sessions, instant messaging, or other multimedia-based applications. The core protocol definition is available at SIP RFC 3261.

Due to the richness of the clients that implement SIP, SIP enables a new array of services that traditional PSTNs (public switched telephone networks) lack. Similar to HTTP, SIP messages are a series of request/responses. Most SIP dialogs consist of REGISTER, INVITE, ACK, BYE, or CANCEL messages. For a more detailed tutorial on SIP, please refer to iptel.org SIP Express Router Documentation.

3.0 SIP Building Blocks

3.1 SIP User Agent

A SIP user agent is an end device that creates and manages a SIP session. It can be a SIP-enabled phone (line phone, cell phone), softphone, PDA, or a multimedia device.

3.2 SIP Proxy Server

A SIP proxy server accepts requests from SIP user agents. The server in turn forwards the request to the recipient SIP endpoint (user agent) or another SIP proxy server.

3.3 SIP Registrar Server

These servers are data stores that have the information of all SIP users in a domain. They contain the location (IP addresses) and authentication information for the users.

3.4 SIP Redirect Server

SIP redirect servers allow SIP proxy servers to direct a SIP message to another SIP proxy server. This is required when a SIP session needs to be established across domains.

4.0 Lab Setup

A schematic diagram of the demo setup is shown below in Figure 1. The list of hardware and software used is as follows:

  • 1 X Sun Fire V220z server (2 processors, UltraSPARC III) as a MySQL and SER Server
  • 2 X Sun Blade 150 Workstation as SIP Communicator Client
  • 1 X 8-port NETGEAR (GS108) Ethernet Switch for network connectivity
  • In the demo, we used SIP Communicator User Agent as a client. SER acts as the proxy server and the registrar server, and MySQL database acts as the data store. SER and MySQL were on the same machine (tested with Solaris 10 OS for both SPARC and x86 platforms).
 
Figure 1: Communication Using SIP Express Router in Same Domain
Figure 1: Communication Using SIP Express Router in Same Domain
5.0 Installing MySQL

Install MySQL database by running the /usr/sfw/bin/mysql_install_db script. This step can be skipped if there is an existing installation of MySQL.

For more information, please refer to /etc/sfw/mysql/README.solaris.mysql.

5.1 Initialize Database

To initialize the database, run the mysql_install_db script.

bash-3.00# /usr/sfw/bin/mysql_install_db
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
050331 16:10:58  /usr/sfw/sbin/mysqld: Shutdown Complete

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/usr/sfw/bin/mysqladmin -u root password 'new-password'
/usr/sfw/bin/mysqladmin -u root -h d-nwk12-125-66 password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
/usr/sfw/bin/mysqld_safe &

You can test the MySQL daemon with the tests in the 'mysql-test' directory:
cd /usr/sfw/mysql/mysql-test; ./mysql-test-run

Please report any problems with the /usr/sfw/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com

5.2 Creating mysql User and Group, and Changing Data Directory Group

Create user mysql, group mysql, and change permissions.

bash-3.00# groupadd mysql
bash-3.00# useradd -g mysql mysql
bash-3.00# chgrp -R mysql /var/mysql
bash-3.00# chmod -R 770 /var/mysql
bash-3.00# installf SUNWmysqlr /var/mysql d 770 root mysql

5.3 Starting and Testing the Database

To start the mysql demon manually, use:

bash-3.00# /usr/sfw/sbin/mysql_safe &
            Starting mysqld daemon with databases from /var/mysql

MySQL DB installation creates mysql and test databases. The test database is used to verify the sanity of the MySQL installation. Before we go ahead with the SER configuration, it is highly recommended to test the database installation. To do so, run the mysql-test script.

bash-3.00# cd /usr/sfw/mysql/mysql-test
bash-3.00# ./mysql-test-run
Installing Test Databases
Removing Stale Files
Installing Master Databases
running  /usr/sfw/sbin/mysqld --no-defaults --bootstrap --skip-grant-
tables --basedir=/usr/sfw --datadir=/usr/sfw/mysql/mysql-
test/var/master-data --skip-innnodb --skip-bdb
050401  3:20:52  /usr/sfw/sbin/mysqld: Shutdown Complete

Installing Slave Databases
running  /usr/sfw/sbin/mysqld --no-defaults --bootstrap --skip-grant-
tables --basedir=/usr/sfw --datadir=/usr/sfw/mysql/mysql-test/var/slave-
data --skip-innnodb --skip-bdb
050401  3:20:52  /usr/sfw/sbin/mysqld: Shutdown Complete

Manager disabled, skipping manager start.
Loading Standard Test Databases
Starting Tests

TEST                           RESULT
------------------------------------------
alias                          [ pass ]
alter_table                    [ pass ]
analyse                        [ pass ]
.......
.......
.......
varbinary                      [ pass ]
variables                      [ pass ]
warnings                       [ pass ]
------------------------------------------
Ending Tests
Shutting-down MySQL daemon
Master shutdown finished
Slave shutdown finished
All 182 tests were successful.

5.4 Setting root Password

Next set the root password for the MySQL database before proceeding to install the SER database. To assign passwords to the root accounts using /usr/sfw/bin/mysqladmin, execute the following commands:

bash-3.00# /usr/sfw/bin/mysqladmin -u root password
'mysql_root_password'
bash-3.00# /usr/sfw/bin/mysqladmin -u root -h host_name password
'mysql_root_password'

Replace mysql_root_password with your password. There are other ways of setting the root password, using the SET PASSWORD command at the mysql> prompt or updating the table mysql.user directly. Please refer to the mysql documentation for more information.

5.5 Starting mysqld at Boot Time

To start mysqld at boot time, copy mysql.server to the /etc/rc[0..3].d directories:

bash-3.00# ln /etc/sfw/mysql/mysql.server  /etc/rc3.d/S99mysql
bash-3.00# ln /etc/sfw/mysql/mysql.server  /etc/rc0.d/K00mysql
bash-3.00# ln /etc/sfw/mysql/mysql.server  /etc/rc1.d/K00mysql
bash-3.00# ln /etc/sfw/mysql/mysql.server  /etc/rc2.d/K00mysql
bash-3.00# ln /etc/sfw/mysql/mysql.server  /etc/rcS.d/K00mysql

6.0 Installing SER and Connecting to MySQL

SER is bundled with the Solaris 10 OS and is installed by selecting the supplemental packages. By default, SER is installed in the directory /usr/sfw. After installation, SER needs to be configured. The steps to configure SER with the MySQL database are discussed in the next sections.

6.1 Environment Setup

Man pages for SER are under /usr/sfw/man. SER binaries are under /usr/sfw/bin. Additional documentation for SER can be found under /usr/sfw/doc/ser. The configuration files and boot scripts may be found at /etc/sfw/ser. For our purpose, README.solaris.ser and ser.cfg are the files that we will most often need.

bash-3.00# export MANPATH=/usr/sfw/man:${MANPATH}
bash-3.00# export PATH=/usr/sfw/sbin:${PATH}

6.2 Creating SER Tables in MySQL Database

To create required tables for SER in MySQL, run ser_mysql.sh create:

bash-3.00# /etc/sfw/ser/ser_mysql.sh create

MySql password for root:
Domain (realm) for the default user 'admin': test.mydomain.com

creating database ser ...

bash-3.00#

6.3 Copying the Sample Configuration File Required by SER

Copy the sample configuration file required by SER for environment setup:

bash-3.00# cp /etc/sfw/ser/ser.cfg.sample /etc/sfw/ser/ser.cfg

6.4 Setting the SIP_DOMAIN Environment Variable in the /etc/sfw/ser/ser file

This value (test.mydomain.com) is entered when running /etc/sfw/ser/ser_mysql.sh in step 6.2. The snippet below shows the default lines modified in /etc/sfw/ser/ser.

#SIP_DOMAIN="SETUP_DOMAIN"; export SIP_DOMAIN
SIP_DOMAIN="test.mydomain.com"; export SIP_DOMAIN

6.5 Starting SER Manually

Start SER manually as follows:

bash-3.00# /etc/sfw/ser/ser start
bash-3.00#
Starting SER : started pid(3471)
Bash-3.00#

6.6 Starting SER at Boot Time

To start SER at boot time, you have to copy the script /etc/sfw/ser/ser into the appropriate /etc/rc[0..3].d directory.

bash-3.00# ln /etc/sfw/ser/ser /etc/rc3.d/S99ser
bash-3.00# ln /etc/sfw/ser/ser /etc/rc0.d/K00ser
bash-3.00# ln /etc/sfw/ser/ser /etc/rc1.d/K00ser
bash-3.00# ln /etc/sfw/ser/ser /etc/rc2.d/K00ser
bash-3.00# ln /etc/sfw/ser/ser /etc/rc3.d/K00ser

7.0 Administering SER

SER provides both a command-line interface (CLI) and a web-based interface for administration. The CLI is invoked by calling /usr/sfw/sbin/serctl. Using serctl one may start and stop SER, manage users, or monitor the server. Options available using serctl are shown below.

7.1 Using CLI -- serctl
bash-3.00# /usr/sfw/sbin/serctl
/usr/sfw/sbin/serctl $Revision: 1.62 $
parameter usage:
           * general *
file <file_name>.................... read commands from file.

           * subscribers *
add <username> <password> <email> .. add a new subscriber (*)
passwd <username> <passwd> ......... change user's password (*)
rm <username> ...................... delete a user (*)
mail <username> .................... send an email to a user
alias show [<alias>] ............... show aliases
alias rm <alias> ................... remove an alias
alias add <alias> <uri> ............ add an aliases

           * access control lists *
acl show [<username>] .............. show user membership
acl grant <username> <group> ....... grant user membership (*)
acl revoke <username> [<group>] .... grant user membership(s) (*)

           * usrloc *
ul show [<username>]................ show in-RAM online users
ul rm <username> ................... delete user's UsrLoc entries
ul add <username> <uri> ............ introduce a permanent UrLoc entry
showdb [<username>] ................ show online users flushed in DB

           * control and diagnostics *
moni ... show internal status      start .... start ser
ps ..... show running processes     stop ..... stop ser
fifo ... send raw FIFO commands    restart .. restart ser
ping <uri> .. ping a URI (OPTIONS)
cisco_restart <uri> .. restart a Cisco phone (NOTIFY)


Commands labeled with (*) will prompt for a MySQL password.
If the variable PW is set, the password will not be prompted.

ACL privileges are: local ld int voicemail free-pstn

The following command illustrates how to add users to the SER database. The default password for adding users is: heslo.

bash-3.00# /usr/sfw/sbin/serctl add test11 test11 test11@admin
MySql password:heslo
new user added
bash-3.00# /usr/sfw/sbin/serctl add test12 test12 test12@admin
MySql password:heslo
new user added
bash-3.00# /usr/sfw/sbin/serctl add test13 test13 test13@admin
MySql password:heslo
new user added
bash-3.00#

7.2 Using the Web-Based Interface -- serweb

SER can also be administered via serweb, a web toolbox for SER, which can be used for managing user accounts, requesting self-registration, monitoring servers.

serweb has an administration interface and a user interface. The administration interface enables SER administrators to monitor users and the SER server. The user interface allow users to manage their own accounts, modify profiles, phonebook, and call accounting.

serweb requires the following components:

  • Apache WebServer -- This is available in the Solaris 10 OS under /usr/apache.
  • MySQL database
  • SFWmphp (Scripting Language Tool for dynamic web pages [with MySQL API]). This package can be found on the Solaris 10 Companion CD.

Instructions are also available on /usr/sfw/share/serweb/README.solaris.serweb.

7.2.1 Run /opt/sfw/apache/x_postinstall

7.2.2 Configure httpd.conf

Copy /etc/apache/httpd.conf-php-example to:

/etc/apache/httpd.conf

Edit the /etc/apache/httpd.conf file and make the following changes:

  • Modify DirectoryIndex section to add index.php:

    <IfModule mod_dir.c>
    DirectoryIndex index.html index.php
    </IfModule>
    

  • Set Servername to the appropriate name (change 127.0.0.1)
  • Point DocumentRoot to where you have installed serweb. For default install it should be:

    DocumentRoot "/usr/sfw/share/serweb/html"
    

7.2.3 Configure php.ini

Edit or create /etc/apache/php.ini to include:

register_globals = on
short_open_tag = on

7.2.4 Configure config.php and add user link

Edit /usr/sfw/share/serweb/html/config.php.

Update db_host, root_path, realm, domainname, and default_domain.

realm, domainname, and default_domain are entered at SER installation above. The root path "/" should be OK.

Add a softlink user to user_interface in /usr/sfw/share/serweb/html/. We found that there were some links in serweb that referred to user:

bash-3.00# cd /usr/sfw/share/serweb/html
bash-3.00# ln -s user_interface user

Note: /usr/sfw/share/serweb/html/config.php contains passwd for the database, so make sure only mysqld can read it.

7.2.5 Restart Apache

Finally restart Apache web server:

bash-3.00# /usr/apache/bin/apachectl restart

7.3 SER Administrator Interface

The SER administrator can manage users and monitor the SER server via this interface. The default login is admin, and the password is heslo. The URL of the admin interface is at http://hostname/admin.

Figure 2 shows the login screen for the SER admin.

 
Figure 2: Login Screen for SER Admin
Figure 2: Login Screen for SER Admin

Figure 3 shows the User Management screen for the SER admin.

 
Figure 3: User Management Screen for SER Admin
Figure 3: User Management Screen for SER Admin
7.4 SER User Interface

The user interface allow users to manage their own accounts, modify profiles, and manage the phonebook and call accounting. This is at http://server_name/user_interface.

Figure 4 shows the user login screen.

 
Figure 4: User Login Screen
Figure 4: User Login Screen

Figure 5 shows the user profile screen.

 
Figure 5: User Profile Screen
Figure 5: User Profile Screen
8.0 User Agents -- Softphones

A wide selection of softphones is available on the market today with commercial offerings provided by Xten, Avaya, SIPquest, Cisco, Nortel and others.

In our demo, we will be using SIP Communicator. SIP Communicator is a Java technology-based user agent, built on top of the JAIN SIP RI (reference implementation) and Java Media Framework API (JMF). SIP Communicator supports audio and video over IPv4 and IPv6 and is freely available from https://sip-communicator.dev.java.net.

9.0 Setting Up and Configuring SIP Communicator Clients

Setting up SIP Communicator is straightforward. It runs on the Solaris OS, Windows, and Linux. The product is still in alpha phase, as of this writing, but works for basic call control. Below are the steps to set up the SIP Communicator.

  1. Download and extract the bits from https://sip-communicator.dev.java.net.
  2. This creates a directory sip-communicator.
  3. $ cd sip-communicator
    $ java -classpath sip-communicator.jar:jmf.jar:${CLASSPATH}:
    ${JMFHOME} -Dlog4j.configuration=sip-communicator.properties -Djava.
    library.path=./lib net.java.sip.communicator.SipCommunicator
    

Note: SIP Communicator requires Java Runtime Environment (JRE) 1.4.2 or later revisions.

9.1 Screenshots of SIP Communicator

Run Settings-> Run Setup Wizard first, to configure the softphone. On starting the softphone, the user is prompted to enter a password. This password is provided to the user at the time of registering the user to the registrar server. Upon authentication the user's presence is registered with the SIP server.

Figure 6 shows the SIP Communicator Setup Wizard.

 
Figure 6: SIP Communicator Setup Wizard
Figure 6: SIP Communicator Setup Wizard

Figure 7 shows registered user test11.

 
Figure 7: Registered user test11
Figure 7: Registered user test11

Figure 8 shows test11 calling test12.

 
Figure 8: test11 calling test12
Figure 8: test11 calling test12
10.0 Conclusion

The intention of this paper is to highlight some of the newer software bundles on the Solaris 10 OS catering to the telecommunications industry. And SER is one such package. Aspects of SER that are not explored in this article include some of the more advanced features, such as customization of SER with scripts and external modules, performance analysis or capacity of SER for specific workloads, and so on. In addition, SER can be customized to interface with PSTN gateways.

11.0 References

Acknowledgments

The authors would like to thank Georg Edelmann and Nagendra Nagarajayya for their assistance in reviewing this document. Thanks also to the editorial and production groups supporting the Sun Developer Network.

About the Authors

Ezhilan Narasimhan is a member of the Market Development Engineering Group at Sun Microsystems Inc. He may be reached at Ezhilan.Narasimhan@Sun.COM.

Mayank Gupta is a member of the Market Development Engineering Group at Sun Microsystems Inc. He may be reached at Mayank.Gupta@Sun.COM.

Prameet Chhabra is a member of the Market Development Engineering Group at Sun Microsystems Inc. He may be reached at Prameet.Chhabra@Sun.COM.

At MDE, the authors work with ISVs in the telecommunications vertical industry on issues relating to architecture, sizing, performance tuning, and benchmarking.

Rate and Review
Tell us what you think of the content of this page.
Excellent   Good   Fair   Poor  
Comments:
Your email address (no reply is possible without an address):
Sun Privacy Policy

Note: We are not able to respond to all submitted comments.