[Asterisk-code-review] app dial/queue/followme: 'I' options to block initial update... (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Thu Oct 11 17:13:17 CDT 2018


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/10286 )

Change subject: app_dial/queue/followme: 'I' options to block initial updates in both directions
......................................................................


Patch Set 3:

> > > May be better to set caller_id_tag to empty string only for
 > > > res_pjsip.
 > > > For example inside sip_endpoint_apply_handler() could be added
 > > > if (!endpoint->id.self.tag) {
 > > > endpoint->id.self.tag=ast_strdup("");
 > > > }
 > >
 > > That makes a lot of sense.
 > >
 > > ast_sip_endpoint_alloc() needs to set the tag to an empty
 > > ast_strdup() string after calling ast_party_id_init().
 > > 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.)
 > 
 > What's the reason to assign empty value before config processing?
 > If the tag has value then will be ast_strdup()/ast_free()/ast_strdup().
 > If assign empty value after config processing at sip_endpoint_apply_handler()
 > then will be only one ast_strdup() in any cases.

It needs to be set in ast_sip_endpoint_alloc() to ensure that someone
calling ast_sorcery_alloc() will have an empty tag string set.  ast_sorcery_alloc()
creates the specified sorcery object and applies the default values to it.
Defaults do not normally apply empty strings to objects (see aco_set_defaults())
so they would be a NULL pointer or whatever the object's alloc function
(ast_sip_endpoint_alloc()) set it to.


-- 
To view, visit https://gerrit.asterisk.org/10286
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I6ce9e151a2220ce9e95aa66666933cfb9e2a4a01
Gerrit-Change-Number: 10286
Gerrit-PatchSet: 3
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Thu, 11 Oct 2018 22:13:17 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181011/ffc09705/attachment.html>


More information about the asterisk-code-review mailing list