<html>
<head>
<base href="https://wiki.asterisk.org/wiki">
<link rel="stylesheet" href="/wiki/s/en/2176/25/9/_/styles/combined.css?spaceKey=AST&forWysiwyg=true" type="text/css">
</head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
<h2><a href="https://wiki.asterisk.org/wiki/display/AST/New+SIP+channel+driver">New SIP channel driver</a></h2>
<h4>Page <b>edited</b> by <a href="https://wiki.asterisk.org/wiki/display/~mmichelson">Mark Michelson</a>
</h4>
<div id="versionComment">
<b>Comment:</b>
Fill in project page a bit more. Details will be coming shortly.<br />
</div>
<br/>
<h4>Changes (42)</h4>
<div id="page-diffs">
<table class="diff" cellpadding="0" cellspacing="0">
<tr><td class="diff-unchanged" >{warning} <br></td></tr>
<tr><td class="diff-changed-lines" >This page is currently under construction. <span class="diff-added-words"style="background-color: #dfd;">Please refrain from making comments at this time.</span> <br></td></tr>
<tr><td class="diff-unchanged" >{warning} <br> <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" >The new chan_sip will use a third-party SIP stack. Research is currently being done into various offerings. SIP stack research can be found [here|AST:SIP Stack Research]. <br> <br></td></tr>
<tr><td class="diff-unchanged" >h3. Configuration <br> <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" >h3. Use cases <br> <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Since A SIP channel driver has so many use cases, these reside on their own separate page <br>{note} <br>Put link to use case page here <br>{note} <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">Since A SIP channel driver has so many use cases, these reside on their own sub-page. See the bottom of this page for a link to the use cases. <br></td></tr>
<tr><td class="diff-unchanged" > <br>h3. Documentation <br> <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">The purpose of this section is to provide the minimum requirements the project must fulfill. This can take several forms depending on the project; project developers should choose the schemes that best fit the project they are developing. This section should also provide details about the project from an end-user perspective. This can include dialplan configuration, sample configuration files, API descriptions, etc. <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">In order to increase adoption of the new chan_sip and encourage enhancement, detailed documentation MUST be provided. <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">If needed, break this section up into multiple subsections. Several subsection examples are provided below; feel free to use/remove these as your project dictates. <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">h5. In-code documentation <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">{info} <br>If sufficiently complex, subpages should be used to provide reference information. In particular, sufficiently large configuration schemas and detailed API descriptions may benefit from their own subpage. <br>{info} <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">This can be broken into two categories <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2. Use Cases <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">* API documentation (i.e. Doxygen) <br>* User documentation (i.e. XML documentation) <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Assuming a use case approach is used, the following can be used as a model. <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">This is standard for all code in Asterisk. All functions must have thorough doxygen documentation, and all applications, dialplan functions, manager actions, and manager events must have XML. <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3. Use Case: Bob calls Alice <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">h5. Configuration sample <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Actor: Alice <br>Actor: Bob <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">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. <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Scenario: <br>* Bob picks up his phone. He dials Alice's extension. <br>* Bob hears a ringing indication. <br>* Alice's phone rings. <br>* Alice picks up her phone. <br>* Both Bob and Alice's phones stop ringing. <br>* Both Bob and Alice can talk to each other and hear the other person. <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">h5. Wiki documentation <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2. User Stories <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">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. <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Assuming a user story approach is used, the following can be used as a model. <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">h3. APIs <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">* As a user of a SIP phone, I want to be able to pick up my SIP phone, dial an extension, and hear a ringing indication while I wait for the other phone to be picked up. <br>* As a user of a SIP phone, I want to be able to speak with another user using a SIP phone if they answer when I call them. <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">Add an entry for each Application, Function, AMI command, AMI event, AGI command, CLI command, or other external way of interacting with the features provided by the project. Different APIs require different sets of documentation; in general, sufficient documentation should be provided to create the standard XML documentation for that particular item. <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2. Configuration <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">h1. Design <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3. project.conf <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h4. \[general\] <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">h1. Test Plan <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">|| Parameter || Description || Type || Default Value || <br>| foo | Turns feature foo on or off | Boolean | True | <br>| bar | A comma delineated list of bar items (pun intended?) | String | | <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">The new chan_sip test plan can be found at <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3. RealTime schemas <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">{note} <br>insert test plan page here <br>{note} <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h2. APIs <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">h1. Project Planning <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Add an entry for each Application, Function, AMI command, AMI event, AGI command, CLI command, or other external way of interacting with the features provided by the project. Different APIs require different sets of documentation; in general, sufficient documentation should be provided to create the standard XML documentation for that particular item. <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">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|http://lists.digium.com/mailman/listinfo/asterisk-dev] <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h1. Design <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">h1. Reference information <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">For sufficiently complex projects, a high level design may be needed to illustrate how the project plugs into the overall Asterisk architecture. Sufficiently detailed design of the project should be provided such that newcomers to the Asterisk project are provided a conceptual view of the construction of the implementation. <br> <br>Note that the design should be independent of the implementation, i.e., if the code is not drastically changed, it should not require updates to this section. <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">The decision to move forward with a new chan_sip was made at [AstriDevCon 2012]. <br></td></tr>
</table>
</div> <h4>Full Content</h4>
<div class="notificationGreySide">
<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>This page is currently under construction. Please refrain from making comments at this time.</td></tr></table></div>
<div>
<ul>
<li><a href='#NewSIPchanneldriver-ProjectOverview'>Project Overview</a></li>
<li><a href='#NewSIPchanneldriver-RequirementsandSpecification'>Requirements and Specification</a></li>
<ul>
<li><a href='#NewSIPchanneldriver-SIPstack'>SIP stack</a></li>
<li><a href='#NewSIPchanneldriver-Configuration'>Configuration</a></li>
<li><a href='#NewSIPchanneldriver-Features'>Features</a></li>
<li><a href='#NewSIPchanneldriver-Usecases'>Use cases</a></li>
<li><a href='#NewSIPchanneldriver-Documentation'>Documentation</a></li>
<li><a href='#NewSIPchanneldriver-APIs'>APIs</a></li>
</ul>
<li><a href='#NewSIPchanneldriver-Design'>Design</a></li>
<li><a href='#NewSIPchanneldriver-TestPlan'>Test Plan</a></li>
<li><a href='#NewSIPchanneldriver-ProjectPlanning'>Project Planning</a></li>
<li><a href='#NewSIPchanneldriver-Referenceinformation'>Reference information</a></li>
</ul></div>
<h1><a name="NewSIPchanneldriver-ProjectOverview"></a>Project Overview</h1>
<p>This project's aim is to create a new SIP channel driver to be included in Asterisk 12.</p>
<p>Asterisk's current SIP channel driver (hereon referred to as "chan_sip") basically has the flaw of being poorly architected.</p>
<ul>
        <li>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.</li>
        <li>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.</li>
        <li>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.</li>
        <li>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.</li>
