PJSIP Project

PJSIP Overview

  • Overview
    • Libraries Architecture
  • Features (Datasheet)
    • Supported Platforms
    • SIP Capabilities
      • Base specs
      • Transports
      • Routing/NAT
      • Call
      • SDP
      • Presence and IM
      • Other extensions
      • Compliance, best current practices
    • NAT Traversal
    • Media/Audio Features
      • Core
      • Audio Features
      • Video Features
      • Transports
      • Media components (Ports)
      • Clock provider
      • Codec Framework
      • SDP
      • RTP and RTCP
      • Compile Time Settings
      • Basic Types and Functions
      • Endpoint
      • Formats
      • Media Flow
      • Events
    • Video Features
    • Security Features
      • TLS/SSL
      • SIP Security
      • Media Security
    • Supported Codecs
      • Audio Codecs
      • Video Codecs
    • Supported Audio Devices
    • Supported Video Devices
  • License
    • Overview
    • The SOFTWARE
      • License
      • Alternative license
      • Special Exception
      • Third Party Software Licensing Requirements
    • Third Party SOFTWARE
      • Contributed and Public Domain Third Party Software
      • Third Party Software with Licensing Requirements
      • External Third Party Software
    • Licensing FAQ
      • Why is PJSIP licensed as GPL and not (LGPL|Apache|BSD|choose your OSS license here)?
      • What about the “viral” nature of the GPL?
      • Can I develop closed source products with PJSIP?

Get Started

  • Getting PJSIP
  • General guidelines
    • Development guidelines
      • Preparation
      • Development
      • Coding Style
      • Deployment
      • config_site.h
    • Coding Style
      • Space indentation
      • Limit line length
      • Use ANSI C/C90 Standard
      • Use C style comment
      • No declaration after statement
      • Use Doxygen comments for API
      • Use K&R style brace placement
      • Multiline function arguments
      • Multiline comment indentation
      • Please observe existing code
    • Platform Considerations
      • Android
      • iOS for iPhone, iPad, and other Apple devices
      • Windows Desktop
      • MacOS X
      • Linux Desktop
      • Windows Phone 10 (UWP)
      • Embedded Linux
      • QNX or Other Posix Embedded OS
      • Other Unix Desktop OSes
      • Porting to Other Embedded OS
      • Symbian
      • BlackBerry 10
      • Windows Mobile
    • Which API to use
      • PJSIP, PJMEDIA, and PJNATH Level
      • PJSUA-LIB API
      • PJSUA2 C++ API
      • PJSUA2 API for Java, Python, C#, and Others
    • Other specific considerations
  • Android
    • Android SIP Client Development Overview
      • Objective
      • Task outline
      • What’s next
    • PJSIP for Android features
      • SIP features
      • Security features
      • NAT traversal features
      • Audio features
      • Android Video Features
      • Sample applications
      • What’s next
    • Install the required tools and library
      • Install Android Android Studio and Android NDK
      • Install SWIG
      • Download and extract Oboe
      • Install OpenSSL
      • Download PJSIP
      • What’s next
    • Configure and build PJSIP for Android
      • Create config_site.h
      • Configuring PJSIP
      • Verifying configuration
      • Building PJSIP
      • Building PJSUA2 Java interface with SWIG
      • Copy third party native libraries
      • What’s next
    • Android Java SIP VoIP and Video Client Example
      • Open the apps in Android Studio
      • Build the project
      • Run or debug Pjsua2 app
      • Set account and register to server
      • Add buddy
      • Dialing/making a call
      • Receiving incoming call
      • Video calls
      • Notes on NAT
      • Notes on video quality
      • What’s next
    • Kotlin SIP Voice and Video Client Example
      • Open the app in Android Studio
      • Configuring SIP account and servers
      • Build the project
      • Run or debug the Kotlin app
      • Start the library
      • Making and receiving calls
      • What’s next
    • Command line/telnet SIP client example
      • Build the native code
      • Copy the third party native libraries
      • Open in Android Studio
      • Build the project
      • Run or debug the app
      • Using the CLI app
      • What’s next
    • Creating your own application
      • Creating your own application
      • Adding Video Capture Device to Your Application
      • Using Video API
      • Video capture orientation support
      • Installing additional components
    • Common issues when developing Android SIP client
      • Pjsua2 keeps stopping during startup
      • Failed to load native library pjsua2
      • Failed to load native library libssl.so
      • Failed to load native library libcrypto.so
      • Failed to load native library liboboe.so
      • Failed to load native library openh264
      • No implementation found for void org.pjsip.pjsua2.pjsua2JNI.swig_module_init()
      • Tip: find library dependencies
      • Unable to make or receive call due to large message size
      • Garbage collector may crash your app (Pjsua2 API)
      • OpenSLES audio device deadlock upon shutdown
      • Bad audio recording quality on some devices
  • iPhone/iOS
    • Build Instructions
      • Requirements
      • Build Preparation
      • Building PJSIP
      • Using PJSIP in your application
      • Video Support
      • TLS/OpenSSL Support
    • Common issues when developing iOS apps
      • Accepting calls in the background with PushKit
      • CallKit integration and audio session (AVAudioSession) management
      • Crash after calling PJLIB APIs using Grand Central Dispatch (GCD)
      • Audio lost or other issues with interruption (by a phone call or an alarm), headset plug/unplug, or Bluetooth input
      • SIP transport keepalive while in background
      • Unable to accept incoming call in background mode (iOS 8 or older)
  • Mac/Linux/Unix
    • Build Instructions with GNU Build Systems
      • Supported Targets
      • Requirements
      • ./configure
      • Cross Compilation
      • Running make
      • Build Customizations
      • Optional: Installing PJSIP
    • Using PJSIP in applications
  • Windows
    • Build Instructions
      • Build Preparation
      • Requirements
      • Building the Projects
      • Debugging Sample Applications
    • Using PJSIP in Windows applications
    • Common issues when developing on Windows
      • Troubleshooting crash problem on Win32
  • Windows Phone
    • Build Instructions
      • Requirements
      • Build Preparation
      • Building and running the Projects
      • Debugging Application
      • Other References
    • Windows Runtime (WinRT) Overview
      • Windows Runtime
      • Windows RT
      • Windows Phone Runtime
      • Windows Phone 8
      • Windows Phone 8.1
      • References
  • CMake (experimental)
    • Build Instructions with CMake
      • Supported Platforms
      • Requirements
      • Quick Start
      • Common Configurations
      • Configure Options
      • Configuring TLS Support
      • Site-Specific Configuration (config_site.h)
      • Build Targets
      • Running Tests
      • Installing
      • Cross-Compilation
      • CMake vs GNU ./configure
      • Known Limitations
    • Using PJSIP in CMake Projects
      • Minimal Example
      • Exported Targets
      • Selecting Components
      • Pointing CMake at the Install Prefix
      • Version Requirements
      • Embedding PJSIP via add_subdirectory
      • Interaction with System Dependencies

