[Kamailio-Devel] Syntax for mi commands

Daniel-Constantin Mierla miconda at gmail.com
Fri Jan 30 13:06:44 CET 2009


Hello,

I agree, we should get some guidelines/recommendation about naming of MI 
commands. I started a wiki page for it:
http://www.kamailio.org/dokuwiki/doku.php/development:mi-commands

Please contribute there with suggestions and discuss them here. I am for 
"module-identifier - underscore - command name".

For the upcoming release we can leave as they are now and maybe add 
aliases to same command with a new name that follows the rules.

Cheers,
Daniel


On 01/27/2009 11:47 PM, Johansson Olle E wrote:
> While digging around the mi interface, I've discovered that there is a  
> few different syntaxes around and would like to suggest that we  
> implement some sort of guidelines for the future.
>
> * Examples of mi commands
>     ------------------------------------
> 	rl_stats
> 	regex_reload
> 	ul_rm
>
> Syntax: Module identifier - underscore - command
>
> * Wrong syntax according to above rule:
>    ----------------------------------------------------
> 	reload_blacklist
>
> Should propably be "blacklist_reload" or "bl_reload" to follow above  
> syntax
>
> * Totally different syntax:
>     ------------------------------
> 	refreshXcapDoc   - note UpperCaseLikeJava
>
> Should propably be something like "xc_refresh_xcapdoc"
>
> * Other examples
>    ----------------------
> - The dialog module use both dlg_ and profile_ prefixes, which is  
> confusing
> - cpl-c has REMOVE_CPL and GET_CPL in upper case
> - cfgutils has a lot of different commands without a clear prefix system
> - For command arguments, carrierroute use a command-line syntax, which  
> no other module does. Instead of multiple arguments, it has one  
> argument with whitespace and dash syntax, like no other module.
>
> ------------------------
>
> I don't judge what's right or wrong here, just document that this is a  
> bit confusing and not very logical. It raises a few questions:
>
> - Do we need guidelines for this, so we don't get yet another syntax  
> in the next new module?
> - Is it possible to change existing commands for a new release?
>
> We just did an overhaul of the Asterisk manager interface in 1.6.0 to  
> make it a tiny bit more logical than before. In that work, we changed  
> the version number of the AMI api so that clients could adopt to the  
> changes.
>
>
> Cheers,
> /O
>
> _______________________________________________
> Kamailio (OpenSER) - Devel mailing list
> Devel at lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/devel
> http://lists.openser-project.org/cgi-bin/mailman/listinfo/devel
>
>   

-- 
Daniel-Constantin Mierla
http://www.asipto.com




More information about the Devel mailing list