[asterisk-dev] Deprecate every '* reload' CLI command?

Steve Edwards asterisk.org at sedwards.com
Wed Nov 28 09:59:14 CST 2007


On Tue, 27 Nov 2007, Tzafrir Cohen wrote:

> How would I know that "sip" is reloaded by reloading chan_sip.so, 
> "voicemail" is loaded by reloading app_voicemail.so and "moh" is 
> reloaded by reloading res_musiconhold.so ?

On Tue, 27 Nov 2007, Johansson Olle E wrote:

> There's also a usability issue here. I don't think we should force all 
> Asterisk admins to learn the names of the modules and learn which 
> modules actually make sense to reload. It's complicated enough.
>
> Asterisk is gaining new grounds and we reach users that doesn't know 
> internal linux architectures, dynamic module loading, or basic linux 
> commands...

First, the command syntax should be "verb noun," not "noun verb." Look at 
the command syntax for MySQL, GDB, Oracle, etc.

If an admin wants to reload something, the first word of the command 
should be "reload." If they are not sure (or lazy) they can press <TAB> 
and be presented with a list of possible completions.

The "reload" command either reloads (unload followed by load) the binary 
object module (the ".so") or it re-reads the configuration file for the 
module.

So let's start with:

 	reload
 		application
 		configuration
 		function
 		module
 				application-name
 				configuration-file-name
 				function-name
 				module-file-name
 				module-name

Here's a few examples:

 	reload configuration sip
 	reload configuration sip.conf
 	reload module chan_sip.so
 	reload module sip

 	reload application voicemail
 	reload application voicemailmain
 	reload application app_voicemail.so
 	reload configuration voicemail
 	reload configuration voicemailmain
 	reload configuration voicemail.conf

(I suspect "reload application," "reload function," and "reload module" 
would probably be synonyms.)

In actual use, you would type

 	rel<tab>c<tab>vo<tab><return>

The current (I'm a 1.2 kind of guy) application API (load_module(), 
unload_module(), ast_register_application(), ast_cli_register(), etc.) 
could be enhanced to support this functionality without requiring major 
change to all of the applications, channel drivers, functions, resources, 
etc.

Also, just to give the stew a stir:

 	load_module			verb-noun
 	unload_module			verb-noun
 	ast_register_application	verb-noun
 	ast_unregister_application	verb-noun
 	ast_cli_register		noun-verb
 	ast_cli_unregister		noun-verb

Well, at least 2 thirds are correct :)

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000



More information about the asterisk-dev mailing list