Yohann Martineau, blog


français, english, development, debian, embedded systems, internet service provider, internet, java, linux, multimedia, peers, protocol, cuisine, telecom, virtualization


2009-03, 2009-04, 2009-09, 2009-10, 2010-04, 2010-11, 2010-12, 2011-05, 2012-04, 2012-10, 2013-02, 2013-07, 2013-08

asterisk SIP unregister not working

2013-08-03 15:40:17

For any reason, asterisk 11 requires a new SIP Call-ID to unregister a SIP account whereas RFC3261 SIP specification says that all REGISTERs should use the same Call-ID:

      Call-ID: All registrations from a UAC SHOULD use the same Call-ID
           header field value for registrations sent to a particular

           If the same client were to use different Call-ID values, a
           registrar could not detect whether a delayed REGISTER request
           might have arrived out of order.

Here is the paragraph in rfc3261 that proves that asterisk behavior is incorrect:

      6. The registrar checks whether the request contains the Contact
         header field.  If not, it skips to the last step.  If the
         Contact header field is present, the registrar checks if there
         is one Contact field value that contains the special value "*"
         and an Expires field.  If the request has additional Contact
         fields or an expiration time other than zero, the request is
         invalid, and the server MUST return a 400 (Invalid Request) and
         skip the remaining steps.  If not, the registrar checks whether
         the Call-ID agrees with the value stored for each binding.  If
         not, it MUST remove the binding.  If it does agree, it MUST
         remove the binding only if the CSeq in the request is higher
         than the value stored for that binding.  Otherwise, the update
         MUST be aborted and the request fails.

In my case, Call-ID is the same between register and unregister and unregister CSeq is higher than register CSeq.

If the same Call-ID is used between register and unregister, asterisk keeps returning 401 with a new challenge.

Nevertheless, apparently, asterisk accepts the same Call-ID for register-refreshes.

Opensips seems to accept different Call-ID between register and unregister, so let's go with that modification.

Peers updated accordingly.

Permanent link
telecom, protocol, peers, development, english


asterisk 11 listen on port 5060

2013-07-23 15:53:47

I was struggling with a recent asterisk version compiled from source to make it listen on port 5060...

Configure script gave no error, but it was not enough to consider asterisk as operational: openssl-dev or ssl-dev and uuid-dev packages must be installed to build a full-featured asterisk. Asterisk must then be reconfigured, built, etc.

The odd trick was that asterisk keeps building correctly even if ssl or uuid library is not available. Then you start it and it just doesn't listen on sip port (5060) or complains about the lack of an rtp engine...

Well, it seems that openssl dependency is mentioned in README, but uuid does not seem to be...

Permanent link
telecom, linux, debian, english


This kernel requires an x86-64 CPU, but only detected an i686 CPU

2013-07-23 00:32:41

The other trick of the day:

I was installing a rhel-based 64 bits iso on a virtualbox 32 bits xp host. This is possible thanks to the decent cpu I'm using at work and I knew that it worked because I had already installed a 64 bits debian (wheezy).

The error message was something like:

This kernel requires an x86-64 CPU, but only detected an i686 CPU

During my first virtual machine installation, I was using default (32-bits) rhel version proposed by virtualbox.

The trick was just to turn OS type to 64-bits version in virtualbox virtual machine configuration parameters and it worked.

As it was not as high as expected in google rank, I just add it here...

Permanent link
linux, english, virtualization


Mobile networks architecture

2013-02-11 12:06:00

This post does not really bring something new to the community but it's a reminder.

Here is an overview of mobile networks architecture and generations.

Here is a more detailed description of each mobile network generation. Let's start with traditionnal circuit-switched technologies:

And here is an overview of more recent packet based technologies:

And now a bird view of latest telecom providers standard: IP Multimedia Subsystem

Here is now the meaning of all those ugly accronyms:

