VoIP Troubleshooting with PJSIP

PJSIP is a free, open-source multimedia communication library written in C that is used for troubleshooting VoIP. PJSIP implements standard-based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE, targeting VoIP (Voice over IP) applications, including SIP signaling and media handling. You will find the project at github here.

What Is the PJSIP Tool?

When people refer to the “PJSIP tool,” they usually mean:

  1. PJSUA (PJSIP User Agent) — a command-line SIP softphone provided as part of the PJSIP suite.
  2. The PJSIP library, which developers use to build SIP/VoIP applications.
  3. PJSIP modules in Asterisk, where it has replaced the older chan_sip module.

Key Features of the PJSIP Toolset

FeatureDescription
SIP signalingSupport for SIP methods: INVITE, REGISTER, OPTIONS, etc.
RTP mediaAudio streaming with support for codecs like G.711, G.729, Opus, etc.
NAT traversalSTUN, TURN, and ICE support for NAT/firewall-friendly VoIP
Command-line client (pjsua)Test SIP servers, register accounts, place/receive calls
PortabilityRuns on Linux, macOS, Windows, Android, and iOS

Example Usage of pjsua Tool

Register with a SIP server:

bash
pjsua --id sip:1000@domain.com --registrar sip:domain.com --realm * --username 1000 --password mypassword

Send a SIP OPTIONS ping:

bash
pjsua --null-audio --id sip:tester@domain.com --registrar sip:domain.com --username tester --password secret \
--send-options sip:server@domain.com

Place a call:

bash
pjsua --id sip:1000@domain.com --registrar sip:domain.com --username 1000 --password secret sip:2000@domain.com

Installation

Strongly recommend that you visit their site documents for installation and usage documentation here. Windows users here.

  • Ubuntu/Debian: sudo apt install libpjsua2-dev
  • Or compile from source: git clone https://github.com/pjsip/pjproject.git cd pjproject ./configure && make dep && make

Use Cases

  • VoIP testing and monitoring
  • SIP endpoint emulation
  • Developing softphones and SIP-enabled apps
  • Load or function testing in SIP infrastructures

Comments are welcomed below from registered users.  You can also leave comments at our Discord server

If you would like to see more content and articles like this, please support us by clicking the patron link where you will receive free bonus access to courses and more, or simply buying us a cup of coffee!

Scroll to Top