<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/en/2176/25/9/_/styles/combined.css?spaceKey=AST&amp;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>
        <br/>
                         <h4>Changes (3)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h3. Features <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3. Testing <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">A brief overview of features for the new chan_sip includes: <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">* Transports (all IPv4 and IPv6) <br>** UDP <br>** TCP <br>** TLS <br>** Websocket <br>* Authentication <br>* Media sessions <br>** Basic phone calls <br>** Call transfer <br>** Audio/video capability negotiation <br>* Registration <br>** Registrar for incoming registrations <br>** Client registration (i.e. outgoing registration) <br>* Subscriptions <br>** Presence <br>** Dialog-info <br>** Message-summary <br>** Call-completion <br>* Messaging <br>** Out-of-call messaging <br> <br>h3. Use cases <br> <br>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> <br></td></tr>
            <tr><td class="diff-unchanged" >h3. Documentation <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<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.</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>
<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>
</ul>
    <li><a href='#NewSIPchanneldriver-UseCases'>Use Cases</a></li>
<ul>
    <li><a href='#NewSIPchanneldriver-UseCase%3ABobcallsAlice'>Use Case: Bob calls Alice</a></li>
</ul>
    <li><a href='#NewSIPchanneldriver-UserStories'>User Stories</a></li>
    <li><a href='#NewSIPchanneldriver-Configuration'>Configuration</a></li>
<ul>
    <li><a href='#NewSIPchanneldriver-project.conf'>project.conf</a></li>
    <li><a href='#NewSIPchanneldriver-RealTimeschemas'>RealTime schemas</a></li>
</ul>
    <li><a href='#NewSIPchanneldriver-APIs'>APIs</a></li>
</ul>
    <li><a href='#NewSIPchanneldriver-Design'>Design</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 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 SIP stack research link here</td></tr></table></div>

<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 separate page</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>Put link to use case page here</td></tr></table></div>

<h3><a name="NewSIPchanneldriver-Documentation"></a>Documentation</h3>

<p>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.</p>

<p>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.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>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.</td></tr></table></div>

<h2><a name="NewSIPchanneldriver-UseCases"></a>Use Cases</h2>

<p>Assuming a use case approach is used, the following can be used as a model.</p>

<h3><a name="NewSIPchanneldriver-UseCase%3ABobcallsAlice"></a>Use Case: Bob calls Alice</h3>

<p>Actor: Alice<br/>
Actor: Bob</p>

<p>Scenario:</p>
<ul>
        <li>Bob picks up his phone.  He dials Alice's extension.</li>
        <li>Bob hears a ringing indication.</li>
        <li>Alice's phone rings.</li>
        <li>Alice picks up her phone.</li>
        <li>Both Bob and Alice's phones stop ringing.</li>
        <li>Both Bob and Alice can talk to each other and hear the other person.</li>
</ul>


<h2><a name="NewSIPchanneldriver-UserStories"></a>User Stories</h2>

<p>Assuming a user story approach is used, the following can be used as a model.</p>

<ul>
        <li>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.</li>
        <li>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.</li>
</ul>


<h2><a name="NewSIPchanneldriver-Configuration"></a>Configuration</h2>

<h3><a name="NewSIPchanneldriver-project.conf"></a>project.conf</h3>

<h4><a name="NewSIPchanneldriver-%5Cgeneral%5C"></a>[general]</h4>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Parameter </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Default Value </th>
</tr>
<tr>
<td class='confluenceTd'> foo </td>
<td class='confluenceTd'> Turns feature foo on or off </td>
<td class='confluenceTd'> Boolean </td>
<td class='confluenceTd'> True </td>
</tr>
<tr>
<td class='confluenceTd'> bar </td>
<td class='confluenceTd'> A comma delineated list of bar items (pun intended?) </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
</tbody></table>
</div>


<h3><a name="NewSIPchanneldriver-RealTimeschemas"></a>RealTime schemas</h3>

<h2><a name="NewSIPchanneldriver-APIs"></a>APIs</h2>

<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>

<p>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.</p>

<p>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.</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=3&originalVersion=2">View Changes</a>
                |
        <a href="https://wiki.asterisk.org/wiki/display/AST/New+SIP+channel+driver?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>