<p>Brian J. Murrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15597">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_messaging: Allow setting domain of recipient<br><br>Allow the recipient field of MessageSend() to contain a domain which<br>is used in the SIP To: when sending the message to the endpoint. This<br>allows endpoints that use both the LHS *and* RHS of the recipient<br>address to identify remote senders to maintain consistency even when<br>that endpoint changes it's location (i.e. IP address).<br><br>This is a slight rework of a modification to my to my original patch<br>for this issue that was contributed to my open issue on this matter in<br>https://issues.asterisk.org/jira/browse/ASTERISK-28513.<br><br>ASTERISK-28513<br><br>Change-Id: I26fb8605d7cb200332a0442879fd9a5679a65022<br>---<br>M res/res_pjsip_messaging.c<br>1 file changed, 9 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/97/15597/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_messaging.c b/res/res_pjsip_messaging.c</span><br><span>index 5378b8c..9cfc470 100644</span><br><span>--- a/res/res_pjsip_messaging.c</span><br><span>+++ b/res/res_pjsip_messaging.c</span><br><span>@@ -238,6 +238,15 @@</span><br><span> pj_strdup(tdata->pool, &name_addr->display, &parsed_name_addr->display);</span><br><span> }</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+ /* assume it is 'sip:user[@domain]' format */</span><br><span style="color: hsl(120, 100%, 40%);">+ char *domain = strchr(to, '@');</span><br><span style="color: hsl(120, 100%, 40%);">+ if (domain) {</span><br><span style="color: hsl(120, 100%, 40%);">+ pjsip_sip_uri *uri;</span><br><span style="color: hsl(120, 100%, 40%);">+ pjsip_name_addr *name_addr =</span><br><span style="color: hsl(120, 100%, 40%);">+ (pjsip_name_addr *) PJSIP_MSG_TO_HDR(tdata->msg)->uri;</span><br><span style="color: hsl(120, 100%, 40%);">+ uri = pjsip_uri_get_uri(name_addr);</span><br><span style="color: hsl(120, 100%, 40%);">+ pj_strdup2(tdata->pool, &uri->host, domain + 1);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> </span><br><span> /*!</span><br><span></span><br></pre><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: 1 </div>
<div style="display:none"> Gerrit-Owner: Brian J. Murrell <brian@interlinx.bc.ca> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>