SipX ConfigServer Quick and Dirty

From SIPfoundry sipx, The Open Source SIP PBX for Linux - Calivia

Jump to: navigation, search

If you are a developer and you are looking to develop new features, you may be able to avoid a lot of installation hassle by building and running just the sipXconfig code under the unit test framework.

This environment is purely for development, all settings you enter may get cleared w/o warning and parts of interaction with outside services will not work. Feel free to post mail to sipx-dev list for more details.

Contents

How to build

Install JDK, ANT and postgres as your unix distro prescribes. You do not have to install any other sipX project

Code: Check out latest sipXconfig source
svn co https://sipxecs.sipfoundry.org/rep/sipXecs/main/config config
svn co https://sipxecs.sipfoundry.org/rep/sipXecs/main/sipXconfig sipXconfig
Code: Run the GNU autotools with sipagent off, this is only used for sipXphone support.
cd sipXconfig
autoreconf -if
./configure
make
Code: build only what you need
cd neoconf
ant default reset-db
cd ../web
ant run

Go to the following page:

http://localhost:9999/sipxconfig/app?component=login&page=TestPage&service=page

If you are using 3.2 or older go to the following page:

http://localhost:9999/sipxconfig/app?service=page/TestPage

And click Login link, then you may click any other link to access the system.

You can reset development database (reset-db), run database and UI test, check unit test code coverage, verify checkstyle compliance by running ant.

Code: check which build targets are available
ant -p

If you do not see something you need, post to the mailing list.

Note: [martin] I had to manually copy the file sipxconfig-config from main/sipXconfig/build/bin/sipxconfig-config to main/sipXconfig/bin. Also, in order for sipXconfig to be able to connect to the database I ran both ant default reset-db and ant run as root. The file pg_hba.conf is setup as described below.

Windows Users

It's even possible for Windows users to develop this way, instead of running the autotools, do the following:

Code: building on Windows
 ant -lib lib default test-all

Before installing, you will need to edit sipXconfig/build/build.properties and define

install.dir=c:/sipXconfig

setting install.dir to "c:/sipXconfig", or wherever you would like to install sipXconfig. (Add this line near the top of the file, before the first use of the install.dir property.) This would ordinarily be handled automatically by the autotools. Also note parameters like @VERSION@ in build.properties that would ordinarily be filled in automatically. Fortunately these parameters are not required for standalone sipXconfig development.

To install sipXconfig, do this:

Code: installing on Windows
 mkdir c:/sipXconfig/var/data/lib
 ant install  

As it stands now, you cannot run the application that interacts with the PBX, but you can run the web interface and develop support for phones, gateways and most any other development.

Postgres Permissions

You may have permission issues with Postgres, if so add this to the top of the following file

File: pg_hba.conf
local all all trust
host all all 127.0.0.1/32 trust
 

Writing unit tests for sipXconfig

Unit tests for sipXconfig are written using the JUnit test framework. Information on JUnit is available on the project's website at http://junit.org/

There are several classes of unit tests in sipXconfig

xxxTest - Vanilla JUnit tests. These are the only tests that are run during make check phase. Present in web, neoconf, and plugins projects

xxxTestDb - Tests that require postgress database installed and running. Some of these tests use the DbUnit package to ease the burden of testing against a database. Present in neoconf project only

xxxTestIntegration - Similar to TestDb tests. These tests also require postgress but are much easier to write. Any tests that reference the Spring application context fall into this category. Present in neoconf project only

xxxTestUi - UI tests that require the application server (Jetty) to be running. These tests extend the JWebUnit WebTestCase class and are run within the context of a Jetty application server (using the SiteTestHelper and JetyTestSetup utility classes). Present only in web project

Personal tools