<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Modifying ast_party_id_set() will really break things.  You will<br>be<br>better served<br>by looking at party_id_build_data() instead.  Make that function<br>always add<br>the tag ie with an empty string if the tag string is NULL.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I think modifying party_id_build_data() it's the same as modifying<br>ast_party_id_set().</p><p style="white-space: pre-wrap; word-wrap: break-word;">May be better to set caller_id_tag to empty string only for<br>res_pjsip.<br>For example inside sip_endpoint_apply_handler() could be added<br>if (!endpoint->id.self.tag) {<br>endpoint->id.self.tag=ast_strdup("");<br>}</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">That makes a lot of sense.</p><p style="white-space: pre-wrap; word-wrap: break-word;">ast_sip_endpoint_alloc() needs to set the tag to an empty ast_strdup() string after calling ast_party_id_init().<br>caller_id_tag_handler() needs to free the previous tag or we leak memory.  (This would be true if there were more than one callerid_tag in the pjsip.conf endpoint definition anyway.)</p><p style="white-space: pre-wrap; word-wrap: break-word;">Oh gosh: caller_id_handler() needs to free the name.str, and number.str before assigning the new ast_strdup() or we leak memory if there is more than one callerid option in the pjsip.conf endpoint definition.</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: Wed, 10 Oct 2018 22:36:32 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-HasLabels: No </div>