AUC AUthentication Centre
AS Application Server
BG Border Gateway
BGCF Breakout Gateway Control Function
BSC Base Station Controller
BSS Base Station Sub-system
AUC AUthentication Centre
BTS Base Tranceiver Station
CG Charging Gateway
CSCF Call Session Control Function
DHCP Dynamic Host Configuration Protocol
DNS Domain Name System
DRNC Drift Radio Network Controller
E-CSCF Emergency Call Session Control Function
EDGE Enhanced Data rates for GSM Evolution
EIR Equipment Identity Register
EPC Evolved Packet Core
EPS Evolved Packet System
E-UTRAN Evolved Universal Terrestrial Radio Access Network
GGSN Gateway GPRS Support Node
GMSC Gateway Mobile Switching Centre
GSM Global System for Mobile
GSS GPRS Sub-System
GPRS General Packet Radio Service
HLR Home Location Register
HSDPA High Speed Downlink Packet Access
HSS Home Subscriber Server
I-CSCF Interrogating Call Session Control Function
IMS IP Multimedia Subsystem
MGCF Media Gateway Controller Function
MGW Media GateWay
MME Mobility Management Entity
MRFC Media Resource Function Controller
MRFP Media Resource Function Processor
MS Mobile Station
MSC Mobile Switching Centre
NGN Next Generation Network
NSS Network Sub-System
PCU Packet Control Unit
GSS GPRS Sub-System
PCRF Policy and Charging Rules Function
P-CSCF Proxy Call Session Control Function
PDN Packet Data Network
PLMN Public Land Mobile Network
PSTN Public Switched Telephone Network
RADIUS Remote Authentication Dial In User Service
RNC Radio Network Controller
S-CSCF Serving Call Session Control Function
SIP Session Initiation Protocol
SGSN Service GPRS Support Node
SGW Signaling/Serving GateWay
SLF Subscriber Location Function
SRNC Serving Radio Network Controller
TRAU Transcoder Rate Adaptor Unit
TSC Transit Switching Centre
UE User Equipment
UMTS Universal Mobile Telecommunications System
UTRAN UMTS TRAnsport Network
VLR Visitor Location Register
Permanent link
telecom, english


maven eclipse:eclipse maven-eclipse-plugin 2.9 NullPointerException

2012-10-04 00:16:13

If you have difficulties to generate eclipse project files (.project and .classpath) from a maven project on a debian based OS, this article is for you.

While running mvn eclipse:eclipse in my peers project, I was stuck with this issue:

