<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/1894/">https://reviewboard.asterisk.org/r/1894/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On May 2nd, 2012, 3:18 a.m., <b>Alec Davis</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Referring to https://issues.asterisk.org/jira/browse/18028
Tested by dialling 10127 (thus 127 looped calls)
the exceptionally long queue, wasn't reported before or after applying this patch.
After patch successfully (very fast) optimizes out all required calls when using the dialplan.
Any more calls (ie 128) I did have hung channels, but was able to hang them up with 'channel request hangup'</pre>
</blockquote>
<p>On May 2nd, 2012, 1:04 p.m., <b>rmudgett</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">What stuck channels? If you are referring to the last local channel in the chain running the Echo application, that channel cannot be optimized out.
If you called another phone, all local channels can be optimized out.</pre>
</blockquote>
<p>On May 2nd, 2012, 4:54 p.m., <b>Alec Davis</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I'm running the same version as last night (when I managed to get stuck local channel twice), and after 20 attempts this morning I cannot repeat the stuck channels.
I understand about the last local chan not being able to be optimized out.
I had hungup, but luckily the history buffer allows me to see the command I used, 'channel request hangup Local/10000@phones-5e0c;1'
I'll look through debug log to see if I can find more.</pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The hung channels wern't realy hung at all, I'd hookflashed, not hungup, which ends up with 2 echo apps talking together :(
-- Executing [h@phones:1] NoOp("Local/10127@phones-c2f0;2", "") in new stack
== Spawn extension (phones, 10127, 2) exited non-zero on 'Local/10127@phones-c2f0;2'
-- Executing [s@echo-test:4] Echo("Local/10000@phones-4dc3;2", "") in new stack
-- Started three way call on channel 33 <<<<< Here's the issue, I finished up hook flashing, not hanging up.
-- Started music on hold, class 'default', on Local/10000@phones-4dc3;1
-- Starting simple switch on 'DAHDI/33-2'
-- Executing [10128@phones:1] Set("DAHDI/33-2", "i=10127") in new stack
-- Executing [10128@phones:2] Dial("DAHDI/33-2", "Local/10127@phones") in new stack
-- Called Local/10127@phones
== Spawn extension (phones, 10058, 2) exited non-zero on 'Local/10058@phones-4606;2'
-- Executing [h@phones:1] NoOp("Local/10059@phones-f677;2", "") in new stack
== Spawn extension (phones, 10059, 2) exited non-zero on 'Local/10059@phones-f677;2'
-- Executing [h@phones:1] NoOp("Local/10060@phones-eeeb;2", "") in new stack
-- Building conference call with DAHDI/33-1 and DAHDI/33-2
-- Stopped music on hold on Local/10000@phones-4dc3;1
== Spawn extension (phones, 10060, 2) exited non-zero on 'Local/10060@phones-eeeb;2'
-- Executing [h@phones:1] NoOp("Local/10061@phones-dbe3;2", "") in new stack
== Spawn extension (phones, 10061, 2) exited non-zero on 'Local/10061@phones-dbe3;2'
...
== Spawn extension (phones, 10127, 2) exited non-zero on 'Local/10127@phones-7d55;2'
-- Executing [s@echo-test:4] Echo("Local/10000@phones-9e2e;2", "") in new stack
-- TRANSFERRING DAHDI/33-2 to DAHDI/33-1
[2012-05-03 19:17:49.158442] WARNING[8429]: chan_dahdi.c:3722 _dahdi_get_index: Unable to get index for 'DAHDI/33-1' on channel 33 (dahdi_indicate(), line 9395)
-- Hanging up on 'Local/10000@phones-9e2e;1<MASQ>'
-- Hungup 'Local/10000@phones-9e2e;1<MASQ>'
-- Executing [h@phones:1] NoOp("DAHDI/33-2", "") in new stack
== Spawn extension (phones, 10128, 2) exited non-zero on 'DAHDI/33-2'
-- Hanging up on 'DAHDI/33-2'
-- Hungup 'DAHDI/33-2'
-- Starting simple switch on 'DAHDI/33-1'
asterix*CLI> core show channels
Channel Location State Application(Data)
Local/10000@phones-9 s@echo-test:4 Up Echo()
Local/10000@phones-9 10128@phones:2 Up Dial(Local/10127@phones)
Local/10000@phones-4 s@echo-test:4 Up Echo()
Local/10000@phones-4 (None) Up AppDial((Outgoing Line))
DAHDI/33-1 s@phones:1 Rsrvd (None)
asterix*CLI> channel request hangup
Local/10000@phones-4dc3;2 Local/10000@phones-9e2e;1 Local/10000@phones-9e2e;2 Local/10000@phones-4dc3;1
</pre>
<br />
<p>- Alec</p>
<br />
<p>On May 2nd, 2012, 12:22 p.m., rmudgett 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 rmudgett.</div>
<p style="color: grey;"><i>Updated May 2, 2012, 12:22 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;">The masquerade torture test (ASTERISK-19807) is a long chain of local channels to be optimized out of a call when answered.
This patch fixes local channel so it can successfully optimize itself out when there are chains of channels.
The principle problem was check_bridge() failed to check the ast_channel_masquerade() return value to see if the masquerade was actually setup. In long chains of local channels, the masquerade occasionally fails to get setup because there is another masquerade already setup on an adjacent local channel in the chain.
* Checks the return value of ast_channel_masquerade().
* Made sure that the outgoing local channel (the ;2 channel) also does not have any frames in its queue before the masquerade.
* The outgoing channel will flush one voice or video frame per optimization attempt.
* Do the masquerade immediately to ensure that the outgoing channel queue does not get any new frames added and thus unconditionally flushed.
* Blocks indication -1 (Stop tones event) when the local channel is going to optimize itself out. When the call is answered, a chain of local channels pass down a -1 indication for each bridge. This blizzard of -1 events really slows down the optimization process.</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;">Chains of 100 local channels now are able to optimize themselves out.</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://issues.asterisk.org/jira/browse/ASTERISK-16711">ASTERISK-16711</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/branches/1.8/channels/chan_local.c <span style="color: grey">(364846)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/1894/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>