[asterisk-dev] [Code Review] 4597: res_pjsip: add CLI commands for global and system configuration

Kevin Harwell reviewboard at asterisk.org
Tue Apr 7 17:34:08 CDT 2015



> On April 7, 2015, 1:04 p.m., Mark Michelson wrote:
> > branches/13/res/res_pjsip/config_system.c, lines 149-155
> > <https://reviewboard.asterisk.org/r/4597/diff/2/?file=73683#file73683line149>
> >
> >     This should be impossible to happen since default system configuration should automatically get set on start-up if no system section was present in pjsip.conf. If default system configuration setup on startup fails, then res_pjsip.so should fail to load.
> >     
> >     I think an assertion here that cfg is non-NULL would do the trick instead of trying again to create default configuration settings

If the system settings are not specified in the config file no default object exist, but has to be created from the specified system defaults. Each time sorcery allocs an object it creates it and sets its fields to the default values. At initialization when no system settings exist an object is created with defaults and then applied, but then gets deleted. So in order to access the default object again it needs to be re-created.

An alternative would be to keep a global defaults object around, but I don't see a reason to maintain that pointer just for CLI use.


- Kevin


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


On April 7, 2015, 11:05 a.m., Kevin Harwell wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4597/
> -----------------------------------------------------------
> 
> (Updated April 7, 2015, 11:05 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-24918
>     https://issues.asterisk.org/jira/browse/ASTERISK-24918
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Added two new CLI commands for res_pjsip global and system configuration settings:
> 
> pjsip show global
> pjsip show system
> 
> 
> Diffs
> -----
> 
>   branches/13/res/res_pjsip/config_system.c 434150 
>   branches/13/res/res_pjsip/config_global.c 434150 
>   branches/13/CHANGES 434150 
> 
> Diff: https://reviewboard.asterisk.org/r/4597/diff/
> 
> 
> Testing
> -------
> 
> Ran the commands and checked output. Changed some options and reloaded and made sure global settings changed, but system ones did not. Changed some settings again and restarted and made sure both global and system changes too effect. Also removed the sections completely from the pjsip.conf file and made sure the defaults were shown.
> 
> 
> Thanks,
> 
> Kevin Harwell
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150407/ce0b7a13/attachment-0001.html>


More information about the asterisk-dev mailing list