<p style="white-space: pre-wrap; word-wrap: break-word;">After reviewing the existing code and running some tests, I've determined the following...<br>If you construct your MessageSend like<br>MessageSend(pjsip:sip:myproviderendpoint/sip:7205551212@somedomain.com,7205559999@mypbx1.net)<br>The message WILL be sent with both a RequestURI and a To header of sip:7205551212@somedomain.com.<br>Having said that, the way the code is written, 'somedomain.com' is also used as the destination contact instead of the contact associated with the endpoint/aor so the actual MESSAGE message is actually sent to 'somedomain.com'.  Personally, I think that's weird but if that works for you, you don't need this review.  If that doesn't work for you, then I'd consider making get_outbound_endpoint() and msg_send() do the "right" thing.  I.E. use the URI to set the To header but DON'T use that URI as the destination contact.</p><p>Patch set 3:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15597">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15597">change 15597</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/c/asterisk/+/15597"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I26fb8605d7cb200332a0442879fd9a5679a65022 </div>
<div style="display:none"> Gerrit-Change-Number: 15597 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Brian J. Murrell <brian@interlinx.bc.ca> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 25 Mar 2021 14:48:06 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>