Blackberry compatibility and others

From time to time, I receive questions about how to port peers to non-standard java environments (android, blackberry, etc.).

As I receive this question quite often, I post this article here, it may help people willing to use non-J2SE virtual machines.

Peers uses generics, which came with java 5. It means that you have to rewrite all classes using generics if you want to run peers on a java 1.4 JVM.
In peers source code, annotations are not extensively used. You will only find basic @Override. You will find more complicated annotations in test/ folder, but as its name implies those annotations are just used for tests. Those annotations correspond to testng annotations. Testng is the test framework employed in peers.

As you can see, if you want to port peers to a standard java 1.4 environement, it may be long, but not complicated.

It may be more complicated when you want to port peers to an environment where all J2SE packages are not available.

In this case, you have to find the differences between the java APIs provided by your environment and J2SE.

Generally, the critical point to write a voip application for a mobile phone is microphone access. In mobile environments, there may be manufacturer-specific java APIs or java wrappers for custom native APIs.

There are at most three APIs for mobile phones that differ from standard PC JRE:
- sound playback/sound capture,
- network.

Peers uses standard DatagramSocket and DatagramPackets for networking. As GUI is the first thing that is demonstrated on mobile phones when new software development kits are released, comprehensive tutorials are generally provided. Peers uses swing for GUI, and swing is generally not provided in exotic environments, so you have to consider it seriously. As already said, the most complicated will probably be on microphone access, as mobile phone providers often restrict access to microphone in development environments. But as always, it’s worth a try!

Posted in Uncategorized

Italian book about peers

The first book about peers has been published: VoIP & JAVA PARTENDO DA ZERO:


This is an italian book in two volumes. The first volume (google translation) gives general considerations about voip and java implementation of voip applications. And the second volume (google translation) presents several java sip stacks, including peers. The publishing house of this book is EdizioniFutora and the two authors of this book are Antonio Agliata and Luisa Romano.

Many thanks to them for talking about peers.

Antonio and his team will make a presentation of their new book in Napoli, Italy on 14 july 2010. Attendees can register to this presentation here. Let’s cheer them, Italy is a nice country to visit and july is vacation period…

Posted in Uncategorized

Android compatibility

Peers is not android-compatible for the moment. A few steps would be necessary to make peers android-compatible. Actually, here are the packages not provided by android (or imcomplete) and necessary for peers:

  • java.awt
  • javax.swing
  • javax.sound

Thus, GUI should be ported to android using Activity or something similar, and sound management should also be ported using MediaRecorder and MediaPlayer.

Configuration should also probably be updated to use XMLReader and drop dom4j dependency.

It seems that jrtp is directly compatible with android APIs except package gov.nist.jrtp.test.send_recv, but this package is not necessary. Thus, using jrtp and peers, you have the following stacks ready for android:

  • SIP
  • SDP
  • RTP

But no native API is available for GUI and sound management.

Posted in Uncategorized

Peers documentation online!

You have been asking for more documentation for long… and now it’s there! Patience pays, Peers documentation contains two parts: one for all SIP softphones and one for Peers source code. It’s important to read both. The first part gives an overview and a technical background to cope with Peers source code. The second part first gives architecture overview, then many UML diagrams are provided to understand quickly Peers source code, and to illustrate Peers implementation.

Enjoy, and please give feedback by e-mail: yohann.martineau at gmail dot com.

Posted in Uncategorized

Peers resurrection!

Peers is back, with improved media, compatibility with asterisk and many other cool features. Here is the changelog:

New features:

  • Running:
    • peers.home system property to run peers in several environments
  • Configuration:
    • an outbound proxy can now be configured in configuration file
    • media can now be activated or deactivated in configuration file
  • SIP:
    • support “sent-by” and “received” Via parameters
    • support 407 Proxy-Authenticate on REGISTER
    • support 401 and 407 on INVITE
    • support re-INVITEs (refresh target)
    • manage challenges on INVITEs
  • RTP:
    • support remote party update (ip address and port)

