3rd Party Database en
3rd Party Database en
3rd Party Database en
Version 2.1
Version Brekeke SIP Server v2.1 Using a third-party Database Tutorial Revised December 3, 2007
Copyright This document is copyrighted by Brekeke Software, Inc. Copyright 2002-2007 Brekeke Software, Inc.
This document may not be copied, reproduced, reprinted, translated, rewritten or readdressed in whole or part without expressed, written consent from Brekeke Software, Inc.
Disclaimer Brekeke Software, Inc. reserves the right to change any information found in this document without any written notice to the user.
Trademark Acknowledgement Linux is a registered trademark of Linus Torvalds in the U.S and other countries. Red Hat is a registered trademark of Red Hat Software, Inc. Windows is a trademark or registered trademark of Microsoft Corporation in the U.S and other countries. Mac is a trademark of Apple Computer, Inc., registered in the U.S. and other countries. Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. MySQL is registered trademark of the MySQL AB. Other logos and product and service names contained in this document are the property of their respective owners.
1
s-third2.1.0_071203
1. 2.
2.1. 2.2. 2.3. 2.4. 2.5.
3.
TROUBLESHOOTING ............................................................................. 9
2
s-third2.1.0_071203
1. Introduction
This document describes steps needed to use a third party database instead of using the embedded database in Brekeke SIP Server. You can add or modify the database from your own database management tool.
Brekeke SIP Server uses the following database tables. Table Name Purpose Registered Table This table stores the data of registered user agents. The data will be updated by REGISTER requests and used for the session routing. Users Table This table stores authentication data of users. Alias Table This table stores alias data. Note: Alias Database is available in Advanced Edition only.
t_registered
t_userdir
t_alias
Note:
The following sections are using MySQL as an example but other databases can be used in a similar way.
3
s-third2.1.0_071203
1. Create a table "t_registered" using the command below: mysql> CREATE TABLE t_registered ( skey namealias nameoriginal urlalias urloriginal acceptpattern requester expires priority timeupdate expirestime mappedport awake useragent param ); BIGINT, VARCHAR(255), VARCHAR(255), VARCHAR(255), VARCHAR(255), VARCHAR(255), VARCHAR(100), BIGINT, INT, BIGINT, BIGINT, VARCHAR(100), INT, VARCHAR(255), VARCHAR(255)
Note:
If you are upgrading from OnDO SIP Server (version 1.x) to Brekeke SIP Server (version 2.x), you will need to add the last two lines for useragent and param as shown in the table above.
2. Create indexes using the commands below: mysql> CREATE INDEX idx_registered_skey ON t_registered(skey); mysql> CREATE INDEX idx_registered_urlalias ON t_registered(urlalias); mysql> CREATE INDEX idx_registered_urloriginal ON t_registered(urloriginal); mysql> CREATE INDEX idx_registered_expirestime ON t_registered(expirestime);
4
s-third2.1.0_071203
1. Create a table "t_userdir" using the command below: mysql> CREATE TABLE t_userdir ( uid username longname password email description gid timeexpire timemake ); BIGINT, VARCHAR(100), VARCHAR(200), VARCHAR(100), VARCHAR(100), VARCHAR(200), BIGINT, BIGINT, BIGINT
2. Create indexes using the commands below: mysql> CREATE UNIQUE INDEX idx_userdir_uid ON t_userdir(uid); mysql> CREATE INDEX idx_userdir_username ON t_userdir(username); mysql> CREATE INDEX idx_userdir_timeexpire ON t_userdir(timeexpire);
5
s-third2.1.0_071203
1)
Create a table "t_alias" using the command below: mysql> CREATE TABLE t_alias ( alias_name group_id entity_name ); VARCHAR(100) NOT NULL, VARCHAR(100), VARCHAR(100) NOT NULL
2)
Create indexes using the commands below: mysql> CREATE UNIQUE INDEX idx_aliasdb_alias ON t_alias(alias_name,
Please download the latest JDBC driver for MySQL "MySQL Connector/J" from the link below. http://www.mysql.com/products/connector/j/
Copy the file named "mysql-connector-java-3.0.XX-ga-bin.jar" into the following directory. YOUR_INSTALL_DIRECTORY\webapps\proxy\WEB-INF\lib
Note: If you are using the bundled SIP Server for Brekeke PBX, please use the following directory instead. YOUR_INSTALL_DIRECTORY\webapps\pbx\WEB-INF\lib
6
s-third2.1.0_071203
Login to the Admintool and go to [Configuration] > [Database] page. At the [Database] page, you can set third party databases. (fig.1) After you change settings, press [Save] button and restart the server machine.
7
s-third2.1.0_071203
Thirdparty Registered Database Field Name On/Off Registered Database URL Explanation Select on to enable Registered Database URL for the Registered Database (e.g. jdbc:mysql://localhost/serverdb) JDBC Driver for the Registered Database (e.g. com.mysql.jdbc.Driver) User name for the Registered Database Password for the Registered Database
Thirdparty Users Database Field Name On/Off Encrypt Users Passwords Users Database URL Explanation Select on to enable Users Database Select false to record users' passwords in plain text URL for the Users Database (e.g. jdbc:mysql://localhost/serverdb) JDBC Driver for the Users Database (e.g. com.mysql.jdbc.Driver) User name for the Users Database Password for the Users Database
8
s-third2.1.0_071203
Thirdparty Alias Database Field Name On/Off Alias Database URL Explanation Select on to enable Alias Database URL for the Alias Database (e.g. jdbc:mysql://localhost/serverdb) JDBC Driver for the Alias Database (e.g. com.mysql.jdbc.Driver) User name for the Alias Database Password for the Alias Database
3. Troubleshooting
If you receive the error message "Can not open a database" at the Brekeke SIP Server's Admintool, the following issues may be causing the error:
- Databases port number may conflict with another program To resolve this issue, you need to either change the databases port number, or close the program that is using the same port number.
- Database is not allowing Brekeke SIP Servers requests Change the database setting to accept Brekeke SIP Servers requests.
- The configuration in the Brekeke SIP Server may be incorrect. Please follow this document and check your settings.
If the problem still persists, you can usually see some detailed error message which is related to the database connection in the following log file. YOUR_INSTALL_DIRECTORY\webapps\proxy\WEB-INF\work\logs\log.log
9
s-third2.1.0_071203