<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">This is a sledgehammer approach that just seems wrong.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">app_dial.c<br>The function dial_exec_full while loop through the list of dial destinations and set CONNECTED LINE ID on outgoing channel<br>if OPT_FORCECLID ast_channel_set_connected_line with forced_clid<br>else ast_connected_line_copy_from_caller</p><p style="white-space: pre-wrap; word-wrap: break-word;">The function wait_for_answer calls ast_read on originating channel<br>and to process AST_CONTROL_CONNECTED_LINE calls <br>ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);<br>on outgoing channel.<br>If this is pending AST_CONTROL_CONNECTED_LINE updates it could happen before PJSIP forms INVITE message.<br>So CONNECTED LINE ID replaced by this frame data on outgoing channel.</p><p style="white-space: pre-wrap; word-wrap: break-word;">The pending AST_CONTROL_CONNECTED_LINE update appears at early stage on Local channel ';2' for attandend transfer.<br>core_unreal.c<br>The function unreal_colp_redirect_indicate on AST_CONTROL_CONNECTED_LINE<br>calls ast_connected_line_copy_to_caller where dst='Local/****;2' and src 'Local/****;1'<br>and then build and queue frame AST_CONTROL_CONNECTED_LINE to 'Local/****;2'</p><p><a href="https://gerrit.asterisk.org/9558">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.asterisk.org/9558">change 9558</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/9558"/><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: I346652661949b6611c23e431ede0dbea1be3017a </div>
<div style="display:none"> Gerrit-Change-Number: 9558 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </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 </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 20 Jul 2018 21:26:15 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-HasLabels: No </div>