Using sipgate.de on Linux with Linphone SIP client

Note: This is a follow-up blog entry to yesterday’s post about using the Zoiper SIP client on Linux. Linphone works comparably well so far and if I won’t come across any issues, I will recommend Linphone, since it is fully Open Source, which future-proofs is existence and allows others to contribute and improve the software better than for a closed-source product like Zoiper.

Linphone is a GPL licensed SIP client (“softphone”). It has been around since 2001 and is actively developed by the French company Belledonne Communications.

As the name suggests, the software was first developed for Linux but has gradually become truly cross-platform, now supporting Windows, MacOS, Linux, Android, iOS, Windows Phone 8 and most recently a web edition. For most operating systems, simply visit linphone.org and follow the download and installation steps indicated there.

Users of GNU/Linux distributions like Debian, Ubuntu, etc, install the distribution package through their favorite package manager. On my Debian stable (“wheezy”) I did this today:

sudo apt-get install linphone

Then I started up Linphone from the XFCE Start menu, where it is listed in the “Internet” submenu. I canceled the account setup wizard because it didn’t seem to work for me, disabled Video in the Options menu because I am not planning to use it yet, then selected Options – Preferences – Manage SIP accounts and configured my sipgate.de account like this:

Your SIP identity: sip:3998984@sipgate.de
SIP Proxy address: sip:sipgate.de

Screenshot

linphone-sipgate-account

Note that “3998984” is my sipgate.de SIP account name, so you have to substitute it with yours, but note that it is usually not the same as your sipgate.de web login username.

After this initial setup, I successfully tested the account and my headset by calling the sipgate.de test number 10005, which works very similarly to the Skype test call feature.

For personalized config information you can log in at sipgate.de and consult the “Konfigurationshilfe“, selecting one of the Linphone entries from the softphone device lists. I have a sipgate.de basic account, so if you are on a different plan, details may vary slightly.

If this blog post was helpful and/or if something seems inaccurate, please leave a comment. Happy telephoning …

Using sipgate.de on Linux with Zoiper SIP client

I use sipgate.de for international phone calls, using a Grandstream HandyTone IP-to-analog adapter installed in our house, but also using a SIP-capable “softphone” application.

Update: Open Source SIP client software like Linphone, SFLphone, Ekiga or others are preferrable to the below mentioned closed source applications. I successfully use Linphone now, which is also the only Open Source softphone that is explicitly listed by sipgate on their supported devices page.

Below is the original post about Zoiper, which might be of interest if you for some reason don’t like Linphone.


On Windows I have successfully used the PhonerLite freeware (binary download at no charge, proprietary licensed closed-source), which is not available for Linux.

But today I found out, that Sipgate also recommends a SIP client called Zoiper, which is available for Linux. It is also closed-source freeware. But at least – unlike Skype – the installer package has support for 32bit and 64bit Linux systems and the company behind Zoiper seems to develop for all target platforms equally (Android, iOS, Windows Phone 8, Windows, Linux, Mac, Web Browsers).

The Zoiper website has detailed step-by-step installation instructions. To summarize, the installation works like this, assuming the downloaded file is Zoiper_3.3_Linux_Free_32Bit_64Bit.tar.gz :

tar xvzf Zoiper_3.3_Linux_Free_32Bit_64Bit.tar.gz
sudo ./Zoiper_3.3_Linux_Free_64Bit.run

I specified /opt/zoiper as the installation directory.

Then I added an account like this (my SIP account username is 3998984, this is not the sipgate.de web login user name):

zoiper-sipgate-config

The audio devices (speaker, mic) can be configured and tested using the “Audio wizard”:

zoiper-audio-wizard

Is JSP an unsupported deprecated part of JEE ?

Recently, someone claimed that Java Server Pages (JSP) is an “unsupported”, kind of “deprecated” technology and that Java Server Faces (JSF) is the superior current standard.

I responded that JSP is a solid base standard, not deprecated, just not much advertised anymore. In combination with JSTL core logic tags it is still a reasonably powerful option, suitable for straightforward request-oriented web applications.

For example, JSP tag files (pure JSP based tags, no Java coding required) are a great templating feature for easy view structure reuse that many Java web developers don’t even know about because it was only added in JSP 2.0 – as part of JEE 1.4, when newly released JSF was getting all the hype.

JSP is “stable” in the sense that no significant features have been added in recent years. It is hard to find information on what was actually new in JSP 2.3 versus JSP 2.2. Some might say that it is borderline unmaintained because of this lack of changes. Others might just like it as is.

I think JSP is for web applications sort of what the JDBC API is for persistence, whereas JSF is sort of what the JPA standard is: More elaborate, higher-level features, multiple implementations of the standard by different vendors, added (sometimes nerve-wracking) complexity.

On the other hand, the JEE documentation side of things looks pretty bad for JSP (and ironically also for JDBC):

The JEE 5 tutorial still had a full long chapter about all aspects of JSP.

The JEE 6 and JEE 7 tutorials don’t have those chapters anymore and mention JSP only in passing. The documentation focus is clearly on JSF.

