peers-0.5 new release

Hi, a new release of peers sip client is now available: peers-0.5. This release provides three binary files:

  • peers-gui-0.5-bin.zip: this is the traditional peers package relying on swing interface,
  • peers-js-bin.zip: this is an archive containing a web folder that can be extracted to any web server so that you can test peers javascript api very quickly
  • peers-jws-bin.zip: this is an archive containing a web folder that can be extracted to any web server so that you can start peers traditional interface directly from browser.

Many news for this release. Peers source code is now hosted on GitHub: https://github.com/ymartineau/peers. No more sourceforge subversion repository, I just closed the old one so that there is no confusion. So you can now download peers source code using the following command line:

git clone https://github.com/ymartineau/peers.git

As usual, take care with your http/https proxy settings in git if you are behind a corporate proxy/firewall.

Peers source code is now built using maven instead of ant.

And last but not least, peers documentation has been updated. You will now find a very simple example application showing how to use peers SIP java API. The complete source code of this demo application is also available as another maven module in peers source code. Here is the github link for this module.

I spent a few hours on doc and wanted to simplify peers api usage in this release so that more developers can write applications based on peers library. Almost every sip java client side application developer stumble upon jain-sip and complain about its complexity. Peers-0.5 is here to simplify basic SIP usage in java applications. I hope you will enjoy this new release as much as possible.

Posted in Uncategorized

javascript interface updated

Peers javascript interface (peers-js) has been updated. Peers javascript interface is actually just a javascript interface to a java plugin running in browser. This java plugin uses the core of peers java sip user agent to place and receive calls.

The latest version of peers and peers-js is available on github on my peers repository: https://github.com/ymartineau/peers. Peers source code repository will probably migrate to git, hosted on github soon. Thus, if you’re interested by peers, bookmark this link.

The demo page which was available previously on http://peers.sourceforge.net/files/demo/peers-js/ has been updated. Nevertheless, if you want to test it using latest java version (1.7.0 update 51), you have to declare http://peers.sourceforge.net/ as a trusted source web site in java configuration panel in security tab. If you don’t do that with latest version, java refuses to execute peers applet. This applet is not signed by a certificate from a certificate authority (like thawte), this is is the reason why this applet must be declared explicitly.

Unfortunately, sometimes, it can be tricky to find the right java config panel to declare trusted sites. Let’s take an example: on a 64-bits windows 7, it’s pretty common to have several java runtime environments installed, some in C:\Program Files\Java and some in C:\Program Files (x86)\Java. In my case, I had jre6 and jre7 in both Program Files and Program Files (x86). Actually, Program Files (x86) contains 32-bits programs and Program Files contains 64-bits programs. I went to this page to know which java version is running in my browser. I my case it was 1.7.0 update 51 but it didn’t say anything about 32-bits or 64-bits version. The browsers I used to validate this javascript interface were firefox and chrome. If I understand correctly, those programs are distributed 32-bits only, even for 64-bits windows versions. Thus, I think they install the 32-bits version of java when they reach a page where a java plugin wants to run and doesn’t find its plugin. I think that’s what I did. So, I ran javacpl.exe in C:\Program Files (x86)\Java\jre7\bin, modified trusted web sites source and it worked. On linux, the java config panel is jcontrol in bin/ in install directory.

Another restriction: I tested this page with asterisk running on a local network on another host and it worked, but it didn’t work with a sip account hosted on a public sip provider. Thus, I think java plugins are not authorized to send udp packets to public ip address in any way, even with signed jar using certificate from a certificate authority, even if user explicitly authorize the applet to run in its java config panel, even if user accepted all security pop-ups, even if the right AccessController.doPrivileged() invocations have been done in source code. I didn’t verify but I think that behavior would be the same even if java.policy files were deployed to the right directories. Even if java.policy was able to activate this “feature”, it would be too hard for standard users to modify it manually.

Thus, if you want run a java sip user agent in your browser with a sip account on a server hosted on the same local network and you are ready to pay for the java code signing certificate to avoid manual java config panel modification, this is the way to go. In any other case, you should probably choose another solution.

Posted in Uncategorized

javascript interface demo