PJSUA2 Guide

  • Introduction to PJSUA2
  • Building PJSUA2
    • Common Requirements
    • Building Python SWIG Module
    • Building Java SWIG Module
    • Building C# SWIG Module
  • General Concepts
    • Classes Overview
      • pj::Endpoint
      • pj::Account
      • pj::Media
      • pj::Call
      • pj::Buddy
    • Guidelines
      • Class Usage Patterns
      • Error Handling
      • Asynchronous Operations
      • Threading
      • Problems with Garbage Collection
      • Objects Persistence
  • Hello World!
    • C++
    • Python3
    • Java
  • Using PJSUA2
    • The Endpoint
      • Instantiating the endpoint
      • Creating the library
      • Initializing and configuring the library
      • Creating one or more transports
      • Starting the library
      • Shutting down the library
    • Accounts
      • Subclassing the Account class
      • Creating userless accounts
      • Creating account
      • Account configurations
      • Account operations
    • Working with audio media
      • The conference bridge
      • Playing a WAV file
      • Recording to WAV file
      • Local audio loopback
      • Looping audio
      • Call’s media
      • Second call
      • Conference call
      • Recording the Conference
    • Working with video media
      • The video conference bridge
      • Account video configuration
      • Starting camera preview
      • Important note about threading
      • Call’s video media
      • Modifying video during a call
      • Configuring a video window
      • Video event
      • Video conference call
    • Calls
      • Subclassing the Call class
      • Making outgoing calls
      • Receiving Incoming Calls
      • Call Properties
      • Call Disconnection
      • Working with Call’s Audio Media
      • Setting media direction
      • Call Operations
      • Instant Messaging(IM)
    • Presence and Instant Messaging
      • Subclassing the Buddy class
      • Subscribing to Buddy’s Presence Status
      • Responding to Presence Subscription Request
      • Changing Account’s Presence Status
      • Instant Messaging(IM)
  • Sample Applications
    • PJSUA2 Samples

