[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [asterisk-dev] [Code Review] 3650: pbx_config: Add manager command equivalents to 'dialplan add 
From:       "Jonathan Rose" <reviewboard () asterisk ! org>
Date:       2014-06-27 20:00:47
Message-ID: 20140627200047.10806.16424 () sonic ! digium ! api
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3650/
-----------------------------------------------------------

(Updated June 27, 2014, 3 p.m.)


Review request for Asterisk Developers, Matt Jordan and Mark Michelson.


Changes
-------

Dealt with Mark's findings aside from the one about S_OR since that was copy pasta \
and I'm not really sure what the justification is.


Repository: Asterisk


Description
-------

Adds 'DialplanAddExtension' and 'DialplanRemoveExtension' manager commands that work \
in mostly the same way as their CLI command equivalents. The following header \
arguments are used for each:

Action: DialplanAddExtension
Context - which context should be used
Extension - name of the extension being created, if '/' is included, the portion \
after the '/' is a CID match for that extension. Priority - priority being added
Application - name of the application to be used at this priority
ApplicationData - not required (if not included results in no args), forms the \
arguments to the application Replace - not required (if not included, same as 'no'). \
If set to a truth value, replace existing extensions/priorities rather than failing \
if one exists where we are adding already.

Action: DialplanRemoveExtension
Context - which context is being removed from
Extension - Which extension is being removed or having a priority removed from, if \
'/' is included, the portion after the '/' is a CID match for that extension. \
Priority - not required, if included then just a single priority is removed from the \
extension instead of the whole extension.

A change to the pbx extension adding code was necessary in order for \
ast_add_extension to report an error when attempting to add an extension without \
replacing it when it already exists. The particular section in question previously \
had some developer comments questioning why the return values were what they were in \
the first place. I didn't observe any problematic behavior occuring as a result of \
the change, but it is in pbx.c, so I guess it could end up being a bit of a \
minefield.


Diffs (updated)
-----

  /trunk/pbx/pbx_config.c 416234 
  /trunk/main/pbx.c 416234 
  /trunk/CHANGES 416234 

Diff: https://reviewboard.asterisk.org/r/3650/diff/


Testing
-------

Tested add extension with/without appdata
Tested add extension with/without '/' in extension and made sure the rest of the \
field was used as a CID value and that it worked the same as the CLI command \
equivalent Tested remove extension with/without priority
Tested remove extension with/without '/' in extension and made sure that if CID was \
included that it deleted the CID including extension.


Thanks,

Jonathan Rose


[Attachment #5 (text/html)]

<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/3650/">https://reviewboard.asterisk.org/r/3650/</a>
  </td>
    </tr>
   </table>
   <br />




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

<div>Review request for Asterisk Developers, Matt Jordan and Mark Michelson.</div>
<div>By Jonathan Rose.</div>


<p style="color: grey;"><i>Updated June 27, 2014, 3 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</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;">Dealt with Mark&#39;s findings aside from the one about S_OR since that \
was copy pasta and I&#39;m not really sure what the justification is.</pre>  </td>
 </tr>
</table>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</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;">Adds &#39;DialplanAddExtension&#39; and \
&#39;DialplanRemoveExtension&#39; manager commands that work in mostly the same way \
as their CLI command equivalents. The following header arguments are used for each:

Action: DialplanAddExtension
Context - which context should be used
Extension - name of the extension being created, if &#39;/&#39; is included, the \
portion after the &#39;/&#39; is a CID match for that extension. Priority - priority \
being added Application - name of the application to be used at this priority
ApplicationData - not required (if not included results in no args), forms the \
arguments to the application Replace - not required (if not included, same as \
&#39;no&#39;). If set to a truth value, replace existing extensions/priorities rather \
than failing if one exists where we are adding already.

Action: DialplanRemoveExtension
Context - which context is being removed from
Extension - Which extension is being removed or having a priority removed from, if \
&#39;/&#39; is included, the portion after the &#39;/&#39; is a CID match for that \
extension. Priority - not required, if included then just a single priority is \
removed from the extension instead of the whole extension.

A change to the pbx extension adding code was necessary in order for \
ast_add_extension to report an error when attempting to add an extension without \
replacing it when it already exists. The particular section in question previously \
had some developer comments questioning why the return values were what they were in \
the first place. I didn&#39;t observe any problematic behavior occuring as a result \
of the change, but it is in pbx.c, so I guess it could end up being a bit of a \
minefield.</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;">Tested add extension with/without appdata Tested add extension \
with/without &#39;/&#39; in extension and made sure the rest of the field was used as \
a CID value and that it worked the same as the CLI command equivalent Tested remove \
extension with/without priority Tested remove extension with/without &#39;/&#39; in \
extension and made sure that if CID was included that it deleted the CID including \
extension.</pre>  </td>
 </tr>
</table>


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

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

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

 <li>/trunk/CHANGES <span style="color: grey">(416234)</span></li>

</ul>

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







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




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



-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic