PJSUA is a versatile command line SIP user agent based on the PJSIP stack, ideal for VoIP engineers and enthusiasts. This guide covers the installation process on Linux and MacOS, and provides a quick start on its usage. For Windows users, please refer to the detailed instructions provided in the official PJSIP documentation.
Installing PJSUA on Linux
Install Dependencies: Open a terminal and update your repositories. Then install the following packages:
apt-get update
apt install python-dev-is-python3 gcc make gcc binutils build-essential
Get PJSIP: Download the PJSIP source code from github. We will use the latest version which is currently 2.14:
wget https://github.com/pjsip/pjproject/archive/refs/tags/2.14.tar.gz
tar xvf 2.14.tar.gz
cd pjproject-2.14/
Configure and Build PJSIP: Configure the environment and build PJSIP:
export CFLAGS="$CFLAGS -fPIC"./configure && make dep && make
Install PJSUA: Copy the PJSUA binary to a directory in your PATH:
cp pjsip-apps/bin/pjsua* /usr/local/bin/pjsua
Verify Installation: Check if PJSUA is properly installed:
pjsua --version
Installing PJSUA on MacOS
On MacOS, the process is simplified with Homebrew:
brew install pjproject
Using PJSUA
Register a SIP Account: Use the following command to register a SIP account
pjsua --id="sip:USERNAME@DOMAIN" --registrar="sip:DOMAIN" --realm="*" --username="USERNAME" --password="PASSWORD"
Making a Call: To make a call, press “m” and then press enter key. Then enter the SIP URI in sip:number@host format and press the enter key again to place the call. Allow the request for microphone access to enable audio access for the call.
Specifying a Protocol: The default protocol is UDP. To specify a different protocol, use the --use-tcp, --use-udp, or --use-tls flags.For TLS, you might need to specify the TLS certificate file and the TLS private key file if required by your setup.
Receiving a Call without Registration: To start PJSUA without registering to a SIP server, you simply omit the registration-related parameters when launching it. You still need to specify your SIP URI with the –id option to identify yourself in calls
pjsua --id="sip:user1@ip_address"
Make a call to the SIP URI to and you should receive a call on the terminal.
The following tables show how to use other features, like answer an inbound call, send Update request etc.

Sample command
pjsua --id="sip:test@1.2.3.4:5060" --registrar="sip:1.2.3.4:5060" --realm="*" --username="test" --password="password"
You can also make a call directly without registering first, using the below command
pjsua --id="sip:USERNAME@DOMAIN" --realm="*" --username="USERNAME" --password="PASSWORD" <SIP_URI>
Sample Command
pjsua --id="sip:akash@test.com" --username="akash" --password="password" --realm="*" sip:123456@test.com
Conclusion
PJSUA offers a powerful and flexible way to interact with SIP protocols directly from your command line. Whether you’re a VoIP engineer or just starting out, PJSUA is an invaluable tool for testing, debugging, and managing SIP calls.
For more detailed information, visit the official PJSUA documentation.
Akash Gupta
Senior VoIP Engineer and AI Enthusiast

AI and VoIP Blog
Thank you for visiting the Blog. Hit the subscribe button to receive the next post right in your inbox. If you find this article helpful don't forget to share your feedback in the comments and hit the like/clap button. This will helps in knowing what topics resonate with you, allowing me to create more that keeps you informed.
Thank you for reading, and stay tuned for more insights and guides!

Leave a Reply