Specific Guides

  • Specific Guides
  • Audio
    • Acoustic Echo Cancellation (AEC)
    • Audio Frame Manipulation
      • PJSUA2 — AudioMediaPort
      • C / PJSUA-LIB / PJMEDIA alternatives
      • Cross-cutting tools
      • PJSUA-LIB / PJMEDIA equivalents
    • Audio Conference Bridge
      • Overview
      • Backend selection
      • Worker threads (parallel backend)
      • Measuring bridge capacity with the MIPS test
      • Asynchronous operations
      • Op-completion callback
      • Custom port lifecycle
      • Per-port TX / RX state
      • Port direction and signature
      • Common pitfalls
      • PJSUA-LIB equivalents
    • Customizing the Audio Stream Port
      • Introduction
      • The PJSUA call-teardown sequence
      • Pattern A — wrapping the precreated stream port
      • Pattern B — replacing the precreated stream port
      • Checklist
      • PJSUA2 equivalents
      • See also
    • Handling HW insertion/removal
    • Intel IPP codecs integration
    • Jitter buffer features and operations
      • Features
      • Operations
    • OpenCore AMR codecs integration
      • Building and Installing OpenCORE AMR Library
      • Adding AMR Support in PJSIP
      • Testing PJSIP For OpenCORE AMR Support
    • Switchboard
    • WebRTC integration
  • Audio Troubleshooting
    • How to record audio with pjsua
    • Audio is breaking up
    • Audio drop-outs or “stutters”
    • High jitter value observed by remote party
    • Loud static noise
    • No audio is heard in local speaker
    • No audio is heard by remote party
    • Reducing audio latency
      • Overview
      • Optimizing sound device latency
      • Codec latency
      • Use audio switchboard
      • Choosing lower audio frame length
      • Optimizing Jitter Buffer Latency
      • Other sources of latency
    • Soft/quiet noise
    • Audio troubleshooting checklists
      • Checking that codec is negotiated properly by both parties
      • Check audio interconnection in the conference bridge
      • Check CPU utilization
      • Check for dangling call in PBX
      • Checking the quality of the sound device
      • Check for audio underflows/overflows
      • Check that correct device is used
      • Check by looping back microphone to speaker
      • Check if RTP packets are received
      • Testing and optimizing audio device with pjsystest
      • Checking by playing a WAV file
      • Check for problematic clock rate
      • Check for network impairments of incoming RTP packets
      • Check that audio is transmitting and to correct remote address
  • Build & Integration
    • Adding FFMPEG support
      • Installation
      • Building PJPROJECT with FFMPEG support
    • Mingw-w64
  • Development & Programming
    • Group Lock
      • Introduction
      • Usage
      • Debugging
      • Notes
    • Using thread with PJSUA initialization and shutdown
    • PJSIP Guide
    • Coding Style
      • Space indentation
      • Limit line length
      • Use ANSI C/C90 Standard
      • Use C style comment
      • No declaration after statement
      • Use Doxygen comments for API
      • Use K&R style brace placement
      • Multiline function arguments
      • Multiline comment indentation
      • Please observe existing code
  • Media
    • Integrating Third Party Media Stack into PJSUA-LIB
    • AI Connectivity
      • Overview
      • PJSUA2 API
      • PJMEDIA API
      • Events
      • Backends
      • Limitations
      • Sample app
    • Understanding Audio Media Flow
      • Introduction
      • Audio playback flow (the main flow)
      • Audio recording flow
      • Sound device timing problem
      • Incoming RTP/RTCP Packets
    • RTCP Feedback
    • Tone generator algorithms performance
      • The Algorithms
      • Accuracy
      • Performance
      • Conclusion
    • Transport Adapter
      • Introduction to media transport
      • Media transport adapter
      • Implementing a custom transport adapter
      • Integrating custom transport adapter
  • Network & NAT
    • Handling IP address change
      • Problem description
      • API: pjsua_handle_ip_change()
      • pjsua_handle_ip_change() flow
      • Notes and limitations
      • IP change scenarios
      • IP address change detection
    • IPv6 and NAT64 support
      • Availability
      • IPv6 Modes and Defaults (PJSIP 2.14+)
      • Enabling IPv6 support in application using PJSUA-LIB
      • IPv4 ↔ IPv6 transitions during IP address change
      • NAT64
      • References
    • Getting around blocked, filtered, or mangled VoIP network
      • Use TCP/TLS for SIP Traffic
      • Disable STUN
      • Relay RTP via TURN/TCP
      • Use Non-standard Ports for VoIP Services
    • Getting around NAT (for media)
      • Use STUN and/or TURN and/or ICE
      • Disabling VAD
      • Using Port Forwarding
      • Still having NAT problem?
    • QoS Support
      • Introduction on QoS
      • Availability
      • Objective
      • Design
      • Limitations
      • Using QoS in PJSIP Applications
      • References
    • Using SIP TCP Transport
      • Enabling TCP support
      • Sending Initial Requests
      • Contact Header
      • Subsequent Requests
      • Automatic Switch to TCP if Request is Larger than 1300 bytes
      • Additional Info about Registration
    • Using ICE in non-SIP Applications
      • Introduction
      • Terminology
      • Fitting ICE in the application
      • Preparations
      • Basic lifecycle
      • Notes
    • Using Trickle ICE
      • Brief info about Trickle ICE
      • How to enable
      • References
    • Troubleshooting ICE negotiation failure
      • How ICE works
      • Sample session
      • ICE negotiation failures
  • Performance & Footprint
    • Footprint Optimization
      • Overview
      • Reducing executable size
      • Reducing heap memory usage
    • ICE Heap Usage
      • Scope
      • How the memory usage is calculated
      • Call Setup
      • Checkpoints
      • Running with Default Settings
      • Optimizing the Memory Usage
      • More Optimized Results
      • Wait, There’s More!
      • Final Result
      • Conclusion
      • Appendix
    • Performance Optimization
      • Maximising performance
      • How to configure pjsip to serve thousands of calls
    • Media Performance (MIPS test)
      • Test Method
      • Interpreting the Results
      • Results
  • Security
    • SIP Digest Authentication
      • Overview
      • Build prerequisites
      • Selecting the digest algorithm (client side)
      • Issuing challenges (server side)
      • Helper APIs
      • AKA authentication
      • Backward compatibility and deprecations
      • See also
    • SRTP - Secure RTP (SDES and DTLS)
      • Introduction
      • Features
      • Requirements
      • How to integrate
      • Building PJSIP with SRTP Support
      • Using SRTP
      • AES-GCM support
    • SSL/TLS
      • Overview
      • Build-time decisions
      • Configuring TLS in your application
      • Operating TLS at runtime
      • Operational examples
      • Troubleshooting
      • See also
  • SIP
    • PJSIP Guide
    • Asynchronous SIP Authentication
      • Overview
      • PJSUA2 API
      • PJSUA-LIB API
      • PJSIP API
      • Design Notes
    • Busy Lamp Field (BLF) and Dialog Event
      • Overview
      • Enabling the package
      • PJSUA-LIB API
      • PJSUA2 API
      • Low-level PJSIP-Simple API
      • Dialog-info XML
      • Known limitations
      • References
    • Customizing SIP Messages
      • Account-level customization
      • Customizing outgoing calls (From / Contact / Call-ID)
      • Other SipTxOption / pjsua_msg_data fields
      • Modifying locally generated SDP
      • Patching messages with a PJSIP module
      • PJSUA-LIB equivalents
    • Implement DNS SRV failover
    • DTMF
      • Overview
      • Sending DTMF
      • Tuning RFC 4733 transmission
      • DTMF flash (event 16)
      • Receiving DTMF
      • SDP / capability negotiation
      • Sending inband DTMF tones
      • Implementing an inband DTMF detector
      • PJSUA-LIB equivalents
    • Real-Time Text (RFC 4103)
      • Overview
      • RTT vs SIP MESSAGE / instant messaging
      • Build prerequisites
      • Negotiating a text stream
      • Sending text
      • Receiving text
      • Redundancy level (RFC 4103 / RFC 2198)
      • Sample applications
      • PJSUA-LIB equivalents
    • Processing redirection (3xx) response
      • Features
      • Redirection with PJSIP API
      • Redirection with PJSUA-LIB API
      • Redirection with PJSUA2 API
      • Redirection in pjsua application
    • Reducing SIP message size
    • TCP/TLS Transport
    • URI Escaping
  • Video
    • Sample Applications with Video
    • Modifying Video Codec Parameters
      • Size or resolution
      • Framerate
      • Bitrate
    • Video Conference
      • How the bridge works
      • Bridge configuration and limits
      • Mixing layout
      • Default wiring
      • Looking up VideoMedia handles
      • Connecting and disconnecting flows
      • Three-party video conference
      • Adding a custom port
      • Asynchronous operations and completion callback
      • PJSUA-LIB equivalents
    • Audio/Video Synchronization
      • Default behaviour in PJSUA-LIB
      • AVI playback
      • How the synchronization works
      • Direct PJMEDIA API (custom pipelines)
      • PJSUA-LIB equivalents
    • Setting Video Capture Orientation
      • Strategy A — rotate at the capture device (default)
      • Strategy B — signal the peer (no device-side rotation)
    • Video Keyframe Transmission
      • Outgoing keyframe request
      • Incoming keyframe request
      • Keyframes at the start of a stream
      • Associated media events
      • PJSUA-LIB equivalents
    • Video Best Practices
      • Threading and GUI frameworks
      • Video window UX
    • Video Components and Backends
      • Capture devices
      • Renderer devices
      • Video codecs
      • Format converter
      • Media events
      • Where to look next
  • Video Troubleshooting
    • Choppy / frozen / blocky video
    • Green frames
    • “Invalid video device” / no preview
    • Network / IP change leaves video black
    • Lipsync drift
    • Low video quality despite good network
    • Mobile: video stops after backgrounding
    • No video at peer (persistent black)
    • Reducing video latency
    • Video troubleshooting checklists
      • Video-specific checks
      • Shared with audio troubleshooting
  • Other
    • PJSUA Command Line Interface (CLI) Manual
      • Introduction
      • Commands
    • iOS Push Notifications
      • Why VoIP push is required
      • Architecture overview
      • App lifecycle
      • Application-side: PushKit and CallKit integration
      • PJSIP-side configuration
      • Server-side checklist
      • Common pitfalls
      • Sample reference
      • PJSUA2 equivalents
    • Writing guide
      • Heading convention
      • Typography conventions
      • Cross referencing
      • Linking from external website
      • Notes, Warnings, and Blocks
      • Local TOC
      • Converting from Trac wiki