</ul>
<p>As of 1 November, 2012, chan_sip issues occupy 24% of the issue tracker</p>
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>GET STATS FROM JIRA ABOUT ISSUE COUNT, ETC.</td></tr></table></div>
<p>The issue count in JIRA should go a long way in showing the difficulty Asterisk developers have in maintaining chan_sip.</p>
<p>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 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.</p>
<h1><a name="NewSIPchanneldriver-RequirementsandSpecification"></a>Requirements and Specification</h1>
<h3><a name="NewSIPchanneldriver-SIPstack"></a>SIP stack</h3>
<p>The new chan_sip will use a third-party SIP stack. Research is currently being done into various offerings. SIP stack research can be found <a href="/wiki/display/AST/SIP+Stack+Research" title="SIP Stack Research">here</a>.</p>
<h3><a name="NewSIPchanneldriver-Configuration"></a>Configuration</h3>
<p>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.</p>
<h3><a name="NewSIPchanneldriver-Features"></a>Features</h3>
<p>A brief overview of features for the new chan_sip includes:</p>
<ul>
        <li>Transports (all IPv4 and IPv6)
        <ul>
                <li>UDP</li>
                <li>TCP</li>
                <li>TLS</li>
                <li>Websocket</li>
        </ul>
        </li>
        <li>Authentication</li>
        <li>Media sessions
        <ul>
                <li>Basic phone calls</li>
                <li>Call transfer</li>
                <li>Audio/video capability negotiation</li>
        </ul>
        </li>
        <li>Registration
        <ul>
                <li>Registrar for incoming registrations</li>
                <li>Client registration (i.e. outgoing registration)</li>
        </ul>
        </li>
        <li>Subscriptions
        <ul>
                <li>Presence</li>
                <li>Dialog-info</li>
                <li>Message-summary</li>
                <li>Call-completion</li>
        </ul>
        </li>
        <li>Messaging
        <ul>
                <li>Out-of-call messaging</li>
        </ul>
        </li>
