Look what Java and SIP can do
 (SIP)Java =
Home     News     Projects     Downloads     Support     Contact

SipUnit Home

CafeSip.org Contributor Howto

CafeSip.org Java Coding Conventions

SipUnit User Guide


SipUnit Developer & Contributor Howto

This guide is for developers who want to contribute features and functionality to SipUnit. You may also want to read this document if you plan to make changes to the SipUnit code even if you do not want to contribute the code back to us.

Topics:
  1. What do I need to know before deciding to contribute code to the SipUnit project?
  2. What kind of technical skills do I need to have in order to contribute to the SipUnit project?
  3. What kind of contributions are you looking for?
  4. How do I learn about the SipUnit internals?
  5. What do I need to get started?
  6. What kind of reference material do I need to have handy?
  7. How do I setup the Eclipse project for sipunit development?
  8. Some source files seem to be missing, such as the org.cafesip.sipunit.presenceparser.pidf classes. Where are they?
  9. How do I build the source?
  10. How do I actually submit my code?
  11. How do I make documentation changes?

What do I need to know before deciding to contribute code to the SipUnit project?
  1. First, please read the CafeSip.org contributor FAQ. This document talks in details on what kind of contributors we are looking for, who can contribute, what kind of copyright issues are involved, howto become a regular contributor, legal issues, ethical issues etc.
  2. Next, please read the coding conventions document that explains the coding standards and conventions followed by the CafeSip.org projects. You will need to follow the conventions in order for us to take your code.
  3. Finally read all the documentation for the SipUnit project, especially the User Guide. It will give you enough information to get you started. 
  4. Finally contact us (info@cafesip.org) to discuss your ideas. We will be able to orient you and even get in touch with other interested developers.
Top

What kind of technical skills do I need to have in order to contribute to the SipUnit project?
  1. You must be a strong Java programmer.
  2. You must be knowledgeable on SIP - Session Initiation Protocol (see RFC-3261, RFC-3665, and also the JAIN-SIP API Javadoc documentation).
  3. You will need to understand Ant. We use Ant for building and packaging.
  4. You must be experienced with JUnit and automated testing concepts.
  5. If your contribution also requires documentation changes, you will need to understand how to create HTML documents. We use the Mozilla Composer to create our web pages. For creating diagrams, we use Dia and GIMP.
  6. We use the Eclipse IDE for developing, managing and debugging the code. Although this is not entirely necessary for you in order to contribute, we encourage you to use the same tools.
  7. We use Subversion for managing the source code. If you are a regular contributor, we will give you access to the Subversion server hosted by SourceForge. Before using Subversion, you will need to know the Subversion basics.
Top

What kind of contributions are you looking for?

We have some particular projects in mind. You can take a look at it here (see the TODOs). If you would like to contribute for these projects, please contact us by sending an email to info@cafesip.org.  However, you do not have to follow our plans in case you have better ideas. If you would like to contribute for a project that you have thought of on your own, please contact us first to make sure that someone else is not already working on it, whether we would accept your contribution, etc.

Top

How do I learn about the SipUnit internals?

This section contains some information on the SipUnit design - class diagram, design notes, etc. Also you can read the javadocs. However, your best bet is to read the source code. An IDE with good navigation will make you an expert in no time.

The architecture diagram in the user guide shows the concepts but it's not accurate as a class diagram and skips some detail. Here is the class diagram for SipUnit. An important philosophy to keep in mind is that test programs that are using SipTestCase and the high level API classes (specifically SipPhone, SipCall, Credential, SipRequest, SipResponse, etc.) do not (should not have to) use the JAIN-SIP API.





Miscellaneous Design Notes

Authentication & Authorization

The idea is that one can supply SipPhone with needed credentials ahead of time, which will be automatically used during registrations, presence messaging, and call processing when an authentication challenge is received. A credential is: realm + user + password.  SipPhone keeps a list of credentials given to it. It also keeps a list (per Call-ID) of authorization headers automatically created using the credentials when authentication challenge(s) are received, to be used on subsequent requests.





Top

What do I need to get started?

