Menu Close

Category: SIP

Tools for a quick SIP diagnostics – ngrep, sipgrep and sngrep

Sometimes there is a need for simple and quick analysis of a SIP server and its call functions. Of course, we should use the well-known tcpdump, mentioned in the article Using tcpdump for SIP diagnostics. However, for some occasional Linux users this may be too difficult and unclear. But actually there exist some simpler utilities, that could work fine, as ngrep, and for me newer, sipgrep and sngrep (love at first sight).

All utils are directly available and can be installed online from Debian repo using apt-get install ngrep sipgrep sngrep.

SIP clients – security features analysis

Table provides the overview of security features of nine analysed open-source SIP clients (some sources call them the RTC communicator).

Source: P. Segeč, M. Moravčík, J. Hrabovský, J. Papán and J. Uramová, “Securing SIP infrastructures with PKI — The analysis,” 2017 15th International Conference on Emerging eLearning Technologies and Applications (ICETA), Stary Smokovec, 2017, pp. 1-8.
doi: 10.1109/ICETA.2017.8102525
URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?rp=&arnumber=8102525&isnumber=8102457

Problem with a VoIP phone behind NAT – disabling FortiGate SIP ALG

Initial state and observed problems

Observed problems

We had observed a problem, where a SIP phone is registering, but the AOR record indicates, that as a Contact IP address the incorrect and strange private IP address is used. As is shown on following listing:

voip*CLI> pjsip show aor 1765
   Aor:  <Aor..............................................>  <MaxContact>
     Contact:     
   Aor:  1765                                                 1 Contact:  1765/sip:1765@10.16.42.46:65476              f123d14d1c NonQual         nan
 ParameterName        : ParameterValue
  =================================================
  authenticate_qualify : false
  contact              : sip:1765@10.16.42.46:65476
  default_expiration   : 7200
  mailboxes            :
  max_contacts         : 1
  maximum_expiration   : 7200
  minimum_expiration   : 60
  outbound_proxy       :
  qualify_frequency    : 0
  qualify_timeout      : 3.000000
  remove_existing      : true
  support_path         : false
  voicemail_extension  :

This cause a problem, where incoming phone calls (call on 1765 number) are not reaching the SIP phone. We had tried to solve the situations on the phone only modifying its NAT configuration and using STUN, but with no success. Then we setup the lab with two Cisco NAT to simulate the topo. It works perfectly. This indicate on a problem with the Fortigate firewall. Several posts indicates that it could be the SIP ALG problem, which is on Fortigate devices turned on by default and it modifies SIP messages.

Installing WebRTC2SIP gateway – tutorial


System preparation

apt-get update
apt-get upgrade

As the first step we need to install packages necessary to build the main webrtc2sip gateway:

apt-get install build essential libtool automake subversion git pkg-config screen libxml2-dev / 
libssl-dev libsrtp0-dev

to support for libspeex (audio codec) and libspeexdsp (audio processing and jitter buffer) add

Kamailio Call establishment permission rules


This article talks about deploying permission control mechanism for call establishment in Kamailio SIP Proxy.

In many VoIP solutions, it is crutial to deploy numbering scheme and write down rules where users are/aren't allowed to call.
On top of that, a company can allow the people to call outside, for example to PSTN. The rules can change over time as well as the numbering scheme itself.

Installing SIPp 3.2 on Debian Squeeze 6.0.5 32 bit


SIPp version 3.2 hasn't precompiled binary packages. There are some instructions provided at the sipp home page, however small comment about limits.h is missing and therefore the compilation will not be succesfull. Here we provide instructions how to compile Sipp with SSL, pcap play and distributed pauses features enabled.

Install prerequisities

Three pre-requisites are necessary to compile SIPp: