[asterisk-users] Who is the "creative" mind behind changing Asterisk commands at CLI?

Tzafrir Cohen tzafrir.cohen at xorcom.com
Mon Oct 3 02:57:56 CDT 2011


On Sun, Sep 25, 2011 at 09:39:06PM -0700, Steve Edwards wrote:

> On Sun, 25 Sep 2011, Alex Balashov wrote:

> >Aside from that, is it really that big of a deal?  Is it that hard
> >to learn a new command set and adapt?
> 
> Yes, it is.
> 
> I confess I'm a 1.2 Luddite so I have close to no experience with
> the current CLI. Every time I start using a newer version I get
> about 3 or 4 commands into it and then I get sucked into the vortex
> of 'core or not core,' what module implements this command?, oh the
> hell with it -- I'd be done by now if I used 1.2.
> 
> Why should I have to know the name of the module before I can get
> help on a command? 

Actually knowing the names of modules is easy: Here's what I get after
pressing 'tab' once (Asterisk 1.8)

| sweetmorn*CLI>
| !            ael          agent   agi        aoc        calendar
| cc           cdr          cel     channel    cli        config
| console      core         dahdi   data       database   devstate
| dialplan     dnsmgr       dundi   event      fax        features
| file         group        gtalk   hangup     help       http
| iax2         indication   jabber  jingle     keys       local
| logger       manager      meetme  mfcr2      minivm     mixmonitor
| module       moh          no      odbc       originate  parkedcalls
| phoneprov    pri          queue   realtime   reload     rtcp
| rtp          say          sip     skinny     sla        sqlite
| ss7          stun         timing  transcoder udptl      ulimit
| unistim      voicemail

Now the same without cli_aliases:

| sweetmorn*CLI>
| !            ael       agent        agi          aoc       calendar
| cc           cdr       cel          channel      cli       config
| console      core      dahdi        data         database  devstate
| dialplan     dnsmgr    dundi        event        fax       features
| file         group     gtalk        http         iax2      indication
| jabber       jingle    keys         local        logger    manager
| meetme       mfcr2     minivm       mixmonitor   module    moh
| no           odbc      parkedcalls  phoneprov    pri       queue
| realtime     rtcp      rtp          say          sip       skinny
| sla          sqlite    ss7          stun         timing    transcoder
| udptl        ulimit    unistim      voicemail

But anyqway, let's edit /etc/asterisk/cli_aliases.conf and in [general]
set 'template=asterisk12' . Applying the changes ('module reload
res_cli_asiases.so' . Shouldn't it be 'cli reload aliases'?).

Now we get (again, the following are the options suggested by a single
tab completion)

| sweetmorn*CLI>
| !            add          ael          agent        agi          answer
| aoc          autoanswer   calendar     cc           cdr          cel
| channel      clear        cli          config       console      convert
| core         dahdi        data         database     devstate     dialplan
| dial         dnsmgr       dont         dump         dundi        event
| extensions   fax          features     file         flash        group
| gtalk        hangup       http         iax2         include      indication
| jabber       jingle       keys         local        logger       manager
| meetme       mfcr2        minivm       mixmonitor   module       moh
| mute         no           odbc         oss          parkedcalls  phoneprov
| pri          queue        realtime     remove       rtcp         rtp
| save         say          send         set          show         sip
| skinny       sla          soft         sqlite       ss7          stun
| timing       transcoder   transfer     udptl        ulimit       unistim
| unmute       voicemail

And under 'show' we have:

| sweetmorn*CLI> show
| agents        agi           application   applications  audio
| channeltype   channeltypes  codec         codecs        dialplan
| features      file          function      functions     globals
| hints         image         indications   manager       memory
| profile       queue         switches      translation   version
| video         voicemail

This means that prototyping any suggested fixes is easy: just provide an
extra template for /etc/asterisk/cli_aliases.conf . No need to dwell
into the C source and touch most of the source files. This only allows
you to alias commands and not rename or change them, but it's a start.

So, if anybody has any actual constructive suggestions, please post
them. Let's not waste time with pointless flame wars.

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-users mailing list