API Reference & Samples

  • PJSUA2
    • API Reference
      • User Agent
      • Account
      • Call
      • Media
      • Presence
      • Supporting APIs
    • PJSUA2 Samples
  • PJSUA-LIB
    • API Reference
    • PJSUA-LIB Samples
  • PJSIP
    • PJSIP Guide
    • API Reference
      • Compile Time Settings
      • Core
      • Message Elements
      • Transport
      • Authentication
      • Transaction Layer
      • Base UA/Common Dialog Layer
      • User Agent Layer
      • Event and Presence
    • PJSIP Samples
  • PJMEDIA
    • PJMEDIA Core
      • Core
      • Audio Features
      • Video Features
      • Transports
      • Media components (Ports)
      • Clock provider
      • Codec Framework
      • SDP
      • RTP and RTCP
      • Compile Time Settings
      • Basic Types and Functions
      • Endpoint
      • Formats
      • Media Flow
      • Events
    • PJMEDIA-Codec
      • Audio Codecs
      • Video Codecs
      • Detail information:
      • Android H.264, VP8, VP9 (native)
      • BCG729 (a G.729 compliant codec)
      • FFMPEG codecs (H.261, H.263, H.263P (H263-1998), H.264, MJPEG, VP8, VP9)
      • G.711
      • G.722
      • G.722.1/C
      • GSM FR
      • ILBC
      • Lyra (experimental)
      • OpenCore AMR NB/WB
      • OpenH264
      • Opus
      • Passthrough codecs
      • SILK
      • Speex
      • VP8 and VP9 (libvpx)
    • PJMEDIA-AudioDev
      • Overview
      • Using the Audio Device API
      • API Reference
      • Supported devices:
      • ALSA
      • Android OpenSL (deprecated)
      • Android JNI
      • Android Oboe
      • bdIMAD by BdSound
      • CoreAudio (Mac OS X and iPhone)
      • WMME (Windows and Windows Mobile devices)
      • WASAPI (Windows Audio Session API)
      • No longer supported devices:
      • PortAudio
      • Blackberry BB10
      • Nokia APS/VAS
      • Symbian MMF
    • PJMEDIA-VideoDev
      • API Reference
      • Supported devices
      • Android Camera2
      • AVI virtual device
      • AVFoundation (Mac and iOS) and UIView (iOS)
      • Colorbar
      • DirectShow (Windows)
      • FFMPEG
      • Metal (Mac and iOS)
      • OpenGL (desktops)/OpenGL ES 2 (Android, iOS)
      • QuickTime
      • SDL
      • Video4Linux
    • PJMEDIA Samples
  • PJNATH
    • Introduction to NAT and NAT Traversal
      • The NAT traversal problems
      • The NAT traversal solutions
      • ICE Solution - The Protocol that Works Harder
      • PJNATH - The building blocks for effective NAT traversal solution
    • API Reference
      • Basic Types and Functions
      • ICE and Trickle ICE
      • STUN
      • TURN
      • uPnP
      • NAT Type Detection
    • PJNATH Samples
  • PJLIB-UTIL
    • Basic Types and Functions
    • Command-Line Interface (CLI) Framework
    • Encoding and Encryptions
    • Text and Strings
    • DNS
    • HTTP
    • STUN
    • File Formats
  • PJLIB
    • Key Features
      • Extreme Portability
      • Small Footprint
      • Big in Performance
      • No Dynamic Memory Allocations
      • Rich Features
    • API Reference
      • Basic Types and Functions
      • Infrastructure
      • Data structure
      • Network
      • SSL/Secure Socket
      • File
      • Memory Management
      • String & Unicode
      • Multithreading and Concurrency
      • OS Abstraction
      • Time and Timer
      • Random and GUID
      • Application Microframework
      • Unit Testing
  • All Samples
    • PJSUA2 Samples
    • PJSUA-LIB Samples
    • PJSIP Samples
    • PJMEDIA Samples
    • PJNATH Samples
