> On March 10, 2015, 8:25 a.m., Joshua Colp wrote:
> > /branches/13/res/res_pjsip/config_global.c, line 229
> > <https://reviewboard.asterisk.org/r/4467/diff/1/?file=71922#file71922line229>
> >
> >     Why the change of this from a define to not a device?

The define did not help readability, required you to look elsewhere to figure 
out the generated string, and due to the generated string's nature could only 
be used once.


- rmudgett


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4467/#review14621
-----------------------------------------------------------


On March 9, 2015, 2:43 p.m., rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4467/
> -----------------------------------------------------------
> 
> (Updated March 9, 2015, 2:43 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-24807
>     https://issues.asterisk.org/jira/browse/ASTERISK-24807
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> When a type=global section is not defined in pjsip.conf the global
> defaults are not applied.  As a result the mandatory Max-Forwards header
> is not added to SIP messages for res_pjsip/chan_pjsip.
> 
> The handling of pjsip.conf type=global objects has several problems:
> 
> 1) If the global object is missing the defaults are not applied.
> 
> 2) If the global object is missing the default_outbound_endpoint's default
> value is not returned by ast_sip_global_default_outbound_endpoint().
> 
> 3) Defines are needed so default values only need to be changed in one
> place.
> 
> * Added a sorcery instance observer callback to check if there were any
> type=global sections loaded.  If there were more than one then issue an
> error message.  If there were none then apply the global defaults.
> 
> * Fixed ast_sip_global_default_outbound_endpoint() to return the
> documented default when no type=global object is defined.
> 
> * Made defines for the global default values.
> 
> * Increased the default_useragent[] size because SVN version strings can
> get lengthy and 128 characters may not be enough.
> 
> * Fixed an off-nominal code path ref leak in global_alloc() if the string
> fields fail to initialize.
> 
> * Eliminated RAII_VAR in get_global_cfg() and
> ast_sip_global_default_outbound_endpoint().
> 
> 
> The changes to res/res_pjsip/pjsip_global_headers.c are for the
> independent but related global options issue.  These changes will be
> committed separately.
> 
> res_pjsip: Fixed invalid empty Server and User-Agent SIP headers.
> 
> Setting pjsip.conf useragent to an empty string results in an empty SIP
> header being sent.
> 
> * Made not add an empty SIP header item to the global SIP headers list.
> 
> 
> Diffs
> -----
> 
>   /branches/13/res/res_pjsip/pjsip_global_headers.c 432661 
>   /branches/13/res/res_pjsip/pjsip_configuration.c 432661 
>   /branches/13/res/res_pjsip/config_global.c 432661 
>   /branches/13/include/asterisk/res_pjsip.h 432661 
> 
> Diff: https://reviewboard.asterisk.org/r/4467/diff/
> 
> 
> Testing
> -------
> 
> Ran through the following pjsip.conf type=global permutations:
> 
> 1) No global object defined.  The defaults are applied with the patch and the 
> Max-Forwards header goes out when it did not before.
> 2) Two global objects defined.  An error message is now output complaining of 
> the multiple global objects.
> 3) One global object defined with custom user_agent value set.  The 
> User-Agent and Server headers have the custom value.
> 4) One global object defined with user_agent value set to an empty string.  
> The User-Agent and Server headers do not go out when they would go out 
> without a value before.
> 
> 
> Thanks,
> 
> rmudgett
> 
>

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to