<p>Brian J. Murrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13064">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_messaging: Rewrite To: to normalize recipient<br><br>The To: header should be consistent on outgoing messages and represent<br>the "logical" receipent, which is the user@the_asterisk.system.<br><br>ASTERISK-28513 #close<br><br>Change-Id: Iab8d472081d22ed80a3abf3b34833d898306ac8e<br>---<br>M res/res_pjsip_messaging.c<br>1 file changed, 10 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/64/13064/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 76d37f2..7463a73 100644</span><br><span>--- a/res/res_pjsip_messaging.c</span><br><span>+++ b/res/res_pjsip_messaging.c</span><br><span>@@ -43,6 +43,7 @@</span><br><span> #include "asterisk/res_pjsip.h"</span><br><span> #include "asterisk/res_pjsip_session.h"</span><br><span> #include "asterisk/taskprocessor.h"</span><br><span style="color: hsl(120, 100%, 40%);">+#include "asterisk/paths.h"</span><br><span> </span><br><span> const pjsip_method pjsip_message_method = {PJSIP_OTHER_METHOD, {"MESSAGE", 7} };</span><br><span> </span><br><span>@@ -230,10 +231,16 @@</span><br><span> parsed_name_addr = (pjsip_name_addr *) pjsip_parse_uri(tdata->pool, to, strlen(to),</span><br><span> PJSIP_PARSE_URI_AS_NAMEADDR);</span><br><span> if (parsed_name_addr) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (pj_strlen(&parsed_name_addr->display)) {</span><br><span style="color: hsl(0, 100%, 40%);">- pjsip_name_addr *name_addr =</span><br><span style="color: hsl(0, 100%, 40%);">- (pjsip_name_addr *) PJSIP_MSG_TO_HDR(tdata->msg)->uri;</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%);">+ if (!ast_strlen_zero(ast_config_AST_SYSTEM_NAME)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ pj_strdup2(tdata->pool, &uri->host, ast_config_AST_SYSTEM_NAME);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else </span><br><span style="color: hsl(120, 100%, 40%);">+ ast_log(LOG_WARNING, "Unable to rewrite MESSAGE to systemname because systemname (%s) is empty\n", ast_config_AST_SYSTEM_NAME);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if (pj_strlen(&parsed_name_addr->display)) {</span><br><span> pj_strdup(tdata->pool, &name_addr->display, &parsed_name_addr->display);</span><br><span> }</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13064">change 13064</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/+/13064"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13.29 </div>
<div style="display:none"> Gerrit-Change-Id: Iab8d472081d22ed80a3abf3b34833d898306ac8e </div>
<div style="display:none"> Gerrit-Change-Number: 13064 </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>