[asterisk-dev] SIP Stack - Update
mjordan at digium.com
Mon Dec 10 19:56:41 CST 2012
Recently, we've had a lot of discussion about which SIP stack to use for
a new SIP channel driver . Josh's initial research  resulted in
three candidates: Sofia-sip, reSIProcate, and pjproject. All three SIP
stacks have various advantages and disadvantages, which the community
discussed in depth . While there are many factors to consider in the
choice of a SIP stack, the discussion primarily landed on whether or not
the SIP stack could be available as a package outside of the Asterisk
Of the three candidates, both Sofia-sip and reSIProcate are available as
packages. However, it was determined that Sofia-sip is no longer
actively maintained, and the largest project that utilizes it currently
embeds it within their source. While there may be options there, the
fact that there is no active upstream maintainer of the Sofia-sip stack
means that we would become the SIP stack maintainers ourselves, which
would be a very limited improvement from the current state of SIP in
This leaves reSIProcate and pjproject. reSIProcate is a fantastic SIP
stack that is available as a package on some distros; it is, however,
written in C++ and does not currently declare an API compatible with C
linkage. The pjproject SIP stack is also a great SIP stack and one that
Digium is very familiar with; however, it is not available as a package
and its build system is oriented toward embedding in a project. As both
have similar SIP capabilities, this leads us to the following two questions:
1) If a C++ SIP stack were chosen, what effect would that have on the
SIP channel driver that uses it, and on the Asterisk project as a whole?
2) Is it possible to package pjproject?
The second was easier to answer. While not exactly a trivial effort, it
is possible to modify the pjproject build system to produce shared
object libraries suitable for packaging. Teluu has agreed to support
such an effort, although the work would have to be started by the
Asterisk project. The initial project to create such a package is
outlined on the Asterisk wiki . At a minimum, Digium will work to create:
* A Git repository with a modified build system that produces shared
object libraries and install targets of the libraries needed by Asterisk.
* Tarballs on downloads.asterisk.org.
* A package for CentOS.
Ideally, the entire repository would end up being pushed up stream, but
this would work in the interim to pull pjproject outside of the Asterisk
source. The results of this effort will be available for developers who
are interested in using them as the basis for creating and maintaining
packages for other distributions.
The first question was harder: what impact would a C++ SIP stack have on
the Asterisk project? There are two facets to this:
1) The technical impact on using C++ libraries in C
2) The impact on the Asterisk community.
The first poses significant problems – for a full write up, see . To
summarize that page, the C++ model of memory management, error handling,
and building has major implications that would fundamentally change the
Asterisk project. That leads to the second issue - given that Asterisk's
developer community have traditionally written modules in C, a C++ SIP
stack would potentially create a barrier for entry in development for
the current community. Based on those two problems, using a SIP stack
written in C++ would have to be a last resort for the Asterisk project.
Given all of the above, we feel that going with pjproject as a SIP stack
is feasible and the best option for Asterisk. If Asterisk were written
in C++ I'm certain we would have chosen reSIProcate, but as it is, the
only major issue with pjproject is its lack of a package, which I
believe we can address. Thanks to everyone who has participated in the
discussion – with your input, I think we have what is the best path
forward for Asterisk.
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
More information about the asterisk-dev