Hello geeks,

From time to time I receive emails asking whether peers is still maintained or not since the latest release is from 2011. I don’t work often on peers, free time lacks, but I moved peers to maven on subversion repository. I started a command line java api demo and its “api usage” documentation, but it’s not yet complete.

Nevertheless, I also recently improved peers javascript interface so that anyone can register on its sip account, place and receive calls on the internet even without installing peers. A demo is available here. This demo comes in addition to the previous java web start demo. For the moment, this demo is not signed by an oracle-compatible certificate. Thus you’ll have to accept security warnings. I can send the certificate if you want to install it locally to avoid those warnings.

You may have the following error if your pc firewall is blocking outgoing packets:

java.net.SocketException: Invalid argument: Datagram send failed

Thus, you have to configure your firewall appropriately so that udp packets can be sent over the network. As this version is using random client port numbers, you won’t be able to grant outgoing udp packets based on their source port number. You could use destination ip+port for sip, but for rtp, it may be unknown. I suggest you temporarily enable outgoing udp packets for java process.

Just a reminder: all those features are available on sourceforge subversion repository only. If you find bugs in peers, please always send peers.log and transport.log or their counterpart in javascript demo.

Enjoy!

Posted in Uncategorized

Sourceforge project upgrade

Important news for developers, peers sourceforge project has been upgraded. It implies a new URL for subversion source repository. To get a read-only access, you can now use:

svn co http://svn.code.sf.net/p/peers/code/trunk peers-code-http

Developers can still use https to access the repository:

svn co https://svn.code.sf.net/p/peers/code/trunk peers-code-https

Anyone can now have a look at source code online at the following address: http://sourceforge.net/p/peers/code.

Thanks for considering this modification and sorry for any inconvenience.

Posted in Uncategorized

Peers evolutions

Most developers come to peers for its portability (100% java), its extensibility and its documentation.

Several important evolutions occurred in peers.

Peers is moving to maven. The project has split in several maven modules:

  • peers-doc: documentation converted to docbook
  • peers-lib: sip, sdp, rtp and media related code
  • peers-gui: swing graphical user interface
  • peers-jws: java web start application to start peers

Documentation is now integrated in source tree and converted to docbook standard. Documentation is not yet up-to-date in source tree, but it’s now generated dynamically.

Hackers

Here are the steps to tweak peers source code using eclipse:

svn co https://peers.svn.sourceforge.net/svnroot/peers/trunk peers
cd peers
mvn install
mvn eclipse:eclipse

In eclipse, add a new java build path classpath variable:

Window > Preferences > Java > Build Path > Classpath Variable, click on New:

  • Name: M2_REPO
  • Path: /home/yohann/.m2/repository

Then, you have to import eclipse projects generated by mvn eclipse:eclipse in eclipse: File > Import… > Existing Projects into Workspace > Browse, select the root peers folder and click Finish.

Architects

To generate documentation, use:

mvn pre-site

A pdf is generated in peers/peers-doc/target/docbkx/pdf and the html version is in peers/peers-doc/target/docbkx/html/peers.html.

Developers

To create a hello world project based on peers, first install peers in your local repo, create project and provide peers dependency:

~/peers$ mvn install
~/peers$ cd ..
~$ mvn archetype:create -DgroupId=test -DartifactId=demo -Dversion=0.1-SNAPSHOT

Then edit your new pom.xml file and add the following dependency:

    <dependency>
      <groupId>net.sourceforge.peers</groupId>
      <artifactId>peers-lib</artifactId>
      <version>0.5-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>

Copy logs, media and conf folders from peers root directory to your demo project:

cp -r peers/conf/ peers/media/ peers/logs/ demo/

