[asterisk-dev] [Code Review]: Add xmldoc for config options, along with some CLI commands for viewing config option-related stuff - take 2

Matt Jordan reviewboard at asterisk.org
Thu Jan 24 09:27:57 CST 2013



> On Jan. 24, 2013, 2:29 a.m., wdoekes wrote:
> > > You should change the %20.20s to just %20s so you don't truncate any long names.
> > 
> > I thought we we're moving to left-aligned output. See the new 'core show help' (help1 in main/cli.c). IMHO right aligned output is only "pretty" but hardly ever practical.
> > 
> > "%-20s" sounds sane to me, and wouldn't necessarily benefit much from the extra lookup loop.

Hm... we did change that, didn't we. Fair enough.

I went with a slightly longer column length (25), since there are a number of configuration files that are at least that long. Using ConfBridge as an example, this produces:

*CLI> config show help app_confbridge user_profile
user_profile: [category !~ /^general$/ matchfield: type = user]

A named profile to apply to specific callers.

Callers in a ConfBridge have a profile associated with them that determine
their options. A configuration section is determined to be a user_profile
when the 'type' parameter has a value of 'user'. 

type                      -- Define this configuration category as a user profile.            
admin                     -- Sets if the user is an admin or not                              
marked                    -- Sets if this is a marked user or not                             
startmuted                -- Sets if all users should start out muted                         
music_on_hold_when_empty  -- Play MOH when user is alone or waiting on a marked user          
quiet                     -- Silence enter/leave prompts and user intros for this user        
announce_user_count       -- Sets if the number of users should be announced to the user      
announce_user_count_all   -- Announce user count to all the other users when this user joins  
announce_only_user        -- Announce to a user when they join an empty conference            
wait_marked               -- Sets if the user must wait for a marked user to enter before join
end_marked                -- Kick the user from the conference when the last marked user leave
talk_detection_events     -- Set whether or not notifications of when a user begins and ends t
dtmf_passthrough          -- Sets whether or not DTMF should pass through the conference      
announce_join_leave       -- Prompt user for their name when joining a conference and play it 
pin                       -- Sets a PIN the user must enter before joining the conference     
music_on_hold_class       -- The MOH class to use for this user                               
announcement              -- Sound file to play to the user when they join a conference       
denoise                   -- Apply a denoise filter to the audio before mixing                
dsp_drop_silence          -- Drop what Asterisk detects as silence from audio sent to the brid
dsp_silence_threshold     -- The number of milliseconds of detected silence necessary to trigg
dsp_talking_threshold     -- The number of milliseconds of detected non-silence necessary to t
jitterbuffer              -- Place a jitter buffer on the user's audio stream before audio mix
template                  -- When using the CONFBRIDGE dialplan function, use a user profile a


*CLI> config show help app_confbridge
Conference Bridge Application

Configuration option types for app_confbridge:
global                    -- Unused, but reserved.                                            
user_profile              -- A named profile to apply to specific callers.                    
bridge_profile            -- A named profile to apply to specific bridges.                    
menu                      -- A conference user menu  


- Matt


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