PJSIP Project
  • Call Related Types
  • View page source

Call Related Types

group PJSUA2_Call_Data_Structure

Typedefs

typedef void *MediaStream

Media stream, corresponds to pjmedia_stream

typedef void *MediaTransport

Media transport, corresponds to pjmedia_transport

typedef IntVector MediaDirVector

Array of media direction

typedef std::vector<CallMediaInfo> CallMediaInfoVector

Array of call media info

struct MathStat
#include <call.hpp>

This structure describes statistics state.

Public Functions

MathStat()

Default constructor

void fromPj(const pj_math_stat &prm)

Convert from pjsip

Public Members

int n

number of samples

int max

maximum value

int min

minimum value

int last

last value

int mean

mean

struct LossType
#include <call.hpp>

Types of loss detected.

Public Members

unsigned burst

Burst/sequential packet lost detected

unsigned random

Random packet lost detected.

struct RtcpStreamStat
#include <call.hpp>

Unidirectional RTP stream statistics.

Public Functions

void fromPj(const pjmedia_rtcp_stream_stat &prm)

Convert from pjsip

Public Members

TimeVal update

Time of last update.

unsigned updateCount

Number of updates (to calculate avg)

unsigned pkt

Total number of packets

unsigned bytes

Total number of payload/bytes

unsigned discard

Total number of discarded packets.

unsigned loss

Total number of packets lost

unsigned reorder

Total number of out of order packets

unsigned dup

Total number of duplicates packets

MathStat lossPeriodUsec

Loss period statistics

LossType lossType

Types of loss detected.

MathStat jitterUsec

Jitter statistics

struct RtcpSdes
#include <call.hpp>

RTCP SDES structure.

Public Functions

void fromPj(const pjmedia_rtcp_sdes &prm)

Convert from pjsip

Public Members

string cname

RTCP SDES type CNAME.

string name

RTCP SDES type NAME.

string email

RTCP SDES type EMAIL.

string phone

RTCP SDES type PHONE.

string loc

RTCP SDES type LOC.

string tool

RTCP SDES type TOOL.

string note

RTCP SDES type NOTE.

struct RtcpStat
#include <call.hpp>

Bidirectional RTP stream statistics.

Public Functions

void fromPj(const pjmedia_rtcp_stat &prm)

Convert from pjsip

Public Members

TimeVal start

Time when session was created

RtcpStreamStat txStat

Encoder stream statistics.

RtcpStreamStat rxStat

Decoder stream statistics.

MathStat rttUsec

Round trip delay statistic.

pj_uint32_t rtpTxLastTs

Last TX RTP timestamp.

pj_uint16_t rtpTxLastSeq

Last TX RTP sequence.

MathStat rxIpdvUsec

Statistics of IP packet delay variation in receiving direction. It is only used when PJMEDIA_RTCP_STAT_HAS_IPDV is set to non-zero.

MathStat rxRawJitterUsec

Statistic of raw jitter in receiving direction. It is only used when PJMEDIA_RTCP_STAT_HAS_RAW_JITTER is set to non-zero.

RtcpSdes peerSdes

Peer SDES.

struct JbufState
#include <call.hpp>

This structure describes jitter buffer state.

Public Functions

void fromPj(const pjmedia_jb_state &prm)

Convert from pjsip

Public Members

unsigned frameSize

Individual frame size, in bytes.

unsigned minPrefetch

Minimum allowed prefetch, in frms.

unsigned maxPrefetch

Maximum allowed prefetch, in frms.

unsigned burst

Current burst level, in frames

unsigned prefetch

Current prefetch value, in frames

unsigned size

Current buffer size, in frames.

unsigned avgDelayMsec

Average delay, in ms.

unsigned minDelayMsec

Minimum delay, in ms.

unsigned maxDelayMsec

Maximum delay, in ms.

unsigned devDelayMsec

Standard deviation of delay, in ms.

unsigned avgBurst

Average burst, in frames.

unsigned lost

Number of lost frames.

unsigned discard

Number of discarded frames.

unsigned empty

Number of empty on GET events.

struct SdpSession
#include <call.hpp>

This structure describes SDP session description. It corresponds to the pjmedia_sdp_session structure.

Public Functions

void fromPj(const pjmedia_sdp_session &sdp)

Convert from pjsip

Public Members

string wholeSdp

The whole SDP as a string.