The omission of JSP from those JEE tutorials lead some folks on stackoverflow to ask “Where’s the official JSP tutorial” with some interesting answers.

Regarding non-“deprecation” of JSP, please note that the JEE 7 technologies page clearly lists JSP 2.3 as part of the JEE standard.

The reference documentation for JSP 2.3 is the detailed spec of JSR 245, version 2.3, maintenance release 2, available as PDF from the JSP site.

The JSTL 1.2 spec is also available as PDF from its JCP page.

Side note: Maven Central has a javax.servlet.jsp-api artifact, with most recent version strangely marked as 2.3.2-b01, as if it was a “beta” version.

So in conclusion: Certainly there is no buzz around JSP, rather complete silence. You can call that silence a symptom of death or see it as a sign that there is no need or interest to change this still widely used technology anymore.

How does Java’s Object.wait() really work?

Recently, I came across a question whether Object.wait() uses an “infinite loop”.

I didn’t know the answer, but since the JDK is Open Source, I thought I could at least find out where the code is and look at it.

So for example for JDK 7, these are the steps through the OpenJDK sources:

  1. In Object.java wait() calls the native method wait(timeout) via wait(0)
  2. The native code for wait in Object.c actually uses JVM_MonitorWait.
  3. The JVM wrapper method JVM_MonitorWait calls ObjectSynchronizer::wait.
  4. ObjectSynchronizer::wait calls wait() on an ObjectMonitor.
  5. Finally ObjectMonitor::wait does the real work.

I don’t fully understand that code, but I certainly don’t see an infinite loop in there. :o)

Build Java Maven github project on travis-ci

Update 14/Aug/2018: I no longer use an FTP space for the build artifacts, instead I use bintray.

I used to use Cloudbees’ buildhive for continuous builds of my Java/Maven based github projects. But buildhive currently does not offer JDK 8. So far that hasn’t been a problem, but I recently started using lambdas and default methods in interfaces and other Java 8 goodness. And now buildhive does not work for me anymore.

So I looked for alternatives and tried travis-ci.org. It was easy enough to set up a free account: You just authorize their service through your github login. Then all your projects will be listed on travis and you just click a switch to enable a build.

.travis.yml with FTP upload

To actually activate a build, you have to add a .travis.yml file at the root of your project.

The builds then happen automatically whenever you commit changes to github. This is the build list for one of my projects.

My build produces a distributable zip file, using Maven assembly plugin, that contains all the jars and start scripts of my application. I want to make the latest stable version of that zip file available for public download. With buildhive I used the permanent URL of the build artifact within the workspace of the last stable Jenkins build. But travis does not store anything after the build.

To make travis-ci build artifacts available, a deploy step is required. Many cloud storage systems are supported, but I opted for a custom deploy via FTP to my web space at dev.doepner.net.

So to build my Java Maven project with JDK 8 and do the FTP upload of the zip artifact, I ended up with these lines:

language: java
jdk: oraclejdk8

env:
  global:
  - secure: L2lr/F0gIvyVUl0nJ7w9saGV7wZkL6nO61IxilDY/76iTlnhrFXn5Q8vATGbiRYdDW/tG1kyDUbKaWSkYrpV2Agm4wV/KmMg2CWRiIcQPPqwSEENx/1UZ/dBnCQGcRkkYApu5ayjGnX3Srg3ty1zvdud/O8tiKtWkkBDipJSpfY=
  - secure: OekVM5ZyLGHpqurOUWJcq0kKBA78WKZdXaA9aylwrjjQFeVoZxyxeZTYbhLajN4Ggg4Th58QwjUHpwcgZlnsxx4heDo1wyHxXojJd0H1LWKXJwet82IXaFJbl+Yz/htr7uWSFTUF6Szx70cpMxlGe3qsIFlgViEo9UGhHHdrjdY=

after_success:
  ./.travis/artifact-upload.sh

The env – global – secure entries are the encrypted username and password for my FTP server. Details about the encryption steps are at the end of this blog post.

Artifact upload script

The .travis/artifact-upload.sh script performs the actual upload. The .travis directory is in the root of my github project. The script looks like this:

#! /bin/bash

local_file="$(ls $TRAVIS_BUILD_DIR/typepad-dist/target/*.zip | head -n 1)"
target_url='ftp://doepner.net/~/public_html/dev/dist/ci-builds/typepad.zip'

echo "Uploading $local_file to $target_url"
curl -u $FTP_USER:$FTP_PASSWORD -T "$local_file" "$target_url"

I am only interested in the latest zip and I want the URL to be permanent, that’s why the filename is hardcoded as typepad.zip.

Build status and download links

Similar to buildhive, travis-ci provides nice build status icons that automatically show the current status of your build.

The README.adoc of my github project now contains these build status and download links:

== Build status

image:https://travis-ci.org/odoepner/typepad.svg?branch=master[
link="https://travis-ci.org/odoepner/typepad"]

http://dev.doepner.net/dist/ci-builds/typepad.zip[Download latest build]

If you are not used to this syntax: It is AsciiDoc, not the default Markdown format of github READMEs.

Encryption of FTP credentials

Travis supports encryption of environment variables. This makes sense, because you probably don’t want to expose your FTP username/password to the world.

