Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column

Overview 

Asterisk 12 and later versions contain two SIP stacks: one, the original chan_sip SIP channel driver that has been present in all previous releases of Asterisk, and a new SIP stack that is based on pjproject. For more information on configuring the new SIP stack, see Configuring res_pjsip.

Because earlier releases of pjproject cannot build shared object libraries, some changes were required in order to use it with Asterisk 12. As such, Asterisk requires pjproject version 2.4 or later (2.6 is current). Alternatively, an Asterisk compatible version of pjproject is available on  github , or - depending on your Linux distribution - available as a package.

Earlier versions of pjproject downloaded from www.pjsip.org will not work with Asterisk 12. 

Tip

Asterisk 11 uses an embedded pjproject for the ICE, STUN and TURN libraries in its RTP engine for WebSockets support. Therefore you do not need to follow the instructions here for Asterisk 11.
Asterisk 12 and 13
dynamically link to pjproject.
Asterisk >= 13.8.0 can dynamically link to pjproject but also contains a bundled version of pjproject. See Using the Bundled Version of pjproject

Column
Panel
titleOn this Page

Table of Contents
maxLevel2

...

If you're using Asterisk 13.8.0 or greater, consider using the Bundled Version of pjproject.

Warning

If you have previously installed a version of pjproject, you must remove that version of pjproject prior to building and installing the Asterisk 12 compatible version of pjproject. See Uninstalling pjproject for more information.

Downloading pjproject

...

  1. Use wget to pull the latest version (currently 2.6) from www.pjsip.org. Note that the instructions assume that this is 2.4.56; for the latest version, refer to www.pjsip.org:

    No Format
    # wget http://www.pjsip.org/release/2.4.56/pjproject-2.46.5.tar.bz2
    
    # tar -xjvf pjproject-2.46.5.tar.bz2

Obtaining the latest pjproject from the svn repo:

...

Code Block
titlepjlib/include/pj/config_site.h
linenumberstrue
languagecpp
/*
 * Asterisk config_site.h
 */
#include <sys/select.h>


/*
 * Defining PJMEDIA_HAS_SRTP to 0 does NOT disable Asterisk's ability to use srtp.
 * It only disables the pjmedia srtp transport which Asterisk doesn't use.
 * The reason for the disable is that while Asterisk works fine with older libsrtp
 * versions, newer versions of pjproject won't compile with them.
 */
#define PJMEDIA_HAS_SRTP 0
 
/*
 * Defining PJMEDIA_HAS_WEBRTC_AEC to 0 does NOT disable Asterisk's ability to use
 * WebRTC.  It only disables the pjmedia webrtc transport which Asterisk doesn't use.
 */
#define PJMEDIA_HAS_WEBRTC_AEC 0

#define PJ_HAS_IPV6 1
#define NDEBUG 1
#define PJ_MAX_HOSTNAME (256)
#define PJSIP_MAX_URL_SIZE (512)
#ifdef PJ_HAS_LINUX_EPOLL
#define PJ_IOQUEUE_MAX_HANDLES	(5000)
#else
#define PJ_IOQUEUE_MAX_HANDLES	(FD_SETSIZE)
#endif
#define PJ_IOQUEUE_HAS_SAFE_UNREG 1
#define PJ_IOQUEUE_MAX_EVENTS_IN_SINGLE_POLL (16)
#define PJ_SCANNER_USE_BITWISE	0
#define PJ_OS_HAS_CHECK_STACK	0
#define PJ_LOG_MAX_LEVEL		6
#define PJ_ENABLE_EXTRA_CHECK	1
#define PJSIP_MAX_TSX_COUNT		((64*1024)-1)
#define PJSIP_MAX_DIALOG_COUNT	((64*1024)-1)
#define PJSIP_UDP_SO_SNDBUF_SIZE	(512*1024)
#define PJSIP_UDP_SO_RCVBUF_SIZE	(512*1024)
#define PJ_DEBUG			0
#define PJSIP_SAFE_MODULE		0
#define PJ_HAS_STRICMP_ALNUM		0

/*
 * Do not ever enable PJ_HASH_USE_OWN_TOLOWER because the algorithm is
 * inconsistently used when calculating the hash value and doesn't
 * convert the same characters as pj_tolower()/tolower().  Thus you
 * can get different hash values if the string hashed has certain
 * characters in it.  (ASCII '@', '[', '\\', ']', '^', and '_')
 */
#undef PJ_HASH_USE_OWN_TOLOWER

/*
  It is imperative that PJSIP_UNESCAPE_IN_PLACE remain 0 or undefined.
  Enabling it will result in SEGFAULTS when URIs containing escape sequences are encountered.
*/
#undef PJSIP_UNESCAPE_IN_PLACE
#define PJSIP_MAX_PKT_LEN			6000
#undef PJ_TODO
#define PJ_TODO(x)
/* Defaults too low for WebRTC */
#define PJ_ICE_MAX_CAND 32
#define PJ_ICE_MAX_CHECKS (PJ_ICE_MAX_CAND * PJ_ICE_MAX_CAND)
/* Increase limits to allow more formats */
#define	PJMEDIA_MAX_SDP_FMT   64
#define	PJMEDIA_MAX_SDP_BANDW   4
#define	PJMEDIA_MAX_SDP_ATTR   (PJMEDIA_MAX_SDP_FMT*2 + 4)
#define	PJMEDIA_MAX_SDP_MEDIA   16
 

...

First, if you're using Asterisk 13.8.0 or greater, consider switching to the Bundled Version of pjproject

Asterisk fails to detect pjproject libraries

...