void *pjSdpSession

Pointer to its original pjmedia_sdp_session. Only valid when the struct is converted from PJSIP’s pjmedia_sdp_session.

struct MediaTransportInfo
#include <call.hpp>

This structure describes media transport informations. It corresponds to the pjmedia_transport_info structure. The address name field can be empty string if the address in the pjmedia_transport_info is invalid.

Public Functions

void fromPj(const pjmedia_transport_info &info)

Convert from pjsip

Public Members

SocketAddress localRtpName

Address to be advertised as the local address for the RTP socket, which does not need to be equal as the bound address (for example, this address can be the address resolved with STUN).

SocketAddress localRtcpName

Address to be advertised as the local address for the RTCP socket, which does not need to be equal as the bound address (for example, this address can be the address resolved with STUN).

SocketAddress srcRtpName

Remote address where RTP originated from. This can be empty string if no data is received from the remote.

SocketAddress srcRtcpName

Remote address where RTCP originated from. This can be empty string if no data is recevied from the remote.

struct CallSetting
#include <call.hpp>

Call settings.

Public Functions

CallSetting(bool useDefaultValues = false)

Default constructor initializes with empty or default values.

bool isEmpty() const

Check if the settings are set with empty values.

Returns:

True if the settings are empty.

void fromPj(const pjsua_call_setting &prm)

Convert from pjsip

pjsua_call_setting toPj() const

Convert to pjsip

Public Members

unsigned flag

Bitmask of pjsua_call_flag constants.

Default: 0 (PJSUA_CALL_INCLUDE_DISABLED_MEDIA is the legacy default value).

unsigned reqKeyframeMethod

This flag controls what methods to request keyframe are allowed on the call. Value is bitmask of pjsua_vid_req_keyframe_method.

Default: PJSUA_VID_REQ_KEYFRAME_SIP_INFO | PJSUA_VID_REQ_KEYFRAME_RTCP_PLI

unsigned audioCount

Number of simultaneous active audio streams for this call. Setting this to zero will disable audio in this call.

Default: 1

unsigned videoCount

Number of simultaneous active video streams for this call. Setting this to zero will disable video in this call.

Default: 1 (if video feature is enabled, otherwise it is zero)

unsigned textCount

Number of simultaneous active text streams for this call. Setting this to zero will disable text in this call.

Default: 1

MediaDirVector mediaDir

Media direction. This setting will only be used if the flag PJSUA_CALL_SET_MEDIA_DIR is set, and it will persist for subsequent offers or answers. For example, a media that is set as PJMEDIA_DIR_ENCODING can only mark the stream in the SDP as sendonly or inactive, but will not become sendrecv in subsequent offers and answers. Application can update the media direction in any API or callback that accepts CallSetting as a parameter, such as via Call::reinvite/update() or in onCallRxOffer/Reinvite() callback.

The index of the media dir will correspond to the provisional media in CallInfo.provMedia. For offers that involve adding new medias (such as initial offer), the index will correspond to all new audio media first, then video. For example, for a new call with 2 audios and 1 video, mediaDir[0] and mediaDir[1] will be for the audios, and mediaDir[2] video.

Default: empty vector

string customCallId

User defined Call-ID to be sent out with outgoing INVITE.

Note: It is up to the developer to verify uniqueness of the Call-ID as there will be no verification. The developer must change the Call-ID between calls creating a unique id for each outgoing call.

This setting will only be used when creating a new outgoing call via Call::makeCall().

struct CallMediaInfo
#include <call.hpp>

Call media information.

Application can query conference bridge port of this media using Call::getAudioMedia() if the media type is audio, or Call::getEncodingVideoMedia() / Call::getDecodingVideoMedia() if the media type is video.

Public Functions

CallMediaInfo()

Default constructor

void fromPj(const pjsua_call_media_info &prm)

Convert from pjsip

Public Members

unsigned index

Media index in SDP.

pjmedia_type type

Media type.

pjmedia_dir dir

Media direction.

pjsua_call_media_status status

Call media status.

int audioConfSlot

Warning: this is deprecated, application can query conference bridge port of this media using Call::getAudioMedia().

The conference port number for the call. Only valid if the media type is audio.

pjsua_vid_win_id videoIncomingWindowId

The window id for incoming video, if any, or PJSUA_INVALID_ID. Only valid if the media type is video.

VideoWindow videoWindow

The video window instance for incoming video. Only valid if videoIncomingWindowId is not PJSUA_INVALID_ID and the media type is video.

pjmedia_vid_dev_index videoCapDev

The video capture device for outgoing transmission, if any, or PJMEDIA_VID_INVALID_DEV. Only valid if the media type is video.

struct CallInfo
#include <call.hpp>

Call information. Application can query the call information by calling Call::getInfo().

Public Functions

inline CallInfo()

Default constructor

void fromPj(const pjsua_call_info &pci)

Convert from pjsip

Public Members

pjsua_call_id id

Call identification.

pjsip_role_e role

Initial call role (UAC == caller)

pjsua_acc_id accId

The account ID where this call belongs.

string localUri

Local URI

string localContact

Local Contact

string remoteUri

Remote URI

string remoteContact

Remote contact

string callIdString

Dialog Call-ID string.

CallSetting setting

Call setting

pjsip_inv_state state

Call state

string stateText

Text describing the state

pjsip_status_code lastStatusCode

Last status code heard, which can be used as cause code

string lastReason

The reason phrase describing the last status.

CallMediaInfoVector media

Array of active media information.

CallMediaInfoVector provMedia

Array of provisional media information. This contains the media info in the provisioning state, that is when the media session is being created/updated (SDP offer/answer is on progress).

