<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10476">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
George Joseph: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip: set callerid_tag to empty string<br><br>This patch sets the callerid_tag to empty string by default.<br><br>If the callerid_tag is set to NULL then the tag does not<br>become part of a connected line update.<br>For example:<br>Alice's tag is "Alice".<br>Bob's tag is empty.<br>Charlie's tag is "Charlie".<br>Alice calls Bob and then does attended transfer to Charlie.<br>When Alice hangs up the CONNECTEDLINE(tag) is "Alice"<br>on the interception routine on the Charlie's channel, but should be empty.<br><br>Ths patch also fix memory leaks if there are more then one options<br>"callerid", "callerid_tag", "voicemail_extension" and "contact_user"<br>in the pjsip.conf endpoint definition.<br><br>Change-Id: I86ba455c4677ca8d516d9a04ce7fb4d24dd576e4<br>---<br>M res/res_pjsip/pjsip_configuration.c<br>1 file changed, 15 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c</span><br><span>index b0eb2d4..477b317 100644</span><br><span>--- a/res/res_pjsip/pjsip_configuration.c</span><br><span>+++ b/res/res_pjsip/pjsip_configuration.c</span><br><span>@@ -590,6 +590,13 @@</span><br><span> char cid_name[80] = { '\0' };</span><br><span> char cid_num[80] = { '\0' };</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(endpoint->id.self.name.str);</span><br><span style="color: hsl(120, 100%, 40%);">+ endpoint->id.self.name.str = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ endpoint->id.self.name.valid = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(endpoint->id.self.number.str);</span><br><span style="color: hsl(120, 100%, 40%);">+ endpoint->id.self.number.str = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ endpoint->id.self.number.valid = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> ast_callerid_split(var->value, cid_name, sizeof(cid_name), cid_num, sizeof(cid_num));</span><br><span> if (!ast_strlen_zero(cid_name)) {</span><br><span> endpoint->id.self.name.str = ast_strdup(cid_name);</span><br><span>@@ -656,7 +663,10 @@</span><br><span> static int caller_id_tag_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)</span><br><span> {</span><br><span> struct ast_sip_endpoint *endpoint = obj;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(endpoint->id.self.tag);</span><br><span> endpoint->id.self.tag = ast_strdup(var->value);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> return endpoint->id.self.tag ? 0 : -1;</span><br><span> }</span><br><span> </span><br><span>@@ -1059,6 +1069,7 @@</span><br><span> {</span><br><span> struct ast_sip_endpoint *endpoint = obj;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(endpoint->subscription.mwi.voicemail_extension);</span><br><span> endpoint->subscription.mwi.voicemail_extension = ast_strdup(var->value);</span><br><span> </span><br><span> return endpoint->subscription.mwi.voicemail_extension ? 0 : -1;</span><br><span>@@ -1078,12 +1089,10 @@</span><br><span> {</span><br><span> struct ast_sip_endpoint *endpoint = obj;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(endpoint->contact_user);</span><br><span> endpoint->contact_user = ast_strdup(var->value);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!endpoint->contact_user) {</span><br><span style="color: hsl(0, 100%, 40%);">- return -1;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ return endpoint->contact_user ? 0 : -1;</span><br><span> }</span><br><span> </span><br><span> static int contact_user_to_str(const void *obj, const intptr_t *args, char **buf)</span><br><span>@@ -2028,7 +2037,9 @@</span><br><span> ao2_cleanup(endpoint);</span><br><span> return NULL;</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> ast_party_id_init(&endpoint->id.self);</span><br><span style="color: hsl(120, 100%, 40%);">+ endpoint->id.self.tag = ast_strdup("");</span><br><span> </span><br><span> if (AST_VECTOR_INIT(&endpoint->ident_method_order, 1)) {</span><br><span> return NULL;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10476">change 10476</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/10476"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: I86ba455c4677ca8d516d9a04ce7fb4d24dd576e4 </div>
<div style="display:none"> Gerrit-Change-Number: 10476 </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: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>