Chan_PJSIP is a Session Initiation Protocol (SIP) driver for Asterisk, an open-source communication platform that enables the creation of custom voice, video, and messaging applications. PJSIP stands for Portable SIP Stack, and it is a powerful and flexible SIP implementation that provides advanced features and better performance than some of the older SIP stacks. Chan_PJSIP was introduced in Asterisk version 12 as a replacement for the older Chan_SIP driver, and it has become the default SIP driver in Asterisk version 15 and above.
Features of Chan_PJSIP
Chan_PJSIP offers a number of advanced features that make it a powerful tool for building modern voice and video applications. Some of the key features include:
- Support for WebRTC – Chan_PJSIP includes native support for WebRTC, a powerful open-source framework for real-time communication over the web. This makes it easy to build browser-based voice and video applications that can be accessed from any device with an internet connection.
- Improved audio and video quality – Chan_PJSIP includes advanced audio and video codecs that provide better quality and lower latency than some of the older codecs used by Chan_SIP. This can lead to a better user experience for voice and video calls.
- Enhanced security – Chan_PJSIP includes support for Transport Layer Security (TLS), which provides end-to-end encryption for SIP traffic. It also includes improved authentication and authorization mechanisms, which can help to prevent unauthorized access to the system.
- Better scalability – Chan_PJSIP is designed to be more scalable than Chan_SIP, with improved support for multithreading and better memory management. This makes it a good choice for high-traffic environments where performance is critical.
- Advanced call handling features – Chan_PJSIP includes advanced call handling features, such as call hold, call transfer, call parking, and call forwarding. It also supports advanced call routing and dialplan features, which can help to create more sophisticated call flows.
Advantages of Chan_PJSIP
There are many advantages to using Chan_PJSIP for your Asterisk-based telephony solution. These include:
- Better performance – Chan_PJSIP is designed to be faster and more efficient than some of the older SIP drivers, which can lead to better performance and improved call quality.
- Improved security – Chan_PJSIP includes built-in support for TLS and other security features, which can help to protect your system from unauthorized access or malicious attacks.
- Better scalability – Chan_PJSIP is designed to be highly scalable, which makes it a good choice for large or complex telephony solutions.
- Advanced call handling features – Chan_PJSIP includes many advanced call handling features, such as call hold, call transfer, and call forwarding. This can help to create more sophisticated call flows and improve the user experience.
- Support for WebRTC – Chan_PJSIP includes native support for WebRTC, which makes it easy to build browser-based voice and video applications that can be accessed from any device with an internet connection.
Disadvantages of Chan_PJSIP
While Chan_PJSIP has many advantages, there are also some potential disadvantages to consider. These include:
- Complexity – Chan_PJSIP can be more complex to configure than some of the older SIP drivers, especially for users who are new to Asterisk or SIP-based telephony solutions.
- Limited compatibility – Chan_PJSIP is a relatively new technology, and as such may not be fully compatible with all SIP endpoints or technologies. This could lead to interoperability issues with some systems.
- Resource requirements – Chan_PJSIP may require more resources, such as memory or CPU, than some of the older SIP drivers. This could be a concern for users with limited hardware resources or for systems that are running multiple applications.
- Lack of documentation – Chan_PJSIP is a relatively new technology, and as such, there may be limited documentation or community support available for users who run into issues.
- Learning curve – Because Chan_PJSIP is a new technology, it may take some time for users to learn how to configure and use it effectively. This could be a barrier to adoption for some users.
How to use Chan_PJSIP
To use Chan_PJSIP with Asterisk, you will need to install the module and configure it using the Asterisk configuration files. Here are the basic steps to get started:
- Install the Chan_PJSIP module – You can install the module using the Asterisk package manager or by building it from the source.
- Configure the module – You will need to configure the module using the Asterisk configuration files. This will involve setting up endpoints, authentication, and dialplan rules.
- Test the configuration – Once you have configured the module, you can test it by making and receiving calls using SIP endpoints.
- Troubleshoot any issues – If you encounter any issues during the testing phase, you may need to troubleshoot your configuration and make adjustments as necessary.
Chan_PJSIP Datasheet
Operating Systems Supported
- Mac OS X
- Windows (32 and 64bit), including Windows 10
- Linux/uClinux
- Smartphones:
- iOS
- Android
- Windows Mobile/Windows CE
- Windows Phone 10/Universal Windows Platform (UWP)
- Community supported:
- OpenBSD
- FreeBSD
- Solaris
- MinGW
- RTEMS
- Embox
SIP Capabilities
- Base specs:
- Transports:
- Routing/NAT:
- Call:
- Offer/answer (RFC 3264)
- hold, unhold
- SIP redirection
- transfer/REFER (attended and unattended):
- sipfrag support (RFC 3420)
- norefersub (RFC 4488)
- UPDATE (RFC 3311)
- 100rel/PRACK (RFC 3262)
- tel: URI (RFC 3966)
- Session Timers (RFC 4028)
- Reason header (RFC 3326, partially supported)
- P-Header (RFC 3325, partially supported)
- SDP:
- Multipart (RFC 2046, RFC 5621)
- Presence and IM:
- Other extensions:
- Compliance, best current practices:
- Issues with Non-INVITE transaction (RFC 4320)
- Issues with INVITE transaction (RFC 4321)
- Multiple dialog usages (RFC 5057)
- SIP torture messages (RFC 4475, tested when applicable)
- SIP torture for IPv6 (RFC 5118)
- Message Body Handling (RFC 5621. Partial compliance: multipart is supported, but Content-Disposition header is not handled)
- The use of SIPS (RFC 5630. Partial compliance: SIPS is supported, but still make use of transport=tls parameter)
NAT Traversal
- STUN:
- TURN:
- ICE:
- NAT type detection:
- legacy RFC 3489
- Other:
- QoS support on sockets (DSCP, WMM)
Media/audio capabilities
- Core:
- any clockrates
- N-channels support
- zero thread
- Base:
- DTMF (RFC 4733/RFC 2833)
- echo cancellation (WebRTC, Speex, suppressor, or native)
- Third party acoustic echo cancellation (AEC)
- inband DTMF/tone generation
- WAV file playback and recording
- WAV file playlist
- memory based playback and capture
- adaptive jitter buffer
- packet lost concealment
- clock drift recovery
- Audio conferencing (in client)
- Flexible media flow management
- Audio Codecs:
- Bundled:
- Speex 8KHz, 16Khz, 32KHz
- iLBC, GSM,
- L16, G.711A/U (PCMA/PCMU),
- G.722,
- G.722.1 16KHz/32KHz (Siren7/Siren14, licensed from Polycom)
- with third-party libraries (may need additional licensing, please check each codec provider):
- Opus codec (See also opus-codec.org)
- Intel IPP:
- AMR-NB, AMR-WB,
- G.722, G.722.1,
- G.723.1, G.726, G.728, G.729A,
- SILK codec
- OpenCore AMR:
- AMR-NB
- AMR-WB
- bcg729: G.729
- Hardware codecs:
- on iPhone: iLBC
- Platform-specific/native codecs:
- on Android (Mediacodec): AMR-NB, AMR-WB
- Bundled:
- Transports:
- Audio devices:
- native WMME (Windows, Windows Mobile)
- native ALSA (Linux)
- native CoreAudio (Mac OS X, iPhone) with support for native/hardware EC
- native Android (via JNI)
- OpenSL (Android)
- PortAudio (WMME, DirectSound, OSS, ALSA, CoreAudio, etc.)
Video Media
- Platforms:
- Windows,
- Linux,
- Mac
- iOS
- Android
- Codecs:
- H.263-1998 (ffmpeg)
- H.264 (OpenH264, VideoToolbox (iOS and Mac), ffmpeg+x264, Mediacodec (Android))
- VP8 (libvpx, Mediacodec (Android))
- VP9 (libvpx, Mediacodec (Android))
- Capture devices:
- colorbar (all platforms)
- DirectShow (Windows)
- Video4Linux2 (Linux)
- QuickTime (Mac OS X)
- AVFoundation (iOS)
- Rendering devices:
- SDL (Windows, Linux, and Mac OS X)
- OpenGL ES or UIView (iOS)
- Video conferencing (in client)
- Flexible media flow management
Conclusion
Chan_PJSIP is a powerful and flexible SIP driver for Asterisk that offers many advanced features and better performance than some of the older SIP drivers. It includes native support for WebRTC, improved audio and video quality, enhanced security features, and better scalability. While there are some potential disadvantages, such as complexity and limited compatibility, these can be overcome with proper configuration and troubleshooting. Overall, Chan_PJSIP is a good choice for building modern voice and video applications that require advanced call handling and routing features.