TimeVal connectDuration

Up-to-date call connected duration (zero when call is not established)

TimeVal totalDuration

Total call duration, including set-up time

bool remOfferer

Flag if remote was SDP offerer

unsigned remAudioCount

Number of audio streams offered by remote

unsigned remVideoCount

Number of video streams offered by remote

unsigned remTextCount

Number of text streams offered by remote

struct StreamInfo
#include <call.hpp>

Media stream info.

Public Functions

inline StreamInfo()

Default constructor

void fromPj(const pjsua_stream_info &info)

Convert from pjsip

Public Members

pjmedia_type type

Media type of this stream.

pjmedia_tp_proto proto

Transport protocol (RTP/AVP, etc.)

pjmedia_dir dir

Media direction.

SocketAddress remoteRtpAddress

Remote RTP address

SocketAddress remoteRtcpAddress

Optional remote RTCP address

unsigned txPt

Outgoing codec payload type.

unsigned rxPt

Incoming codec payload type.

int audTxEventPt

Outgoing pt for audio telephone-events.

int audRxEventPt

Incoming pt for audio telephone-events.

string codecName

Codec name.

unsigned codecClockRate

Codec clock rate.

CodecParam audCodecParam

Optional audio codec param.

VidCodecParam vidCodecParam

Optional video codec param.

int jbInit

Jitter buffer init delay in msec.

int jbMinPre

Jitter buffer minimum prefetch delay in msec.

int jbMaxPre

Jitter buffer maximum prefetch delay in msec.

int jbMax

Jitter buffer max delay in msec.

pjmedia_jb_discard_algo jbDiscardAlgo

Jitter buffer discard algorithm.

bool rtcpSdesByeDisabled

Disable automatic sending of RTCP SDES and BYE.

struct StreamStat
#include <call.hpp>

Media stream statistic.

Public Functions

void fromPj(const pjsua_stream_stat &prm)

Convert from pjsip

Public Members

RtcpStat rtcp

RTCP statistic.

JbufState jbuf

Jitter buffer statistic.

struct OnCallStateParam
#include <call.hpp>

This structure contains parameters for Call::onCallState() callback.

Public Members

SipEvent e

Event which causes the call state to change.

struct OnCallTsxStateParam
#include <call.hpp>

This structure contains parameters for Call::onCallTsxState() callback.

Public Members

SipEvent e

Transaction event that caused the state change.

struct OnCallMediaStateParam
#include <call.hpp>

This structure contains parameters for Call::onCallMediaState() callback.

struct OnCallSdpCreatedParam
#include <call.hpp>

This structure contains parameters for Call::onCallSdpCreated() callback.

Public Members

SdpSession sdp

The SDP has just been created.

SdpSession remSdp

The remote SDP, will be empty if local is SDP offerer.

struct OnStreamPreCreateParam
#include <call.hpp>

This structure contains parameters for Call::onStreamPreCreate() callback.

Public Members

unsigned streamIdx

Stream index in the media session, read-only.

StreamInfo streamInfo

Parameters that the stream will be created from.

struct OnStreamCreatedParam
#include <call.hpp>

This structure contains parameters for Call::onStreamCreated() callback.

Public Members

MediaStream stream

Audio media stream, read-only.

unsigned streamIdx

Stream index in the audio media session, read-only.

bool destroyPort

Specify if PJSUA2 should take ownership of the port returned in the pPort parameter below. If set to true, pjmedia_port_destroy() will be called on the port when it is no longer needed.

Default: false

MediaPort pPort

On input, it specifies the audio media port of the stream. Application may modify this pointer to point to different media port to be registered to the conference bridge.

struct OnStreamDestroyedParam
#include <call.hpp>

This structure contains parameters for Call::onStreamDestroyed() callback.

Public Members

MediaStream stream

Audio media stream.

unsigned streamIdx

Stream index in the audio media session.

struct OnDtmfDigitParam
#include <call.hpp>

This structure contains parameters for Call::onDtmfDigit() callback.

Public Members

pjsua_dtmf_method method

DTMF sending method.

string digit

DTMF ASCII digit.

unsigned duration

DTMF signal duration. If the duration is unknown, this value is set to PJSUA_UNKNOWN_DTMF_DURATION.

struct OnDtmfEventParam
#include <call.hpp>

This structure contains parameters for Call::onDtmfEvent() callback.

Public Members

pjsua_dtmf_method method

DTMF sending method.

unsigned timestamp

The timestamp identifying the begin of the event. Timestamp units are expressed in milliseconds. Note that this value should only be used to compare multiple events received via the same method relatively to each other, as the time-base is randomized.

string digit

DTMF ASCII digit.

unsigned duration

DTMF signal duration in milliseconds. Interpretation of the duration depends on the flag PJMEDIA_STREAM_DTMF_IS_END. depends on the method. If the method is PJSUA_DTMF_METHOD_SIP_INFO, this contains the total duration of the DTMF signal or PJSUA_UNKNOWN_DTMF_DURATION if no signal duration was indicated. If the method is PJSUA_DTMF_METHOD_RFC2833, this contains the total duration of the DTMF signal received up to this point in time.

unsigned flags

Flags indicating additional information about the DTMF event. If PJMEDIA_STREAM_DTMF_IS_UPDATE is set, the event was already indicated earlier. The new indication contains an updated event duration. If PJMEDIA_STREAM_DTMF_IS_END is set, the event has ended and this indication contains the final event duration. Note that end indications might get lost. Hence it is not guaranteed to receive an event with PJMEDIA_STREAM_DTMF_IS_END for every event.