You will need to have a Windows or a Linux system. The systems must have 512MB+ RAM, 100MB+ hard disk space and a 2GHz+ processor.  You need to download and install the following software:
  1. Java 1.4 SDK or higher.
  2. Ant 1.6 or higher.
  3. Eclipse 3.0 or higher.
  4. If you are a first-time contributor, download the latest SipUnit source package. To install the software, just unpack the ZIP file you downloaded using unzip (Linux), winzip (Windows) or jar (part of the Java SDK). If you are a regular contributor, you will have access to the CafeSip.org Subversion repository.
Top

What kind of reference material do I need to have handy?

From your browser, bookmark the following web pages:
  1. Java 1.4 API or 1.5 API javadoc
  2. Ant Manual.
  3. JAIN-SIP API javadoc.
  4. SIP RFC.
  5. NIST SIP projects page.
Top

How do I setup the Eclipse project for SipUnit development?

Here is what you need to do.

I. Install Eclipse: We use Eclipse 3.2. Download Eclipse from http://www.eclipse.org and install it as per the instructions.

II. Create the Eclipse project

Either from Subversion:
  1. Download and install the subclipse plugin from http://subclipse.tigris.org/ .
  2. Create a directory called cafesip in a location where you want to store the source code for the sipunit project. This is your development workspace. Create an environment variable called CAFESIP_HOME to point to this location.
  3. From the Eclipse IDE, select menu options Window->Show View->Other.
  4. From the Show View dialog box, select the SVN folder and  select SVN Repository . A n empty SVN repostory panel will be created and docked into the Eclipse screen.
  5. Select the SVN Repository panel, right click on the panel to bring up the popup menu. Select New->Repository Location.
  6. From the repository dialog box, enter the URL - http://cafesip.svn.sourceforge.net/svnroot/cafesip .
  7. Once the above step is completed, you will see the CafeSip source tree on the panel. First select the sipunit project and choose the sub-directory called "trunk" to select the latest code base. The latest source code in the trunk directory may not be stable and may not even compile. Morever, the document may not even match up. If you want to download the source code that we consider stable, download the software from the /labels/stable  directory. If you are working on a branch, you may have to choose a different sub-directory.
  8. Right-click on the trunk, from the context menu, select the Checkout option. The Eclipse IDE will contact the repository to gather project information. We have included all the Eclipse project files with the jiplet source code so that the project can be setup easily.
  9. From the Checkout dialog box, select Next. Uncheck the "Use default workspace location". Instead enter the location of the directory where you created the cafesip directory above ($CAFESIP_HOME).  Clck on the Finish button.
  10. The Eclipse IDE will download the source code and create the project. Depending on your connection speed, the download time will vary. The download is more than 10MB. Once the download is completed, you will see the project on the Package Explorer panel.
Or from the source distribution:
  1. Download the source code from CafeSip.org web site and unpack the source distribution in a directory. The unpacking process will create a directory called "sipunit".
  2. From the Eclipse menu, select the following: new workspace -> new project (Java project).
  3. Give the project a name (sipunit), hit Next.
  4. Source - Source folders on build path: sipunit/src, and Default output folder: sipunit/src ('Allow output folders for source folders' unchecked).
  5. Create the project.
III. Build the Build Path
  1. Under sipunit/lib, select the jars from the eclipse Navigator view, right click and 'Source->Add to build path'. You'll notice this moves the jars out of the lib dir into the main view (dir) of the eclipse Package Explorer.
  2. Go into project properties, Java Build Path. Click the 'Libraries' tab. You'll see the jars there. Click the 'Order and Export' tab. Uncheck lib: JRE System Library[jdk].  Everything else should be checked.
Top

Some source files seem to be missing, such as the org.cafesip.sipunit.presenceparser.pidf classes. Where are they
?

Those files are automatically generated by the JAXB compiler from the xsd in the conf directory. Basically, if you run the ant "build" target you'll see the missing files appear (refresh your package explorer/navigator if you're using eclipse) - the build process will first run the xjc compiler (JAXB) to generate the source code for those. Alternatively, you can also generate these classes by running the "genjaxb" target.

For more details on building the source, see next item.
Top

