On 02/13/2009 07:59 PM, Alex Balashov wrote:
Daniel-Constantin Mierla wrote:
although we have discussed internally at asipto, I want to see opinions from others related to ability of displaying (eventually editing) config file in siremis.
Do you mean just editing the text of the config? Or do you mean editing the config in some high-level way?
simply editing, like we all usually do with vi/vim.
You probably mean the former, but if by chance you mean the latter, I personally would recommend staying away from this. It seems like it would be an unmanageable mess.
I do mean former and I really would stay away from the second. It is just about simple text presentation of the config, eventually editing it as text instead of ssh+vim.
Cheers, Daniel
The problem is that Kamailio is far too polymorphic and extensible, and there are as many ways to write a configuration as there are to skin a cat. Everyone's configuration file is going to have different attributes, except in the respects in which they all must be common of course. But the applications vary immensely; the config route script is part of what makes the system such a powerful building block of SIP telephony applications and platforms.
This means you have to build and maintain another another parser and lexer or hijack the existing one. Either way it would have to be outboard and feed data into the PHP application as Bison/flex/friends don't output PHP parsers. Then, you are still left with the challenge of interpreting the many thousands of permutations of configuration that come out of the parser in various data structures, although you are assisted here by the relative rigidity of the route script syntax in contrast to, say, Perl.
The other alternative would be to take the approach of many web front-ends to complicated things; have SIREMIS generate the configuration out of a template, and produce a result that is rich with meta-data. This means it is not especially feasible to edit it manually afterward; you must use SIREMIS for all aspects of configuration, else you break the meta-data and SIREMIS won't understand the configuration anymore. That in turn means you are now limited in capabilities to merely the set of common things SIREMIS supports. That is clearly a bad idea that is anathema to the very essence of the purpose of the route script.
-- Alex