struct OnCallRxTextParam
#include <call.hpp>

This structure contains parameters for Call::onCallRxText() callback.

Public Functions

void fromPj(const pjsua_txt_stream_data &prm)

Convert from pjsip

Public Members

int seq

The sequence of the incoming text block data.

unsigned ts

The timestamp of the text block data.

string text

The content of the text block. Note that the text can be empty.

struct OnCallTransferRequestParam
#include <call.hpp>

This structure contains parameters for Call::onCallTransferRequest() callback.

Public Members

string dstUri

The destination where the call will be transferred to.

pjsip_status_code statusCode

Status code to be returned for the call transfer request. On input, it contains status code 202.

CallSetting opt

The current call setting, application can update this setting for the call being transferred.

Call *newCall

New Call derived object instantiated by application when the call transfer is about to be accepted.

struct OnCallTransferStatusParam
#include <call.hpp>

This structure contains parameters for Call::onCallTransferStatus() callback.

Public Members

pjsip_status_code statusCode

Status progress of the transfer request.

string reason

Status progress reason.

bool finalNotify

If true, no further notification will be reported. The statusCode specified in this callback is the final status.

bool cont

Initially will be set to true, application can set this to false if it no longer wants to receive further notification (for example, after it hangs up the call).

struct OnCallReplaceRequestParam
#include <call.hpp>

This structure contains parameters for Call::onCallReplaceRequest() callback.

Public Members

SipRxData rdata

The incoming INVITE request to replace the call.

pjsip_status_code statusCode

Status code to be set by application. Application should only return a final status (>= PJSIP_SC_OK (200))

string reason

Optional status text to be set by application.

CallSetting opt

The current call setting, application can update this setting for the call being replaced.

Call *newCall

New Call derived object instantiated by application.

struct OnCallReplacedParam
#include <call.hpp>

This structure contains parameters for Call::onCallReplaced() callback.

Public Members

pjsua_call_id newCallId

The new call id.

Call *newCall

New Call derived object instantiated by application.

struct OnCallRxOfferParam
#include <call.hpp>

This structure contains parameters for Call::onCallRxOffer() callback.

Public Members

SdpSession offer

The new offer received.

pjsip_status_code statusCode

Status code to be returned for answering the offer. On input, it contains status code PJSIP_SC_OK (200). Currently, valid values are only PJSIP_SC_OK (200) and PJSIP_SC_NOT_ACCEPTABLE_HERE (488).

CallSetting opt

The current call setting, application can update this setting for answering the offer.

struct OnCallRxReinviteParam
#include <call.hpp>

This structure contains parameters for Call::onCallRxReinvite() callback.

Public Members

SdpSession offer

The new offer received.

SipRxData rdata

The incoming re-INVITE.

bool isAsync

On input, it is false. Set to true if app wants to manually answer the re-INVITE.

pjsip_status_code statusCode

Status code to be returned for answering the offer. On input, it contains status code PJSIP_SC_OK (200). Currently, valid values are only PJSIP_SC_OK (200) and PJSIP_SC_NOT_ACCEPTABLE_HERE (488).

CallSetting opt

The current call setting, application can update this setting for answering the offer.

struct OnCallTxOfferParam
#include <call.hpp>

This structure contains parameters for Call::onCallTxOffer() callback.

Public Members

CallSetting opt

The current call setting, application can update this setting for generating the offer. Note that application should maintain any active media to avoid the need for the peer to reject the offer.

struct OnCallRedirectedParam
#include <call.hpp>

This structure contains parameters for Call::onCallRedirected() callback.

Public Members

string targetUri

The current target to be tried.

SipEvent e

The event that caused this callback to be called. This could be the receipt of 3xx response, or 4xx/5xx response received for the INVITE sent to subsequent targets, or empty (e.type == PJSIP_EVENT_UNKNOWN) if this callback is called from within Call::processRedirect() context.

struct OnCallMediaEventParam
#include <call.hpp>

This structure contains parameters for Call::onCallMediaEvent() callback.

Public Members

unsigned medIdx

The media stream index.

MediaEvent ev

The media event.

struct OnCallMediaTransportStateParam
#include <call.hpp>

This structure contains parameters for Call::onCallMediaTransportState() callback.

Public Members

unsigned medIdx

The media index.

pjsua_med_tp_st state

The media transport state

pj_status_t status

The last error code related to the media transport state.

int sipErrorCode

Optional SIP error code.

struct OnCreateMediaTransportParam
#include <call.hpp>

This structure contains parameters for Call::onCreateMediaTransport() callback.

Public Members

unsigned mediaIdx

The media index in the SDP for which this media transport will be used.

MediaTransport mediaTp

The media transport which otherwise will be used by the call has this callback not been implemented. Application can change this to its own instance of media transport to be used by the call.

unsigned flags

Bitmask from pjsua_create_media_transport_flag.

struct OnCreateMediaTransportSrtpParam
#include <call.hpp>

This structure contains parameters for Call::onCreateMediaTransportSrtp() callback.

Public Members

unsigned mediaIdx

The media index in the SDP for which the SRTP media transport will be used.

pjmedia_srtp_use srtpUse

Specify whether secure media transport should be used. Application can modify this only for initial INVITE. Valid values are PJMEDIA_SRTP_DISABLED, PJMEDIA_SRTP_OPTIONAL, and PJMEDIA_SRTP_MANDATORY.

SrtpCryptoVector cryptos

Application can modify this to specify the cryptos and keys which are going to be used.


© Copyright 2025, Teluu.

Built with Sphinx using a theme provided by Read the Docs.