<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 (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">{warning} <br>This page is currently under construction. Please refrain from making comments at this time. <br>{warning} <br> <br></td></tr>
            <tr><td class="diff-unchanged" >{toc:maxlevel=3} <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <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-Dialplanapplications'>Dialplan applications</a></li>
    <li><a href='#NewSIPchanneldriver-Dialplanfunctions'>Dialplan functions</a></li>
    <li><a href='#NewSIPchanneldriver-CLIcommands'>CLI commands</a></li>
    <li><a href='#NewSIPchanneldriver-Managercommands'>Manager commands</a></li>
    <li><a href='#NewSIPchanneldriver-AGIcommands'>AGI commands</a></li>
</ul>
</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>chan_sip takes up the lion's share of issues in the issue tracker. <a href="https://issues.asterisk.org/jira/secure/IssueNavigator.jspa?mode=hide&amp;requestId=11822" class="external-link" rel="nofollow">Here</a> 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.</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>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.</p>

<h1><a name="NewSIPchanneldriver-RequirementsandSpecification"></a>Requirements and Specification</h1>

<h2><a name="NewSIPchanneldriver-SIPstack"></a>SIP stack</h2>

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

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

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

<p>At this stage, no configuration schema have been devised. This will be added as it is decided.</p>

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

<p>A brief high-level 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>Digest authentication</li>
        <li>Media sessions
        <ul>
                <li>Basic phone calls</li>
                <li>Call transfer</li>
                <li>Audio/video capability negotiation (to include T.38 negotiation)</li>
                <li>Direct media</li>
                <li>Session timers</li>
                <li>Party Identity</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>


<h2><a name="NewSIPchanneldriver-Usecases"></a>Use cases</h2>

<p>Since A SIP channel driver has so many use cases, these reside on their own sub-page. SIP use cases can be found <a href="/wiki/display/AST/SIP+use+cases" title="SIP use cases">here</a>.</p>

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

<p>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.</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>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.  Links to documentation pages will be added here as documentation is written.</p>

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

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

<h3><a name="NewSIPchanneldriver-Dialplanapplications"></a>Dialplan applications</h3>

<h5><a name="NewSIPchanneldriver-Legacyapplications"></a>Legacy applications</h5>

<ul>
        <li><a href="/wiki/display/AST/Asterisk+11+Application_SIPDtmfMode" title="Asterisk 11 Application_SIPDtmfMode">SIPDtmfMode</a></li>
        <li><a href="/wiki/display/AST/Asterisk+11+Application_SIPAddHeader" title="Asterisk 11 Application_SIPAddHeader">SIPAddHeader</a></li>
        <li><a href="/wiki/display/AST/Asterisk+11+Application_SIPRemoveHeader" title="Asterisk 11 Application_SIPRemoveHeader">SIPRemoveHeader</a></li>
        <li><a href="/wiki/display/AST/Asterisk+11+Application_SIPSendCustomINFO" title="Asterisk 11 Application_SIPSendCustomINFO">SIPSendCustomINFO</a></li>
</ul>


<h5><a name="NewSIPchanneldriver-Newapplications"></a>New applications</h5>

<p>TBD</p>

<h3><a name="NewSIPchanneldriver-Dialplanfunctions"></a>Dialplan functions</h3>

<h5><a name="NewSIPchanneldriver-Legacyfunctions"></a>Legacy functions</h5>

<ul>
        <li><a href="/wiki/display/AST/Asterisk+11+Function_CHANNEL" title="Asterisk 11 Function_CHANNEL">CHANNEL</a> (The SIP-specific bits)</li>
        <li><a href="/wiki/display/AST/Asterisk+11+Function_SIP_HEADER" title="Asterisk 11 Function_SIP_HEADER">SIP_HEADER</a></li>
        <li><a href="/wiki/display/AST/Asterisk+11+Function_SIPPEER" title="Asterisk 11 Function_SIPPEER">SIPPEER</a></li>
        <li><a href="/wiki/display/AST/Asterisk+11+Function_CHECKSIPDOMAIN" title="Asterisk 11 Function_CHECKSIPDOMAIN">CHECKSIPDOMAIN</a></li>
</ul>


<h5><a name="NewSIPchanneldriver-Newfunctions"></a>New functions</h5>

<p>TBD</p>

<h3><a name="NewSIPchanneldriver-CLIcommands"></a>CLI commands</h3>

<h5><a name="NewSIPchanneldriver-LegacyCLIcommands"></a>Legacy CLI commands</h5>

<ul>
        <li>sip show channels</li>
        <li>sip show channelstats</li>
        <li>sip show domains</li>
        <li>sip show inuse</li>
        <li>sip show objects</li>
        <li>sip show peers</li>
        <li>sip show peer</li>
        <li>sip show users</li>
        <li>sip show user</li>
        <li>sip show registry</li>
        <li>sip show settings</li>
        <li>sip show mwi</li>
        <li>sip show channel</li>
        <li>sip show history</li>
        <li>sip show sched</li>
        <li>sip show tcp</li>
        <li>sip prune realtime</li>
        <li>sip debug</li>
        <li>sip set history</li>
        <li>sip reload</li>
        <li>sip qualify peer</li>
        <li>sip unregister</li>
        <li>sip notify</li>
</ul>


<h5><a name="NewSIPchanneldriver-NewCLIcommands"></a>New CLI commands</h5>

<p>TBD</p>

<h3><a name="NewSIPchanneldriver-Managercommands"></a>Manager commands</h3>

<h5><a name="NewSIPchanneldriver-LegacyManagercommands"></a>Legacy Manager commands</h5>

<ul>
        <li><a href="/wiki/display/AST/Asterisk+11+ManagerAction_SIPpeers" title="Asterisk 11 ManagerAction_SIPpeers">SIPPeers</a></li>
        <li><a href="/wiki/display/AST/Asterisk+11+ManagerAction_SIPshowpeer" title="Asterisk 11 ManagerAction_SIPshowpeer">SIPshowpeer</a></li>
        <li><a href="/wiki/display/AST/Asterisk+11+ManagerAction_SIPqualifypeer" title="Asterisk 11 ManagerAction_SIPqualifypeer">SIPqualifypeer</a></li>
        <li><a href="/wiki/display/AST/Asterisk+11+ManagerAction_SIPshowregistry" title="Asterisk 11 ManagerAction_SIPshowregistry">SIPshowregistry</a></li>
        <li><a href="/wiki/display/AST/Asterisk+11+ManagerAction_SIPnotify" title="Asterisk 11 ManagerAction_SIPnotify">SIPnotify</a></li>
        <li><a href="/wiki/display/AST/Asterisk+11+ManagerAction_SIPpeerstatus" title="Asterisk 11 ManagerAction_SIPpeerstatus">SIPpeerstatus</a></li>
</ul>


<h5><a name="NewSIPchanneldriver-NewManagercommands"></a>New Manager commands</h5>

<p>TBD</p>

<h3><a name="NewSIPchanneldriver-AGIcommands"></a>AGI commands</h3>

<h5><a name="NewSIPchanneldriver-LegacyAGIcommands"></a>Legacy AGI commands</h5>

<p>None</p>

<h5><a name="NewSIPchanneldriver-NewAGIcommands"></a>New AGI commands</h5>

<p>TBD</p>

<h1><a name="NewSIPchanneldriver-Design"></a>Design</h1>

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

<h1><a name="NewSIPchanneldriver-TestPlan"></a>Test Plan</h1>

<p>The new chan_sip test plan can be found <a href="/wiki/display/AST/SIP+Test+Plan" title="SIP Test Plan">here</a></p>

<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=11&originalVersion=10">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>