<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/1871/">https://reviewboard.asterisk.org/r/1871/</a>
</td>
</tr>
</table>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/1871/diff/2/?file=27442#file27442line8521" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/main/features.c</a>
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">static int feature_write(struct ast_channel *chan, const char *cmd, char *data,</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">8520</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="k">if</span> <span class="p">(</span><span class="n">sscanf</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="s">"%d"</span><span class="p">,</span> <span class="o">&</span><span class="n">feature_ds</span><span class="o">-></span><span class="n">parkingtime</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">8521</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                        <span class="n">feature_ds</span><span class="o">-></span><span class="n">parkingtime</span> <span class="o">*=</span> <span class="mi">1000</span><span class="p">;</span> <span class="cm">/* stored in ms */</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">8522</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">what if a negative number was entered.
should be using '%30u' instead of '%d'</pre>
</div>
<br />
<p>- Alec</p>
<br />
<p>On April 24th, 2012, 6:59 p.m., Russell Bryant wrote:</p>
<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 Russell Bryant.</div>
<p style="color: grey;"><i>Updated April 24, 2012, 6:59 p.m.</i></p>
<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;">This patch adds two new dialplan functions: FEATURE() and FEATUREMAP().
FEATURE() is indended to be used to allow customizing general feature
settings on a per-channel basis. It currently allows you to set a
custom parkingtime for a channel.
FEATUREMAP() is similar, but allows customizing the built-in feature
mappings on a per-channel basis. Currently you can customize the digit
string for activating blind or attended transfers.
More options and feature mappings could be added to this over time as
desired.
</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;">Using the following dialplan:
1) Dial 101, make sure normal transfers work (I tested transferring to 100).
2) Dial 102, make sure transfers using channel specific feature mappings work.
3) Dial 101, transfer to parking and observe normal parkingtime.
4) Dial 103, transfer to parking and verify that the custom parkingtime is used.
[featuretest]
include => parkedcalls
; Dummy extension for a Local channel. We'll call this and transfer it.
exten => foo,1,Answer()
same => n(wait),Wait(300)
same => n,Goto(wait)
; Transfer target.
exten => 100,1,Answer()
same => n(wait),Wait(300)
same => n,Goto(wait)
; Call this and make sure blindxfer and atxfer still work using default mappings.
exten => 101,1,Answer()
same => n,Verbose(0,Regular transfer test.)
same => n,Verbose(0,Blind Transfer: ${FEATUREMAP(blindxfer)})
same => n,Verbose(0,Attended Transfer: ${FEATUREMAP(atxfer)})
same => n,Dial(Local/foo@featuretest,,tT)
; Call this and make sure blindxfer and atxfer work with custom mappings.
exten => 102,1,Answer()
same => n,Verbose(0,Custom transfer test.)
same => n,Verbose(0,Setting blindxfer to '77' and atxfer to '88')
same => n,Set(FEATUREMAP(blindxfer)=77)
same => n,Set(FEATUREMAP(atxfer)=88)
same => n,Verbose(0,Blind Transfer: ${FEATUREMAP(blindxfer)})
same => n,Verbose(0,Attended Transfer: ${FEATUREMAP(atxfer)})
same => n,Dial(Local/foo@featuretest,,tT)
; Test setting a parkingtime. Start with calling '101' and then parking.
; Then, call this and verify that the new parkingtime is used.
exten => 103,1,Answer()
same => n,Verbose(0,Test custom parkingtime.)
same => n,Verbose(0,Blind Transfer: ${FEATUREMAP(blindxfer)})
same => n,Dial(Local/foo@featuretest,,tTU(setparkingtime^3))
; GoSub routine for setting parkingtime on a dialed channel.
[setparkingtime]
exten => s,1,Verbose(0,Setting custom parkingtime to '${ARG1}')
same => n,Verbose(0,Old value: ${FEATURE(parkingtime)})
same => n,Set(FEATURE(parkingtime)=${ARG1})
same => n,Verbose(0,New value: ${FEATURE(parkingtime)})
same => n,Return()
</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/main/features.c <span style="color: grey">(363374)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/1871/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>