Improved features:

  • transport log file now contains real remote ip address and port
  • fixed media sending issue (replaced encoder with mobicents media server g711 encoder)

Peers configuration is still done using a simple xml file. This provides a good flexibility for peers, regarding other softphones. For more information, please read README.txt in peers archive. Acts are better than words, download latest Peers resurrection release now!

Posted in Uncategorized

407 – INVITE challenges

I’ve commited INVITE challenges support and transparent 401 or 407 management on subversion repository. To work with Asterisk, I still have to manage re-INVITEs correctly on peers.

Posted in Uncategorized

User accounts on web site


User accounts have now been activated, you can now:

  • post comments on posts,
  • ask questions,
  • submit ideas, links, …
  • ask if X feature is available,
  • how to do this or that,
  • etc.

I’ve been looking at Asterisk compatibility. For the moment 407 are not supported on INVITEs, I will try to implement this feature as soon as possible. I’ve installed a local asterisk, and an opensips… So as soon as I find a few hours, I’ll add this feature.

Stay tuned!

For your information, the following HTML tags are available in comments: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>

Posted in Uncategorized

Sourceforge community choice awards

Hello, I’ve enabled Peers – SIP Related Experiments – nomination in sourceforge community choice awards. You can nominate Peers in two categories (at least):

  • Best Project for Academia
  • Best Tool or Utility for Developers

Academia because most of support requests I receive come from students, doing their thesis, PhD or internships… But it seems that peers is also often used just for its sip stack, with many GUI improvements by professional developers.

So, if you want to support and help peers, please nominate peers on sourceforge community choice awards with the following link:



Thanks, and happy hacking with peers!


Posted in Uncategorized

Peers 0.3, still growing!

I’m very glad to announce that a new Peers release is now available, as usual you can download it here.

This release includes REGISTER management, as well as challenges and Digest, as specified in RFC2617 and MD5 hash algorithm. Thus a user can now register on a sip network.

This release has been tested against: x-lite, openwengo, linphone and ekiga for user-agents and against openser with db and auth modules for registration authentication. For registration, initial register has been implemented, register refreshes have been implemented and unregister has been implemented. Thus, when the user close the main window, a register message is sent to the registrar configured in peers.xml. For the moment, the password is stored as clear text in configuration file.

Another good news: a new test framework has been used on this release: testng. This powerful framework now replaces junit in peers. It enables unit testing, thread testing, group testing… it generates html result files and has also many very useful features. Media has been slightly improved in this release as audio capture, data compression and rtp packetization are now implemented in different threads.

For an exhaustive release note, please read README.txt in peers archive file.

Thanks for using and reading. Peers is still growing and many exciting features are coming. Stay tuned…

Posted in Uncategorized

Peers second release: 0.2

A new release has been created for peers: 0.2.

This new release contains new features and many bug fixes. All bugs have not been reported on the tracker page because they are generally remarked during development phase.

The goal of this release was to add provional responses management for peers (101-199 response range). In this release the only provional response implemented is 180 Ringing. But this provisional response is the main provisional response and the first one to implement in new stacks… Thus, when an INVITE is received on peers, peers automatically generate a 180 response and send it to the remote User-Agent. This also means that a popup window is now displayed to the user to alert him of a new call. The user can now accept or reject the call. If the call is rejected a 486 Busy response is sent.

On the other hand, when a remote User-Agent-Server rejects a call initiated by peers, peers cleanly closes the frame corresponding to the call.

Also, those provisional responses previously mentioned requires that CANCEL method be implemented, because if a User-Agent-Server sends a provisional response (with a To-tag), it must be able to handle a CANCEL for call termination. That is why CANCEL management has been implemented in peers, both at client and server side.

This version has still been tested on windows and linux, and against X-Lite 3, a popular SIP User-Agent.

An XML configuration file enables simple SIP stack parameters management. A grammar has been defined for this configuration file.

As usual, the download page will provide source and binary package zip files.

Posted in Uncategorized