[asterisk-users] Any api (agi/ari/ami) equivalent of "core show calls"?

Telium Technical Support support at telium.io
Sun Jun 14 16:55:45 CDT 2020


Just run ‘core show calls’ as a command  from the AMI, and parse the results.  I don’t think there is an equivalent pure AMI command.

 

From: asterisk-users [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jonathan H
Sent: Sunday, June 14, 2020 5:45 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com>
Subject: Re: [asterisk-users] Any api (agi/ari/ami) equivalent of "core show calls"?

 

Wow! I've been *-ing for about 6 years and had literally no idea about that! 

 

I can see a way I could put it to a different use, but it seems to be a bit of a sledgehammer to crack the walnut of "how many current callers" compared to one line of (albeit hacky) dialplan. 

 

That's making me sound ungrateful. I don't mean to be!

 

On Sun, 14 Jun 2020, 22:39 Steve Edwards, <asterisk.org at sedwards.com <mailto:asterisk.org at sedwards.com> > wrote:

On Sun, 14 Jun 2020, Jonathan H wrote:

> Thank you... but "just update the database" - hmm, what database?

I used MySQL.

> Did you mean ARI? I still can't find the command! The asterisk wiki is 
> somewhat, um... spread around!

ARA as in Asterisk RealTime Architecture

https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration
https://www.voip-info.org/asterisk-realtime/

As I recall (back from 2015), you tell Asterisk which 'configuration file' 
you want to read from MySQL like this:

# /etc/asterisk/extconfig.conf

[settings]
         musiconhold.conf                = mysql,vchat,static
;       musiconhold.conf                = mysql,vchat,musiconhold

I have no idea if this will help, but here are the tables as I defined them back in 2015.

         create  table   if not exists   static
                 (
                   id                    int(11) not null auto_increment
                 , cat_metric            int(11) not null default '0'
                 , var_metric            int(11) not null default '0'
                 , commented             int(11) not null default '0'
                 , filename              varchar(128) not null default ''
                 , category              varchar(128) not null default 'default'
                 , var_name              varchar(128) not null default ''
                 , var_val               varchar(128) not null default ''
                 , primary key           (id)
                 )
                 ;

-- defaults
         set @CAT_METRIC                 = 0;
         set @FILENAME                   = 'musiconhold.conf';
         set @VAR_METRIC                 = 0;

-- Funk Dance
         set @COMMENTED                  = 0;
         set @NAME                       = 'Funk Dance';
         insert into static set
                   cat_metric            = @CAT_METRIC
                 , category              = @NAME
                 , commented             = @COMMENTED
                 , filename              = @FILENAME
                 , var_metric            = @VAR_METRIC
                 , var_name              = 'directory'
                 , var_val               = concat('/source/src/tmp/T2/moh/', @NAME, '/')
                 ;
         insert into static set
                   cat_metric            = @CAT_METRIC
                 , category              = @NAME
                 , commented             = @COMMENTED
                 , filename              = @FILENAME
                 , var_metric            = @VAR_METRIC
                 , var_name              = 'mode'
                 , var_val               = 'files'
                 ;
         insert into static set
                   cat_metric            = @CAT_METRIC
                 , category              = @NAME
                 , commented             = @COMMENTED
                 , filename              = @FILENAME
                 , var_metric            = @VAR_METRIC
                 , var_name              = 'sort'
                 , var_val               = 'random'
                 ;
         insert into static set
                   cat_metric            = @CAT_METRIC
                 , category              = @NAME
                 , commented             = @COMMENTED
                 , filename              = @FILENAME
                 , var_metric            = @VAR_METRIC
                 , var_name              = 'type'
                 , var_val               = 'preset'
                 ;
--      insert into static set
--                cat_metric            = @CAT_METRIC
--              , category              = @NAME
--              , commented             = @COMMENTED
--              , filename              = @FILENAME
--              , var_metric            = @VAR_METRIC
--              , var_name              = 'application'
--              , var_val               = '/usr/bin/mpg123 --mono -b 0 -f 8192 -q -r 8000 -s -@ http://206.190.136.141:5022/Live'
--              ;

-- FILES
--      set @COMMENTED                  = 0;
--      insert into static set
--                cat_metric            = @CAT_METRIC
--              , category              = 'FILES'
--              , commented             = @COMMENTED
--              , filename              = @FILENAME
--              , var_metric            = @VAR_METRIC
--              , var_name              = 'directory'
--              , var_val               = '/var/lib/asterisk/moh/'
--              ;
--      insert into static set
--                cat_metric            = @CAT_METRIC
--              , category              = 'FILES'
--              , commented             = @COMMENTED
--              , filename              = @FILENAME
--              , var_metric            = @VAR_METRIC
--              , var_name              = 'mode'
--              , var_val               = 'files'
--              ;

         create  table   if not exists   musiconhold
                 (
                   name                  varchar(80) not null
                 , mode                  varchar(80) not null default ''
                 , directory             varchar(255) not null default ''
                 , application           varchar(255) not null default ''
                 , digit                 char(1) not null default ''
                 , sort                  varchar(16) not null default ''
                 , format                varchar(16) not null default ''
                 , stamp                 timestamp
                 )
                 ;

         insert into musiconhold set
                   name                  = 'default'
                 , directory             = '/var/lib/asterisk/moh'
                 , application           = ''
                 , mode                  = 'files'
                 , digit                 = ''
                 , sort                  = 'random'
                 , format                = ''
                 ;

         insert into musiconhold set
                   application           = '/usr/bin/mpg123 --mono -b 0 -f 8192 -q -r 8000 -s -@ http://streaming.radionomy.com/80sFunkDanceMusic'
                 , mode                  = 'custom'
                 , name                  = 'foobar'
                 ;

Hope this helps rather than hinders :)

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com <mailto:sedwards at sedwards.com>       Voice: +1-760-468-3867 PST
             https://www.linkedin.com/in/steve-edwards-4244281

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
      https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20200614/5b3ab8dd/attachment.html>


More information about the asterisk-users mailing list