Edit your peers.xml file in conf/ folder. You have to provide at least <userpart> and and <domain>:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<peers xmlns="http://peers.sourceforge.net"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://peers.sourceforge.net peers.xsd">
  <network>
    <interfaces>
      <interface id="eth1">
        <name>Ethernet network interface</name>
        <address/>
      </interface>
    </interfaces>
  </network>
  <devices>
    <audio/>
    <video/>
  </devices>
  <sip>
    <profile>
      <userpart>hello</userpart>
      <domain>world</domain>
      <password></password>
      <outboundProxy/>
      <interface ref="eth1"/>
      <port>0</port>
    </profile>
  </sip>
  <codecs>
    <codec>
      <family>audio</family>
      <name>PCMU</name>
      <payloadType>0</payloadType>
    </codec>
    <mediaMode>captureAndPlayback</mediaMode>
    <mediaDebug>false</mediaDebug>
  </codecs>
  <rtp>
    <interface ref="eth1"/>
    <port>8000</port>
  </rtp>
</peers>

Generate your eclipse project using mvn eclipse:eclipse and import it in eclipse.

Edit your main App class:

package test;

import java.net.SocketException;

import net.sourceforge.peers.sip.core.useragent.SipListener;
import net.sourceforge.peers.sip.core.useragent.UserAgent;
import net.sourceforge.peers.sip.syntaxencoding.SipUriSyntaxException;
import net.sourceforge.peers.sip.transport.SipRequest;
import net.sourceforge.peers.sip.transport.SipResponse;

public class App implements SipListener
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );
        new App();
    }

    public App() {
        try {
            UserAgent userAgent = new UserAgent(this, null, null);
            // start a new call
            userAgent.getUac().invite("sip:localhost", null);
        } catch (SocketException e) {
            e.printStackTrace();
        } catch (SipUriSyntaxException e) {
            e.printStackTrace();
        }
    }

    @Override public void registering(SipRequest sipRequest) { }
    @Override public void registerSuccessful(SipResponse sipResponse) { }
    @Override public void registerFailed(SipResponse sipResponse) { }
    @Override public void incomingCall(SipRequest sipRequest, SipResponse provResponse) { }
    @Override public void remoteHangup(SipRequest sipRequest) { }
    @Override public void ringing(SipResponse sipResponse) { }
    @Override public void calleePickup(SipResponse sipResponse) { }
    @Override public void error(SipResponse sipResponse) { }
}

Start a wireshark capture or even better launch a sipp uas script with echo option to play the role of the callee:

sipp -sn uas -rtp_echo

Launch your application in eclipse: right-click App > Run As > Java Application. You should get a exception. Provide a program argument to specify peers home (to locate configuration file): Run > Run Configurations… Select App, select Arguments tab, add .. in Program arguments. You should now be able to launch your application with no exception.

If you talk in your microphone, you should now hear your echo, thanks to sipp who is automatically picking-up the call and sending back media traffic to its origin.

For your convenience, you can find this demo project demo.

Posted in Uncategorized

peers-0.4.3 various improvements

A new version of peers is available on sourceforge. This version includes an important fix on CANCEL which was not accepted by Asterisk.

This version also includes an important improvement about media quality and delay. This version also supports INVITEs and reINVITEs with empty body. This feature makes peers compatible with simple server applications like click2call from Mobicents Media Server.

Posted in Uncategorized

peers-0.4.2 bug fixes

This new version includes bug fixes observed with asterisk. If you’ve been in trouble with peers, try this version, it should be better.

Posted in Uncategorized

peers-0.4.1 is out, bug fixes

This version integrates a few patches from tuijldert and a new feature: Authentication on BYE request (aka Challenge).

This version has been tested on Windows 7, windows xp and Debian GNU/Linux Squeeze.

This new release has also been tested with Avaya proxy/registrar.

Posted in Uncategorized

Documentation updated for peers-0.4

Peers documentation has been updated to reflect latest release. As usual, you can read peers latest documentation here.

This new version of the documentation contains information about new RTP stack, new GUI package, media implementation, new way to communicate between sip core layer and GUI, and much more. Feedback is always appreciated.

Enjoy and stay tuned!

Posted in Uncategorized

peers-0.4 release, small is beautiful

A new release of peers is available, the smallest complete java sip softphone.
New codecs, new GUI, no external dependency, more interoperability tests. Try it now!

The latest thing that lacks in this release for a full internet compatible sip softphone is ICE (Internet Connectivity Establishment) to pass all NATs. Nevertheless, if you’re using a media gateway or an internet provider sip account, you should not have any issue.

Posted in Uncategorized