[asterisk-dev] More concise CLI commands - something we really want?
While browsing the bug tracker today, I found a patch for adding more concise commands to the SIP channel. My personal opinion is that I don't like adapting the CLI for machine parsing. If we're about to do that, we might as well convert all CLI listings in one big janitor project. But we already have the manager for that kind of communication - machine-parseable. We could easily write a wrapper for /utils that replaces asterisk -x for web applications and other scripts. I propose that we deprecate the existing concise commands in trunk, don't accept new ones and refer users and developers to our lovely AMI solution. /O ___ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] More concise CLI commands - something we really want?
On Thu, Nov 15, 2007 at 12:43:40PM +0100, Johansson Olle E wrote: While browsing the bug tracker today, I found a patch for adding more concise commands to the SIP channel. My personal opinion is that I don't like adapting the CLI for machine parsing. If we're about to do that, we might as well convert all CLI listings in one big janitor project. But we already have the manager for that kind of communication - machine-parseable. We could easily write a wrapper for /utils that replaces asterisk -x for web applications and other scripts. I propose that we deprecate the existing concise commands in trunk, don't accept new ones and refer users and developers to our lovely AMI solution. I have two potential issues with this: 1. concise tend to better fit in a 80-column terminal (such as the Linux console). 2. asterisk -rx just works if you're a local root. manager requires extra setup. As for (2), I consider what Debian did for mysql - add an extra account on install-time who can connect from localhost only. The password for it is written in a separate mysql client file that only root can read: # cat /etc/mysql/debian.cnf # Automatically generated for Debian scripts. DO NOT TOUCH! [client] host = localhost user = debian-sys-maint password = some-randome-blabla socket = /var/run/mysqld/mysqld.sock [mysql_upgrade] user = debian-sys-maint password = same-above-random-blabla socket = /var/run/mysqld/mysqld.sock basedir = /usr So, what would be the equivalent for the manager interface? Quite implementation-dependent. It's quite tricky to even assure a specific account will be injected into manager.conf . -- Tzafrir Cohen icq#16849755 jabber:[EMAIL PROTECTED] +972-50-7952406 mailto:[EMAIL PROTECTED] http://www.xorcom.com iax:[EMAIL PROTECTED]/tzafrir ___ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] More concise CLI commands - something we really want?
Tzafrir Cohen ha scritto: 2. asterisk -rx just works if you're a local root. manager requires extra setup. I've replaced rasterisk with a manager script that return just the output. Instead with the CLI it return also other bogus messages that are not the direct output of the command i executed. ___ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] More concise CLI commands - something we really want?
On Thu, Nov 15, 2007 at 01:49:18PM +0100, Olle E Johansson wrote: 15 nov 2007 kl. 13.22 Tzafrir Cohen wrote: 1. concise tend to better fit in a 80-column terminal (such as the Linux console). That won't be the case with other listings - we have much more information than what fits. The normal listings try to handle that by cutting off data. Or provide different formatting or whatever. There are a number of methods for doing that. A problem here is that the Asterisk server cannot ask for settings of the client terminal (e.g: COLUMNS). I think it's simple to enable manager. We just need to provide a good script that outputs the data in many different ways, maybe using awk or something classy? This implies that you have a manager account set up properly and securely in a default Asterisk installation. I rather like the usage of file permissions on a socket for granitng permissions. Doing the same with IP sockets is not as straight-forward. Furthermore, there's an explicit login process. If someone comes up with a nice readline (or similar) based interactive client that connects to Asterisk and Just Works (completion included) I would re-consider this. I do find the inclusion of the CLI in Asterisk as rather non-elegant (yeah, I know, this is just ranting with no code attached to it) -- Tzafrir Cohen icq#16849755 jabber:[EMAIL PROTECTED] +972-50-7952406 mailto:[EMAIL PROTECTED] http://www.xorcom.com iax:[EMAIL PROTECTED]/tzafrir ___ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] More concise CLI commands - something we really want?
On Thu, 2007-11-15 at 08:35 -0700, Corey Edwards wrote: On Thu, 2007-11-15 at 15:23 +0200, Tzafrir Cohen wrote: On Thu, Nov 15, 2007 at 01:49:18PM +0100, Olle E Johansson wrote: 15 nov 2007 kl. 13.22 Tzafrir Cohen wrote: 1. concise tend to better fit in a 80-column terminal (such as the Linux console). That won't be the case with other listings - we have much more information than what fits. The normal listings try to handle that by cutting off data. Or provide different formatting or whatever. There are a number of methods for doing that. A problem here is that the Asterisk server cannot ask for settings of the client terminal (e.g: COLUMNS). I created the patch because it shows the entire call ID. When I found 'concise' it was one of those oh cool! moments. I really like it. I think it's simple to enable manager. We just need to provide a good script that outputs the data in many different ways, maybe using awk or something classy? This implies that you have a manager account set up properly and securely in a default Asterisk installation. Exactly. I don't have manager set up and really haven't played with it much. Like many users I am familiar with the CLI. I find value in being able to see the untruncated call data without having to switch gears or learn something new. TMTOWTDI and all that. TMTOWTDI is fine and all until you must maintain many ways of doing the same thing. That said, the CLI also does tab complete on the call ID so that solves my problem too. I certainly will survive without this patch, but I definitely would use it if it was there. This begs the question of what exactly are you doing that you would use tab completion and therefore it seems you are on the CLI and not scripting it. So far as I have followed this thread, the idea is that concise is being used for programming scripts to do things that should be using the AMI interface. If your interaction needs the full callid or some other field for normal work on the console, then maybe you have a good case for fixing the output of a different command. -- Steven Critchfield [EMAIL PROTECTED] ___ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] More concise CLI commands - something we really want?
15 nov 2007 kl. 15.51 skrev Russell Bryant: Johansson Olle E wrote: I propose that we deprecate the existing concise commands in trunk, don't accept new ones and refer users and developers to our lovely AMI solution. I agree with you here, as well. Seems like we've reached consensus somehow. I will close the bug report. Is there someone out there that can make a cool perl/bash/awk/ruby script that can replace asterisk -rx show channels concise ??? /O ___ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] More concise CLI commands - something we really want?
Johansson Olle E wrote: I propose that we deprecate the existing concise commands in trunk, don't accept new ones and refer users and developers to our lovely AMI solution. I agree with you here, as well. -- Russell Bryant Senior Software Engineer Open Source Team Lead Digium, Inc. ___ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
Re: [asterisk-dev] More concise CLI commands - something we really want?
Olle E Johansson wrote: 15 nov 2007 kl. 13.22 skrev Tzafrir Cohen: On Thu, Nov 15, 2007 at 12:43:40PM +0100, Johansson Olle E wrote: While browsing the bug tracker today, I found a patch for adding more concise commands to the SIP channel. My personal opinion is that I don't like adapting the CLI for machine parsing. If we're about to do that, we might as well convert all CLI listings in one big janitor project. But we already have the manager for that kind of communication - machine-parseable. We could easily write a wrapper for /utils that replaces asterisk -x for web applications and other scripts. I propose that we deprecate the existing concise commands in trunk, don't accept new ones and refer users and developers to our lovely AMI solution. I have two potential issues with this: 1. concise tend to better fit in a 80-column terminal (such as the Linux console). That won't be the case with other listings - we have much more information than what fits. The normal listings try to handle that by cutting off data. I think it's simple to enable manager. We just need to provide a good script that outputs the data in many different ways, maybe using awk or something classy? /O I'm going to agree with Olle here. I think there should really be only one way / format to present information from the CLI and everything else should be driven through interfaces designed to deliver multiple formats (eg AMI). -- Bird's The Word Technologies, Inc. http://www.btwtech.com/ ___ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev