<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">One more small issue...</p><p style="white-space: pre-wrap; word-wrap: break-word;">The interception routine is called twice on initial request if the<br>Dial() is with only one destination.</p><p style="white-space: pre-wrap; word-wrap: break-word;">This is because wait_for_answer() in the beginning<br>if (single) calls<br>update_connected_line_from_peer(in, outgoing->chan, 1);<br>then second time on AST_CONTROL_CONNECTED_LINE</p><p style="white-space: pre-wrap; word-wrap: break-word;">I think the 1st update should be eliminated.<br>What do you think?</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">The first is for the Dial's configured caller-id or best guess taken from the called channel.  There is a lot of ancient history involved with why Dial does things (and some things that don't exactly make sense).  Messing with the that behavior in a released branch is likely to break something.  The second is from something further down the called channel's chain before the called channel is answered.  Neither can be eliminated.  Not all channel drivers generate connected line updates when their channels get answered.</p><p style="white-space: pre-wrap; word-wrap: break-word;">You should know by now that connected line updates get triggered for various reasons and suppressing them is usually a bad idea.  There is code to suppress redundant connected line updates in the core. See channel.c:indicate_connected_line().  The suppression can only happen after the interception routines have had their say.</p><p><a href="https://gerrit.asterisk.org/10286">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10286">change 10286</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10286"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I6ce9e151a2220ce9e95aa66666933cfb9e2a4a01 </div>
<div style="display:none"> Gerrit-Change-Number: 10286 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Alexei Gradinari <alex2grad@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Alexei Gradinari <alex2grad@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 16 Oct 2018 00:21:15 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-HasLabels: No </div>