How do I build the source?
  1. From the package explorer, double click the build.xml file. You'll see the outline of it pop up.
  2. Make sure that the CAFESIP_HOME environmental variable has been set correctly to a directory one level higher than the directory containing the sipunit project. If it wasn't, set it and restart Eclipse.
  3. Right click on the 'compilesipunit' target. Run, Ant build. If, in your Ant build output, you see anything like ${xxxx.xxx} (ie, Running ${project.name}...), then something is wrong and Ant can't find your project build.properties file. Check your CAFESIP_HOME and the init/setglobalenv targets to fix the problem.
  4. After 'compilesipunit' builds successfully, run the default 'build' Ant target. It should be successful. Now you're cooking.
Top

How do I actually submit my code?

 If you are a regular contributor, you will have access to the CafeSip.org Subversion repository. You can directly commit your changes for the project that were already agreed upon. If you are a casual contributor, please submit your changes by following the steps below:
  1. Before starting the project, please make sure that you have communicated with us regarding what you want to do.
  2. Download the source distribution from the CafeSip.org download site. You will find a .SVN directory under every directory. Please do not delete these directories.
  3. Before you make any changes, run all the existing Ant test targets. They should all pass. You will have to look at the header comments in the Java test files so that you know what to set up for the test to run successfully (ie, proxy settings if any).
  4. Make the necessary changes to the code. Make sure that your code works and that you have not broken anything. Add/run automated tests for your code and also run the automated tests that were already in the project (run all the Ant test targets). They must pass before you submit.
  5. Create a file called SUBMIT.README in the root directory of the sipunit project. List the following:
    1. Describe the feature you added.
    2. Describe the base sipunit version number where your code is based.
    3. Describe the nature of changes you made.
    4. List any part that you want us to check for possible errors.
    5. List any third-party libraries that you have added including their license. Please do not include any library from projects that cannot be freely re-distributed.
  6. When you are ready to submit the code, run the "clean" target on Ant to remove all binary files. ZIP or tar.gz the entire source distribution with your changes.
  7. Upload the packed distribution to a location that we will provide you.
  8. We may ask you to make certain changes, please make the changes and upload again.
  9. Once we incorporate the changes into our codebase, we will inform you and you can download and check out the changes and verify the code. If you want to make further changes, re-package the source distribution and send it to us.
Top

How do I make documentation changes?

When you add a new feature or make modifications that require documentation changes, you will need to make them yourself.  First go through the project documentation links and find out what you need to change. Make sure that you understand the HTML code style and conventions that we are following. The HTML pages are stored in the CafeSip.org Subversion server and is versioned.

If you are a regular contributor:
  1. Please communicate with the mainitainer of the web site before you make any changes. THIS IS VERY IMPORTANT. Specify the directory that you want to modify and the nature of the modification.
  2. Check out the web site repository from Subversion.
  3. If you are creating new pages - Each directory has a file called template.html. Copy the file and rename it to the file name you want. Make sure that the file name is lower case, has no spaces and contain no blank spaces, punctuation characters and no international character. The file name must have a .html extension.
  4. Make the necessary changes.
  5. Upload your changes to the CafeSip.org web site (instruction will be provided to you on request).
  6. Check in your changes to the Subversion.

If you are a casual contributor:
  1. Request us for a zipped version of the cafesip.org web site. You will find a .SVN directory under every directory. Please do not delete these directories.
  2. Make the necessary changes.
  3. If you are creating new pages - Each directory has a file called template.html. Copy the file and rename it to the file name you want. Make sure that the file name is lower case, has no spaces and contain no blank spaces, punctuation characters and no international character. The file name must have a .html extension.
  4. Pack the entire directory that we sent you into a ZIP/tar.gz file and upload the file to a specified location.
  5. We may ask you to make changes to the documentation. Please make the necessary changes, create ZIP/tar.gz file and upload.
  6. Once we incorporate the changes into the base, we will inform you and you can verify the documentation changes are reflected in the CafeSip.org website. If you want to make further changes, upload your changes again.
Top

Search this website 


Send questions or comments about this web site to webmaster@cafesip.org.
Copyright © 2005, CafeSip.org.
Licensed under the CafeSip License.
The CafeSip.org projects, web site and web facilities have been sponsored by QUIK Computing

Top of page