To perform the encryption, a local travis command-line installation is required. On Debian it can be setup like this:

1) Install JRuby (but not Rails)
2) gem install travis
3) cd to local working copy of your project
4) travis encrypt FTP_USER=yourusername --add
5) travis encrypt FTP_PASSWORD=yourpassword --add

The --add tells the travis command to add the resulting config directly to the .travis.yml file in your project directory. That’s why you first need cd to the base dir of your project.

Grouping Java skills by categories

I would like to group skill items from typical Java developer resumes – aka CVs – in a somewhat standardized way. See this jsfiddle for some work-in-progress.

I came up with the primary and secondary categories listed below, each with some sample items.

Your feedback is highly appreciated. Please comment on this blog post.

  • Java features and APIs:
    • Configurable JVM feature (Garbage collection, Remote debugging, JMX, etc)
    • Java language feature (Generics, Threads, Annotations, Enums, Lambdas, …)
    • Java SE API (Collections, Date/Time, NIO, java.util.concurrent, …)
    • Java EE API (EJB, JMS, JPA, JSF, JSP, …)
    • Java SE UI (Swing, JavaFX, WebStart, Applets, …)
    • 3rd party Open Source web frameworks (Struts, Wicket, Spring MVC, …)
    • Other 3rd party Open Source framework (Spring, Hibernate, …)
    • Closed-source vendor technology (Java based but no JSR)
  • Java Tools/Servers:
    • Application Servers (Websphere, Weblogic, JBoss, Glassfish, Tomcat, Jetty, …),
    • Developer Tools (IntelliJ, Eclipse, Netbeans, …)
    • Build automation tools (Maven, Ant, Jenkins, Teamcity, Bamboo, …)
    • Profiling and test tools (JVisualVM, SoapUI, JMeter, …)
  • Methodologies (software engineering approaches and practices):
    • Project level: Agile, Waterfall, RUP, …
    • Engineering level: Dependency Injection (DI), Object-Oriented Development (OOP), Continuous Integration (CI), …
  • Relevant non-Java technologies:
    • Web technologies (HTML, CSS, JQuery, JavaScript, SVG, …)
    • Scripting languages (bash, Perl, ksh, Groovy, ruby, etc)
    • Operating systems (Linux, MacOS, Solaris, …)
    • Database servers (Oracle, MS SQL server, Sybase, …)
    • Team tools (Confluence, JIRA, Crucible, …)
    • Other programming languages (C, C++, Cobol, Fortran, Scala, …)

Human readable timestamp for filenames

I use this bash alias (should work in Linux, Cygwin, probably MacOS, maybe other Unixes):

alias timestamp="date --rfc-3339=ns | tr ' '  '_'"

Then use it like this for example to archive a file:

mv somefile somefile_$(timestamp)

You should see something like

`somefile' -> `somefile_2014-11-13_11:45:46.980175800-04:00'

If you don’t like colons in file names, change tr ' ' to tr ' :'.

JQuery: Button to cycle through select options

I wanted an html drop-down list to automatically appear as a simple button that changes color on every click as it cycles through the option values of the (hidden) select element.

The code sample is in this jsfiddle. It uses JQuery.

For each relevant select element, it styles the associated label so it looks like a button, hides the select element and handles clicks on the label button by cycling through the select options.

The display text of each option is used as a tooltip (‘title’ attribute) of the button which also serves as a css selector to color the button according to currently selected option.

The beauty of this is that the selected values of the hidden drop-downs can be submitted by regular form submit and that the form is fully functional if JavaScript is turned off.

The button styling requires CSS3, so IE8 is not suitable. I have tested this successfully in Firefox 33 and IE11.

Design and code visualization

As a team lead at work and for my own good, I want to improve how I visualize system architecture, software design and code structure.

There seem to be at least two angles to this:

  • Show ideas
  • Show (software) reality

For me, ideas often develop top-down, starting from overview level, and require putting something I have in mind on paper or whiteboard, often as a mix of bullet points, sketchy diagram fragments, boxes, ad-hoc dividers and increasingly chaotic arrows.

In the past I have used scans of my paper scribblings or photos of whiteboards to capture the results. But of course, those “snapshots” are not very workable nor professional.

So for idea visualization, I need a flexible yet intuitive mindmapping and/or diagram tool. It should be easy to install or require no installation at all, stylistically appealing but clear, and of course be free/libre open source (i.e. no Visio, please).

I looked at tools like Dia, some online services like LucidChart, and other allegedly free alternatives, and have settled on Pencil Project for now. It is very basic, but seems to provide all I need for now. The cross-platform availability is excellent, it can even be installed as a Firefox extension.

On the other hand, depicting the reality of existing systems and code bases usually requires some sort of generation process that analyzes the real structure, e.g. a network layout, the content of a Java package, an Apache Camel route, etc. and turns it into a renderable file.

For Java source code, I found PlantUML quite interesting, with its javadoc integration and quick dependency diagram support.

I might follow up with more detailed posts about how I use the tools mentioned above. One aspect I have not looked into yet, is how I can embed the visualizations within AsciiDoc.