Address: http://www.pjsip.org/pjsua.htm
Introduction
Pjsua is an open-source command line SIP User proxy (soft phone), which is implemented using pjsip protocol, pjnath, and pjmedia. Although it only has a simple command line interface, it is fully functional.
SIP function:
Multiple IDs (account registration );
Multiple calls;
Support IPv6 (added in version 1.2 );
Prack (100rel, RFC 3262 );
Update (RFC 3311 );
Options;
Call persistence;
Call transfer;
Simple pidf and IDF support (subscription/notification, RFC 3863 );
Custom existing status text (rpid, RFC 4480 );
Supports publish (RFC 3903 );
Instant Message (Message) and message composition indication (RFC, 3994 );
Supports UDP, TCP, and TLS transmission;
The dns srv of the SIP Server (RFC 3263 );
DTMF with info (RFC 2976 );
Stun (RFC 3489bis );
AKA authentication (in development, RFC, 4169 ).
Media features:
Multiple concurrent calls;
Meeting;
Supports speex, ilbc, GSM, g711, g722, and L16 encoding/decoding;
Broadband and ultra-wideband coding/decoding (speex );
Support for more codec through Intel's IPP Library: AMR-WB, AMR-NB, g.722.1 (siren7), g.723.1, g.726, g.728, g.729a;
Stereo codec (L16 );
Wav file playback, streaming media and recording;
Supports the RTCP protocol;
Call quality monitoring;
RFC 2833;
Automatic response, automatic playback of files, automatic cycle of RTP;
Generate sound;
AEC (accoustic echo cancellation );
Adaptive jitter buffer;
Adaptive mute detection;
PLC (package loss and hiding );
Packet loss simulation;
Each RTP packet contains multiple frames;
Support for SRTP (secure RTP)
NAT Function:
Ice (interactive connection establishment, latest draft ice );
Stun (latest rfc3489 dual );
Turn (latest draft );
Rport;
TCP and TLS persistence of SIP;
Automatically detects and restores changes to the sip udp address;
Automatically detects changes in ice media transmission;
ProgramUse
Usage:
Pjsua [Option] [sip URL call]
General options:
-- Config-file = file: reads the configuration/parameters of the slave file;
-- Help displays the help screen;
-- Version: displays version information;
Logging options:
-- Log-file = fname Log File Name (default: stderr );
-- Log-level = N: set the maximum log level to n (0 (none) 6 (TRACE) (default value = 5 );
-- App-log-level = N: set the maximum log level to stdout display (default value = 4 );
-- Color uses a variety of logs (enabled in Win32 by default );
-- No-color disables a variety of logs;
-- Light-BG uses the color of white background black text (the default is the dark background );
SIP account options:
-- Use -IMS enables 3GPP/IMS settings related to this account;
-- Use -SRTP = N: Is SRTP used? 0 : Not used , 1 : Optional , 2: Force use (Default: 0 );
-- SRTP-secure = n SRTP do you need secure sip? 0 : Not required , 1 : TLS Mode , 2 : Sips (Default: 1 );
-- Registrar = URL: Set the URL of the registration server;
-- Id = URL: Set the URL of the Local Account
-- Contact = URL selectively overwrites the contact information
-- Contact-Params = s Add the S parameter to the specified contact URI
-- Proxy = URL: the URL that can be selected to access the Proxy Server
-- Reg-Timeout = sec registration interval (default 55)
-- Realm = string: Set the domain
-- Username = string set the user name
-- Password = string SET Password
-- Publish
-- Use -100rel requires reliable temporary response (100rel)
-- Auto-update-Nat = N is 0 or 1 to enable/disable symmetric Nat after sip traversal (default: 1)
-- Next-cred: add other creden
SIP Account Control:
-- Next-account: add more accounts
Transfer options:
-- IPv6
-- Local-Port = port
-- IP-ADDR = IP Address
-- Bound-ADDR = IP bound Port
-- No-disable TCP transmission
-- No-udp disable UDP Transmission
-- Nameserver = NS Domain Name Server
-- Outbound = URL: Specifies the URL of the Global Proxy Server, which can be specified multiple times.
-- Stun-SRV = Name: Set the stun server host or domain name
TLS options:
-- Use -TLS enables TLS transmission (disabled by default)
-- TLS-ca-file specifies the TLS ca file (none by default)
-- TLS-cert-file specifies the TLS Certificate file (none by default)
-- TLS-privkey-file specifies the TLS private key file (default value = none)
-- TLS-Password specifies the password of the TLS private key file (none by default)
-- TLS- Verify -Server verification server certificate (default = none)
-- TLS- Verify -The client verifies the client certificate (default = none)
-- TLS-neg-Timeout specified Timeout (default value none)
-- TLS-SRV-name specifies that the TLS server name is a multi-host server (optional)
Media options:
-- Add-codec = Name manually add codec (all are enabled by default)
-- Dis-codec = Name: Disable a codec.
-- Clock-rate = n overwrites the clock frequency of the Conference Bridge
-- Snd-clock-rate = n overwrites the clock frequency of the audio device
-- Enable stereo mode for stereo audio devices and conference Bridges
-- Null-Audio: Use a null audio device
-- Play-file = file: register the wav file in the conference bridge.
-- Play-tone = Format Register a tone with the conference bridge in the format of 'f1, F2, On , Off ', Where F1 and F2 are frequency,
On , Off = On / Off Can be specified multiple times.
-- Auto-play automatic playback file (only calls)
-- Auto-loop automatically transmits RTP to outgoing RTP cyclically
-- Auto-conf automatically joins the meeting
-- Rec-file = file recording file (the extension name can be .wav or. mp3)
-- Auto-rec automatically records calls
-- Quality = n specifies the media quality (0-10, 6 by default)
-- Ptime = msec overwrites the codecs ptime in milliseconds
-- No-vad disable VAD solution/silence detector (VAD is enabled by default)
-- EC-tail = msec sets the echo offset tail length (default value: 256)
-- EC-opt = opt select echo offset Algorithm (0 = default, 1 = speex, 2 = suppression)
-- Ilbc- Mode = Mode Set the ilbc speech codec mode (20 or 30; default value: 30)
-- Capture-Dev = ID the device ID of the audio capture (default value =-1)
-- Playback-Dev = ID: audio playback device ID (default value =-1)
-- Capture-lat = n audio capture latency (millisecond, default = 100)
-- Playback-lat = n audio playback latency (millisecond, default = 100)
-- Snd-auto-close = n the audio device is automatically disabled after n seconds
Specify n =-1 (default) to disable this function.
Specifies that n = 0 when not in use is immediately disabled.
-- No-tones
-- JB-max-size specifies the maximum jitter buffer (frame, default = 1)
Media transfer options:
-- Use -Use ice (default: not used)
-- Ice-no-host disables ice host candidates (default : No )
-- Ice-no-RTCP disable the RTCP component (default : No )
-- RTP-Port = n RTP Port base number (4000 by default)
-- RX-drop-PCT = pct drop PCT percent of rx rtp ( For Pkt lost Sim, default: 0)
-- TX-drop-PCT = pct drop PCT percent of tx rtp ( For Pkt lost Sim, default: 0)
-- Use -Turn enable turn relay with ICE (default : No )
-- Turn-SRV turn server domain or host name
-- Turn-TCP uses TCP to connect to the turn server (default : No )
-- Turn-user turn User Name
-- Turn-passwd turn Password
Friend list (which can be multiple ):
-- Add-buddy URL: add the specified URL to the friend list
User proxy options:
-- Auto-Answer = code automatically answers the incoming call response Code (E.g. 200)
-- Max-CILS = n maximum number of concurrent calls (default: 4, maximum: 255)
-- Thread-CNT = n worker threads (default: 1)
-- Duration = sec sets the maximum call time (default: no limit)
-- Disable event subscription when norefersub transfers a call
-- Use -Compact-form: Minimum SIP Message Size
-- No-force-LR allows strict Routing
-- Accept-redirect = n specifies how to handle call redirect response (3xx ).
0: reject, 1: Automatic (default), 2: Ask
Command Introduction
Call Command
M generates a call
M generates multiple calls to the same address
A response call (send 100-699)
H. Hang up the current call (HA means to hang up all)
H call persistence
V resume call (cancel call persistence)
U sends an update request
], [Call paging (previous/next)
X call transfer
X call replacement
# Send DTMF (rfc238)
* Send DTMF (SIP info)
DQ displays the current call Quality
S sends arbitrary requests to the remote host
Instant Messaging
+ B add friends
-B: delete a friend.
I. send instant messages
S subscription (friend) Current Status
U unsubscribe (friend) Current Status
T online status Switch
T sets the online status
Media commands
CL port list
CC connection Port
CDDisconnect a port
V. Adjust the volume
CP priority encoder
Account
+ A add
-A Delete
! A modify
Rr re-registration
Ru anti-registration
> Next (loop)
<Previous (loop)
Status and settings
D display status
Dd display Status Details
DC Display Configuration
F. Save the configuration.
Other commands:
Q exit
L reload
Sleep MS pause keyboard input (MS)
Echo[0 | 1 | TXT] controls the echo command (0: Disabled, 1: enabled, TXT: ECHO)
N test the NAT Network
Use of pjsua
1. Simple Point-to-Point
Start: $./pjsua
Call: $./pjsua SIP: 192.168.0.10
Default port: 5060
2. Register with the server
Single Account registration:
$./Pjsua -- id SIP: alice@example.com -- Registrar SIP: example.com \
-- Realm * -- username Alice -- password secret
Multi-account registration:
$./Pjsua -- id SIP: bob@provider1.com -- Registrar SIP: provider1.com \
-- Realm provider.1.com -- username Bob -- password secret \
-- Next-account \
-- Id SIP: bob@provider2.com -- Registrar SIP: provider2.com \
-- Realm provider2.com -- username Bob -- password secret
3. automatically respond to and play the wav file:
$ Pjsua -- play-file prompt. wav -- Auto-Answer 200 -- auto-play -- auto-loop \
-- Max-CILS 100
4. Load from a file:
File (Alice. cfg) content:
# This is a comment in the config file.
-- Id sip: Alice@ Example.com
-- Registrar sip: Example. Com
-- Realm *
-- Username Alice
-- Password secret
Usage:
$./Pjsua -- config-file Alice. cfg
Okay, that's all. I hope it will help you.