<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>
<br/>
<h4>Changes (16)</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" >* 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. <br> <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">As of 1 November, 2012, chan_sip issues occupy 24% of the issue tracker <br>{note} <br>GET STATS FROM JIRA ABOUT ISSUE COUNT, ETC. <br>{note} <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">[Here|https://issues.asterisk.org/jira/secure/IssueNavigator.jspa?mode=hide&requestId=11822] is an up-to-date list of open issues against chan_sip. This accounts for about a quarter of the open issues in JIRA at present. The issue count in JIRA should go a long way in showing the difficulty Asterisk developers have in maintaining chan_sip. <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;">The issue count in JIRA should go a long way in showing the difficulty Asterisk developers have in maintaining chan_sip. <br> <br></td></tr>
<tr><td class="diff-unchanged" >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. <br> <br>h1. Requirements and Specification <br> <br></td></tr>
<tr><td class="diff-changed-lines" ><span class="diff-changed-words">h<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">3</span><span class="diff-added-chars"style="background-color: #dfd;">2</span>.</span> SIP stack <br></td></tr>
<tr><td class="diff-unchanged" > <br>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-changed-lines" ><span class="diff-changed-words">h<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">3</span><span class="diff-added-chars"style="background-color: #dfd;">2</span>.</span> Configuration <br></td></tr>
<tr><td class="diff-unchanged" > <br>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. <br> <br></td></tr>
<tr><td class="diff-changed-lines" ><span class="diff-changed-words">h<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">3</span><span class="diff-added-chars"style="background-color: #dfd;">2</span>.</span> Features <br></td></tr>
<tr><td class="diff-unchanged" > <br>A brief overview of features for the new chan_sip includes: <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" >** TLS <br>** Websocket <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">* Authentication <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">* Digest authentication <br></td></tr>
<tr><td class="diff-unchanged" >* Media sessions <br>** Basic phone calls <br>** Call transfer <br>** Audio/video capability negotiation (to include T.38 negotiation) <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">** Direct media <br>** Session timers <br></td></tr>
<tr><td class="diff-unchanged" >* Registration <br>** Registrar for incoming registrations <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" >** Out-of-call messaging <br> <br></td></tr>
<tr><td class="diff-changed-lines" ><span class="diff-changed-words">h<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">3</span><span class="diff-added-chars"style="background-color: #dfd;">2</span>.</span> Use cases <br></td></tr>
<tr><td class="diff-unchanged" > <br>Since A SIP channel driver has so many use cases, these reside on their own sub-page. SIP use cases can be found [here|SIP use cases]. <br> <br></td></tr>
<tr><td class="diff-changed-lines" ><span class="diff-changed-words">h<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">3</span><span class="diff-added-chars"style="background-color: #dfd;">2</span>.</span> Documentation <br></td></tr>
<tr><td class="diff-unchanged" > <br>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-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" >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> <br></td></tr>
<tr><td class="diff-changed-lines" ><span class="diff-changed-words">h<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">3</span><span class="diff-added-chars"style="background-color: #dfd;">2</span>.</span> 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;">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;">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 <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">h3. Dialplan applications <br> <br>h5. Legacy applications <br> <br>* [SIPDtmfMode|Asterisk 11 Application_SIPDtmfMode] <br>* [SIPAddHeader|Asterisk 11 Application_SIPAddHeader] <br>* [SIPRemoveHeader|Asterisk 11 Application_SIPRemoveHeader] <br>* [SIPSendCustomINFO|Asterisk 11 Application_SIPSendCustomINFO] <br> <br>h5. New applications <br> <br>TBD <br> <br>h3. Dialplan functions <br> <br>h5. Legacy functions <br> <br>* [CHANNEL|Asterisk 11 Function_CHANNEL] (The SIP-specific bits) <br>* [SIP_HEADER|Asterisk 11 Function_SIP_HEADER] <br>* [SIPPEER|Asterisk 11 Function_SIPPEER] <br>* [CHECKSIPDOMAIN|Asterisk 11 Function_CHECKSIPDOMAIN] <br> <br>h5. New functions <br> <br>TBD <br> <br>h3. CLI commands <br> <br>h5. Legacy CLI commands <br> <br>* sip show channels <br>* sip show channelstats <br>* sip show domains <br>* sip show inuse <br>* sip show objects <br>* sip show peers <br>* sip show peer <br>* sip show users <br>* sip show user <br>* sip show registry <br>* sip show settings <br>* sip show mwi <br>* sip show channel <br>* sip show history <br>* sip show sched <br>* sip show tcp <br>* sip prune realtime <br>* sip debug <br>* sip set history <br>* sip reload <br>* sip qualify peer <br>* sip unregister <br>* sip notify <br> <br>h5. New CLI commands <br> <br>TBD <br> <br>h3. Manager commands <br> <br>h5. Legacy Manager commands <br> <br>* [SIPPeers|Asterisk 11 ManagerAction_SIPPeers] <br>* [SIPshowpeer|Asterisk 11 ManagerAction_SIPshowpeer] <br>* [SIPqualifypeer|Asterisk 11 ManagerAction_SIPqualifypeer] <br>* [SIPshowregistry|Asterisk 11 ManagerAction_SIPshowregistry] <br>* [SIPnotify|Asterisk 11 ManagerAction_SIPnotify] <br>* [SIPpeerstatus|Asterisk 11 ManagerAction_SIPpeerstatus] <br> <br>h5. New Manager commands <br> <br>TBD <br> <br>h3. AGI commands <br> <br>h5. Legacy AGI commands <br> <br>None <br> <br>h5. New AGI commands <br> <br>TBD <br> <br></td></tr>
<tr><td class="diff-unchanged" >h1. Design <br> <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">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. <br></td></tr>
<tr><td class="diff-unchanged" > <br>h1. Test Plan <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. 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-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>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><a href="https://issues.asterisk.org/jira/secure/IssueNavigator.jspa?mode=hide&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 a quarter of the open issues in JIRA at present. 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>
<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>
<h2><a name="NewSIPchanneldriver-Features"></a>Features</h2>
<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>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>
        </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.</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>
<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 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=7&originalVersion=6">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>