<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/2042/">https://reviewboard.asterisk.org/r/2042/</a>
     </td>
    </tr>
   </table>
   <br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By corruptor.</div>





<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I&#39;ve noticed that we can remove particular extension from context with dialplan remove extension command but in order to remove all extensions in the context we should delete them on by one. I&#39;ve created dialplan remove context command which uses ast_context_destroy to destroy the whole context with all extensions. I&#39;ve created to functions for in pbx_config.c: handle_cli_dialplan_remove_context which actually removes context and complete_dialplan_remove_context which completes input. They are based on other similar functions and pretty trivial but I can be mistaken somewhere.

I&#39;ve also modified dialplan add include &lt;context2&gt; into &lt;context1&gt;. I&#39;ve made it similar dialplan add extension ... command. It creates &lt;context1&gt; if it doesn&#39;t exist and I&#39;ve also modified complete_dialplan_add_include and removed check for existance of &lt;context2&gt; because we can include non-existent context into another one. (I usually include empty (non-existent) contexts in advance). Should we raise warning in this case as it&#39;s raised while reading extensions.conf?

I use those functions with AMI. I think manager commands should be created in addition to those CLI commands.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">We&#39;ve used both functions very often for the last couple of months and they seem to work good.
</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/pbx/pbx_config.c <span style="color: grey">(370052)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/2042/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>




  </div>
 </body>
</html>