</ul>
<h3><a name="NewSIPchanneldriver-Usecases"></a>Use cases</h3>
<p>Since A SIP channel driver has so many use cases, these reside on their own sub-page. See the bottom of this page for a link to the use cases.</p>
<h3><a name="NewSIPchanneldriver-Documentation"></a>Documentation</h3>
<p>In order to increase adoption of the new chan_sip and encourage enhancement, detailed documentation MUST be provided.</p>
<h5><a name="NewSIPchanneldriver-Incodedocumentation"></a>In-code documentation</h5>
<p>This can be broken into two categories</p>
<ul>
        <li>API documentation (i.e. Doxygen)</li>
        <li>User documentation (i.e. XML documentation)</li>
</ul>
<p>This is standard for all code in Asterisk. All functions must have thorough doxygen documentation, and all applications, dialplan functions, manager actions, and manager events must have XML.</p>
<h5><a name="NewSIPchanneldriver-Configurationsample"></a>Configuration sample</h5>
<p>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.</p>
<h5><a name="NewSIPchanneldriver-Wikidocumentation"></a>Wiki documentation</h5>
<p>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.</p>
<h3><a name="NewSIPchanneldriver-APIs"></a>APIs</h3>
<p>Add an entry for each Application, Function, AMI command, AMI event, AGI command, CLI command, or other external way of interacting with the features provided by the project. Different APIs require different sets of documentation; in general, sufficient documentation should be provided to create the standard XML documentation for that particular item.</p>
<h1><a name="NewSIPchanneldriver-Design"></a>Design</h1>
<h1><a name="NewSIPchanneldriver-TestPlan"></a>Test Plan</h1>
<p>The new chan_sip test plan can be found at</p>
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>insert test plan page here</td></tr></table></div>
<h1><a name="NewSIPchanneldriver-ProjectPlanning"></a>Project Planning</h1>
<p>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 <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" class="external-link" rel="nofollow">Asterisk developers mailing list</a></p>
<h1><a name="NewSIPchanneldriver-Referenceinformation"></a>Reference information</h1>
<p>The decision to move forward with a new chan_sip was made at <a href="/wiki/display/AST/AstriDevCon+2012" title="AstriDevCon 2012">AstriDevCon 2012</a>.</p>
</div>
<div id="commentsSection" class="wiki-content pageSection">
<div style="float: right;" class="grey">
<a href="https://wiki.asterisk.org/wiki/users/removespacenotification.action?spaceKey=AST">Stop watching space</a>
<span style="padding: 0px 5px;">|</span>
<a href="https://wiki.asterisk.org/wiki/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
<a href="https://wiki.asterisk.org/wiki/display/AST/New+SIP+channel+driver">View Online</a>
|
<a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=21464232&revisedVersion=5&originalVersion=4">View Changes</a>
|
<a href="https://wiki.asterisk.org/wiki/display/AST/New+SIP+channel+driver?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>