This project's aim is to create a new SIP channel driver to be included in Asterisk 12.
Asterisk's current SIP channel driver (hereon referred to as "chan_sip") basically has the flaw of being poorly architected.
- The code is not arranged in a stack. Attempting to add elements such as a new transport or other new feature means touching the code in places you would never expect to have to touch.
- chan_sip is monolithic; all aspects of SIP reside in the channel driver. Attempting to have a SIP registrar that does not accept calls is not easy.
- Fixing bugs in chan_sip is rarely straightforward. Changing code in order to fix one bug usually leads to new faults being discovered as a result.
- chan_sip takes up the lion's share of issues in the issue tracker. Here is an up-to-date list of open issues against chan_sip. This accounts for about 25% of the open issues in the issue tracker.
- Many limitations are deeply-ingrained in chan_sip. For instance, trying to change chan_sip to support binding to multiple addresses would require huge changes.
Asterisk developers have on several occasions attempted projects to give chan_sip a transaction layer, or to give it some semblance of a refactor. In every case, they've found that the magnitute of their efforts was much greater than originally expected. In the end, their frustration got the better of them and they reported that the effort that it would take in order to do whatever task they were doing would be better spent in rewriting chan_sip altogether.
Requirements and Specification
The new chan_sip will use a third-party SIP stack. Research was done into various offerings. SIP stack research can be found here. The result of the research was to choose PJSIP as the SIP stack. This was communicated on the asterisk-dev mailing list on December 10th, 2012.
As part of this work, pjproject has been pulled out of the Asterisk source tree and placed into its own Git repository. The repository is available at git://github.com/asterisk/pjproject.git.
Check-out pjproject from the github repository
Configure pjproject to produce shared objects in the /usr directory (or in an appropriate folder in which your system expects shared objects to reside)
Compile pjproject and install
Configuration for the new chan_sip will be redesigned entirely. Configuration will be more modular, allowing easier control over aspects than previously allowed. At the same time, the new chan_sip MUST be backwards-compatible with the old chan_sip's configuration to ease upgrade. The tentative plan for this is to parse old configuration and translate the options into their new equivalents where possible.
At this stage, no configuration schema have been devised. This will be added as it is decided.
A brief high-level overview of features for the new chan_sip includes:
- Transports (all IPv4 and IPv6)
- Digest authentication
- Media sessions
- Basic phone calls
- Call transfer
- Audio/video capability negotiation (to include T.38 negotiation)
- Direct media
- Session timers
- Party Identity
- Registrar for incoming registrations
- Client registration (i.e. outgoing registration)
- Out-of-call messaging
Since A SIP channel driver has so many use cases, these reside on their own sub-page. SIP use cases can be found here.
In order to increase adoption of the new chan_sip and encourage enhancement, detailed documentation MUST be provided. Documentation will be provided in several forms.
This can be broken into two categories
- API documentation (i.e. Doxygen)
- User documentation (i.e. XML documentation)
All functions must have thorough doxygen documentation, and all applications, dialplan functions, manager actions, and manager events must have XML.
A sample configuration will be included. The sample configuration will serve to be a minimal documentation of options. More detailed explanations may be found on the wiki.
The wiki will be used to document high-level information, ranging from configuration option details to an explanation of the threading model and architecture for developers. Links to documentation pages will be added here as documentation is written.
At a minimum, all dialplan applications, dialplan functions, manager commands, and CLI commands that worked with the old chan_sip must also work with new chan_sip. The following will be present
Legacy CLI commands
- sip show channels
- sip show channelstats
- sip show domains
- sip show inuse
- sip show objects
- sip show peers
- sip show peer
- sip show users
- sip show user
- sip show registry
- sip show settings
- sip show mwi
- sip show channel
- sip show history
- sip show sched
- sip show tcp
- sip prune realtime
- sip debug
- sip set history
- sip reload
- sip qualify peer
- sip unregister
- sip notify
New CLI commands
Legacy Manager commands
New Manager commands
Legacy AGI commands
New AGI commands
Since a SIP stack has not been chosen yet, it is difficult to go about trying to design anything. As design is done, more will be added here.
The new chan_sip test plan can be found here
Jira issues will be posted here for the new chan_sip as they become created. If you are interested in helping with any of these, feel free to step forward and help out. Please comment on the specific Jira issue rather than on this page. If you wish to have more in-depth discussions about a task you wish to take on, then please direct the discussion to the Asterisk developers mailing list
The decision to move forward with a new chan_sip was made at AstriDevCon 2012.
res_sip and res_sip_session design review
Initial work for res_sip and res_sip_session: Inbound and outbound calls work
SIP authentication support
Pimp My SIP Media Improvements
Make new SIP work make use of threadpool
Fix pjproject's build system to support shared objects