On Jan. 23, 2013, 9:49 p.m., Matt Jordan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2278/
> -----------------------------------------------------------
> 
> (Updated Jan. 23, 2013, 9:49 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This is a continuation of Terry's work at https://reviewboard.asterisk.org/r/2058/.  It is pretty much the same, but with some additional cleanup that Terry noted on the review.
> 
> * The CLI commands have been collapsed down to a single command - 'config show help'. This models itself off of the way (I think) users view configuration data - as a hierarchy of modules, types (the semantic meaning of the different context possibilities in a conf file), and the options for those types.
> * Some things move around to better separate concerns between xmldoc and config_options
> * Added default values and tied the type information to the config options
> * Lots and lots of documentation cleanup
> 
> I have a feeling we'll find more things to tweak in this - both in terms of documentation and the things we'd like to show in the output of the CLI command. Given that this won't go into 11, we have some time for 12 to review the output of this and tweak it.
> 
> I'm planning on writing the XSLT for the schema and push the documentation to a 'test area' on the wiki. That should help find other problems in the current documentation.
> 
> 
> Diffs
> -----
> 
>   /trunk/Makefile 380027 
>   /trunk/apps/app_skel.c 380027 
>   /trunk/apps/confbridge/conf_config_parser.c 380027 
>   /trunk/channels/chan_motif.c 380027 
>   /trunk/configs/motif.conf.sample 380027 
>   /trunk/configs/xmpp.conf.sample 380027 
>   /trunk/doc/appdocsxml.dtd 380027 
>   /trunk/include/asterisk/_private.h 380027 
>   /trunk/include/asterisk/config_options.h 380027 
>   /trunk/include/asterisk/xml.h 380027 
>   /trunk/include/asterisk/xmldoc.h 380027 
>   /trunk/main/asterisk.c 380027 
>   /trunk/main/config_options.c 380027 
>   /trunk/main/named_acl.c 380027 
>   /trunk/main/udptl.c 380027 
>   /trunk/main/xml.c 380027 
>   /trunk/main/xmldoc.c 380027 
>   /trunk/res/res_xmpp.c 380027 
> 
> Diff: https://reviewboard.asterisk.org/r/2278/diff
> 
> 
> Testing
> -------
> 
> Lots of typing 'config show help'. Some sample outputs:
> 
> *CLI> config show help
> The following modules have configuration information:
> 	udptl
> 	chan_motif
> 	app_confbridge
> 	res_xmpp
> 	app_skel
> 	named_acl
> 
> 
> *CLI> config show help app_confbridge 
> Conference Bridge Application
> 
> Configuration option types for app_confbridge:
>               global: Unused, but reserved.                                           
>         user_profile: A named profile to apply to specific callers.                   
>       bridge_profile: A named profile to apply to specific bridges.                   
>                 menu: A conference user menu    
> 
> 
> *CLI> config show help app_confbridge user_profile
> user_profile: [category !~ /^general$/ matchfield: type = user]
> 
> A named profile to apply to specific callers.
> 
> Callers in a ConfBridge have a profile associated with them that determine
> their options. A configuration section is determined to be a user_profile
> when the 'type' parameter has a value of 'user'. 
> 
>                 type: Define this configuration category as a user profile.                         
>                admin: Sets if the user is an admin or not                                           
>               marked: Sets if this is a marked user or not                                          
>           startmuted: Sets if all users should start out muted                                      
> music_on_hold_when_e: Play MOH when user is alone or waiting on a marked user                       
>                quiet: Silence enter/leave prompts and user intros for this user                     
>  announce_user_count: Sets if the number of users should be announced to the user                   
> announce_user_count_: Announce user count to all the other users when this user joins               
>   announce_only_user: Announce to a user when they join an empty conference                         
>          wait_marked: Sets if the user must wait for a marked user to enter before joining a confere
>           end_marked: Kick the user from the conference when the last marked user leaves            
> talk_detection_event: Set whether or not notifications of when a user begins and ends talking should
>     dtmf_passthrough: Sets whether or not DTMF should pass through the conference                   
>  announce_join_leave: Prompt user for their name when joining a conference and play it to the confer
>                  pin: Sets a PIN the user must enter before joining the conference                  
>  music_on_hold_class: The MOH class to use for this user                                            
>         announcement: Sound file to play to the user when they join a conference                    
>              denoise: Apply a denoise filter to the audio before mixing                             
>     dsp_drop_silence: Drop what Asterisk detects as silence from audio sent to the bridge           
> dsp_silence_threshol: The number ofmilliseconds of detected silence necessary to trigger silence det
> dsp_talking_threshol: The number of milliseconds of detected non-silence necessary to triger talk de
>         jitterbuffer: Place a jitter buffer on the user's audio stream before audio mixing is perfor
>             template: When using the CONFBRIDGE dialplan function, use a user profile as a template
> 
> 
> *CLI> config show help app_confbridge user_profile dsp_silence_threshold 
> [user_profile]
> dsp_silence_threshold = [Unsigned Integer] (Default: 2500) (Regex: false)
> 
> The number of milliseconds of detected silence necessary to trigger silence
> detection
> 
>  The time in milliseconds of sound falling within the what the dsp has
> established as baseline silence before a user is considered be silent.  This
> value affects several operations and should not be changed unless the impact
> on call quality is fully understood.
> What this value affects internally:
>  1. When talk detection AMI events are enabled, this value determines when
>  the user has stopped talking after a period of talking.  If this value is
>  set too low AMI events indicating the user has stopped talking may get falsely
>  sent out when the user briefly pauses during mid sentence. 
>  2. The drop_silence option depends on this value to determine when the
>  user's audio should begin to be dropped from the conference bridge after
>  the user stops talking.  If this value is set too low the user's audio stream
>  may sound choppy to the other participants. This is caused by the user
>  transitioning constantly from silence to talking during mid sentence. 
>  The best way to approach this option is to set it slightly above the maximum
>  amount of ms of silence a user may generate during natural speech. 
> By default this value is 2500ms. Valid values are 1 through 2^31.
> 
> 
> Thanks,
> 
> Matt
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130124/5116e93f/attachment-0001.htm>


More information about the asterisk-dev mailing list