[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.872s
[INFO] Finished at: Wed Oct 03 23:39:07 CEST 2012
[INFO] Final Memory: 10M/104M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-eclipse-plugin:2.9:eclipse (default-cli) on project peers-doc: Execution default-cli of goal org.apache.maven.plugins:maven-eclipse-plugin:2.9:eclipse failed. NullPointerException -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Actually, apparently, maven automatically seeks jvm instances on a debian host (in /usr/lib/jvm) and tries to extract MANIFEST.MF file from jre/lib/rt.jar file in each jvm folder.

It should be verified, but apparently, as soon as it finds an rt.jar file without manifest, it fails with this annoying NullPointerException.

I found that my system had 4 different JVMs:

  • java-1.5.0-gcj-4.4
  • java-6-openjdk
  • java-6-sun-
  • jdk1.7.0_07 (installed manually)
I found that the only installed jvm with no manifest in jre/lib/rt.jar was java-1.5.0-gcj-4.4, Thus, I removed jvm java-1.5.0-gcj-4.4 (debian package gcj-4.4-base) and it solved my issue.

Hope this helps someone...

Permanent link
java, debian, development, english


Boot coreboot, FILO and a tiny debian

2012-04-29 19:27:38

I'm playing with open source bios software coreboot. To boot this opensource bios, I use qemu. I was bored of this default SEAbios prompt at virtual machine boot. So I decided to customize a bit my way to boot.

Actually, coreboot is just a piece of code that initialize hardware, it does not make a choice amongst bootable devices to start system. This task is performed by a payload. Actually, it's a payload for coreboot, but it's not the last payload we'll meet. Coreboot supports several payloads: SEAbios, FILO, custom linux, etc. Here, I will show how to install a FILO payload for coreboot and boot a tiny debian from this payload.

FILO is a bootloader that can read files on a local file system and use an image on a local file system to load an OS. So, after starting qemu, the boot sequence is: coreboot => FILO => tiny debian.

The first step is to retrieve coreboot and FILO. Actually, FILO has a dependency on libpayload, which is a library inside coreboot source code. So the compilation order will be: libpayload, FILO and coreboot.

Let's first create a root folder:

mkdir coreboot
In this directory, download coreboot source code:
cd coreboot
svn co svn://coreboot.org/coreboot/trunk coreboot-svn
We download FILO in coreboot-svn/payloads as it seems to be simpler to compile from here.
cd coreboot-svn/payloads
svn co https://svn.coreboot.org/filo/trunk/filo

Now, configure, build and install libpayload:

cd libpayload
make defconfig
make DESTDIR=../filo/build install
Now come back in filo folder and configure filo:
cd ../filo
make menuconfig
Use default options. You will see two make menuconfig interfaces, keep default options for both. You can now compile FILO:

Configure coreboot:

make menuconfig
Enter payload menu, choose "Add a payload", An ELF executable payload. Select your filo binary file (filo.elf) in "Payload path and filename"

Compile coreboot, compilation instructions can be found in bottom links:


My qemu version is a locally compiled one, not the latest one, but any reasonably recent qemu version should work.

Create tiny debian:

~/programs/qemu-0.14.1-local/bin/qemu-img create -f raw disk.img 2G
/sbin/mkfs.ext2 -F disk.img
# mkdir /mnt/rootfs
# mount -o loop disk.img /mnt/rootfs/
# mkdir /mnt/rootfs/boot
# cp /boot/vmlinuz-2.6.32-5-686 /mnt/rootfs/boot/vmlinuz
# cp /boot/initrd.img-2.6.32-5-686 /mnt/rootfs/boot/initrd
# apt-get install debootstrap
# debootstrap --arch i386 squeeze /mnt/rootfs/ http://ftp.debian.org/debian/
# umount /mnt/rootfs/
this listing:
  1. creates a qemu empty disk,
  2. format this disk to ext2 file system,
  3. as root, mount qemu disk locally,
  4. copy linux kernel and its temporary file system from real debian install to this new tiny boot file system,
  5. install debootstrap (first time only, of course), this tool creates tiny debian images using debian version in parameter. It will load packages from internet, you may have to be patient for this one,
  6. unmount cleanly this new file system.

start qemu:

~/programs/qemu-0.14.1-local/bin/qemu -bios coreboot-svn/build/coreboot.rom -hda disk.img -nographic

To start debian, in FILO, use:

root (hd0)
kernel /boot/vmlinuz root=/dev/sda initrd=/boot/initrd console=ttyS0
you may have to type Enter twice to see all feedback. Debian automatically renames /dev/hda to /dev/sda, this is the reason why we provide this root.

Once booted, you can see a debian root prompt!

Links, sources

Permanent link
linux, embedded systems, debian, english


Debian squeeze on dell vostro 1720

2011-05-12 20:20:34

Really disappointed by latest ubuntu version (11.04), I recently decided to go back to good old debian. I'm using windows/linux dual boot on my computer. Nevertheless, it needed a few tricks... as usual.

Wifi network configuration

Debian installer was looking for b43/ucode15.fw and b43-open/ucode15.fw at network step, but I didn't find a way to provide those files on a USB stick. So I installed with my ethernet wired connection. Then I installed package firmware-b43-lpphy-installer as suggested by debian wiki. My chipset is a BCM4312 LP-PHY (PCI-ID 14E4:4315).

But it was not enough, I had to modify b43 linux kernel module configuration with the following steps:

modprobe -r b43
echo options b43 pio=1 qos=0 >> /etc/modprobe.d/local.conf
modprobe b43

Hard-drive configuration

I want my hard-drive automatically mounted after boot-up, so I modified /etc/fstab and added the following line:

/dev/sda5 /media/data ntfs-3g defaults,user,exec,uid=1000,gid=100,umask=0022 0 0

Anonymous user with no password

In addition to my standard private account, I want another anonymous account with no password, here is the way to do it in debian.

  1. create user anonymous using Users and groups panel,
  2. create group (addgroup) nopasswdlogin
  3. add a rule in pam configuration file pointing to this group :

    auth required pam_env.so readenv=1 envfile=/etc/default/locale
    auth sufficient pam_succeed_if.so user ingroup nopasswdlogin

  4. check "log in without password" in anonymous user panel

Retrieve windows 7 boot entry

After debian squeeze installation, the new Grub2 installed removed my windows entry, to retrieve it I had to install os-probe package.

Rhythmbox radio stations

I also discovered that rhythmbox radio stations and all music tracks were stored in ~/.local/share/rhythmbox/rhythmdb.xml. Very useful to backup and restore all your custom radio stations.

Permanent link
linux, debian, english


peers-0.4 small is beautiful!

2010-12-15 15:24:37

After more than one year of irregular development, bug fixing and refactoring, thinking, improving, thinking again and some short nights, a new release of peers is available!

In this release, you will find a brand new GUI, still based on swing, but using native look and feel.

javasound is still employed for microphone capture and contact's voice playback.

No more external library is employed in this release. Jrtp has been replaced with a new home made RTP stack. This RTP stack has been developed with the same keep it stupid simple philosophy as peers SIP stack.

As more and more people are using peers, interoperability tests have been performed against more IPBXs, gateways, hardphones and softphones. I don't have a complete list of compatible SIP elements, but this list is growing.

Amongst new features, the ability to configure your SIP account using Edit > Accout in menu bar will probably be the most important one. It implies that peers users no longer have to modify an xml file manually before peers startup.

If you are a voip customer and your internet service provider can give you a SIP account, you can try peers now to call from your PC. Depending on your internet service provider servers configuration, you may also receive calls on your PC using peers. Some service providers also enable you to place calls from anywhere in the world using your sip account and local rates towards fixed line phones.

Permanent link
english, development, internet service provider, java, peers, protocol


Idée recette du jour : Tartine gourmande

2010-11-13 16:01:51
  • Couper une tranche de pain (Lanvellec 1kg semi-complet),
  • Mettre une tranche fine de chèvre frais sur le pain,
  • Ajouter une noix sur le fromage,
  • Agrémenter d'un petit filet de miel,
  • Servir avec un anjou village 2008,
  • Savourer !!
Permanent link
français, cuisine


Send audio and video to X-Lite using ffmpeg

2010-04-10 11:28:46

Send Video

I've been struggling for long to find a way to send video to X-Lite. Now I can, using sipp and ffmpeg. I'm using a custom sipp script based on uas scenario. I've just added video media in uas script, in 200 OK SDP, using H263-1998 media description (and attributes) proposed in X-Lite SDP offer. This media contains size options (QCIF, CIF, etc.). Then I send INVITE to sipp from X-Lite using an account that does not need registration. I look at traces to find the port on which X-Lite is willing to receive video RTP packets, and I send a video to X-Lite using the following command:

  ffmpeg -re -i file.flv -f rtp -an -vcodec h263 -s 176x144 rtp://

file.flv is a video retrieved from youtube using any youtube grabber website.

But don't try this using ffmpeg as is, because ffmpeg always send RTP packets using payload type 96, which is a dynamic payload type. To make it work, you have to apply the following patch on ffmpeg, to use a payload type proposed by X-Lite, here 115:

index 5df101e..3c15a8b 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -78,7 +78,7 @@ static int rtp_write_header(AVFormatContext *s1)
     s->payload_type = ff_rtp_get_payload_type(st->codec);
     if (s->payload_type < 0)
-        s->payload_type = RTP_PT_PRIVATE + (st->codec->codec_type == AVMEDIA_TY
+        s->payload_type = 115;
     s->base_timestamp = ff_random_get_seed();
     s->timestamp = s->base_timestamp;

If I understand correctly, for the moment, it's not possible to manually set the payload type of RTP packets sent from ffmpeg. A long thread on ffmpeg mailing list seems to show that it's not possible yet.

This patch is (of course) not for production use, but at least, it works. Let's hope that ffmpeg will make this parameter configurable...

Send audio

To send audio, it's quite "easy", the following command should work out of the box :

  ffmpeg -re -i file.flv -vn -acodec pcm_mulaw -ar 8000 -ac 1 -f rtp rtp://

Here, the trick is to force ffmpeg to use 172 UDP packets, because X-Lite only accept RTP packets which payload size is exactly 160. RTP (standard) header size is 12 bytes, thus pkt_size must be 172.

Permanent link
protocol, multimedia, development, english