<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>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.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> asterisk-users [mailto:asterisk-users-bounces@lists.digium.com] <b>On Behalf Of </b>Jonathan H<br><b>Sent:</b> Sunday, June 14, 2020 5:45 PM<br><b>To:</b> Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users@lists.digium.com><br><b>Subject:</b> Re: [asterisk-users] Any api (agi/ari/ami) equivalent of "core show calls"?<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Wow! I've been *-ing for about 6 years and had literally no idea about that! <o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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. <o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>That's making me sound ungrateful. I don't mean to be!<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Sun, 14 Jun 2020, 22:39 Steve Edwards, <<a href="mailto:asterisk.org@sedwards.com">asterisk.org@sedwards.com</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><p class=MsoNormal>On Sun, 14 Jun 2020, Jonathan H wrote:<br><br>> Thank you... but "just update the database" - hmm, what database?<br><br>I used MySQL.<br><br>> Did you mean ARI? I still can't find the command! The asterisk wiki is <br>> somewhat, um... spread around!<br><br>ARA as in Asterisk RealTime Architecture<br><br><a href="https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration</a><br><a href="https://www.voip-info.org/asterisk-realtime/" target="_blank">https://www.voip-info.org/asterisk-realtime/</a><br><br>As I recall (back from 2015), you tell Asterisk which 'configuration file' <br>you want to read from MySQL like this:<br><br># /etc/asterisk/extconfig.conf<br><br>[settings]<br> musiconhold.conf = mysql,vchat,static<br>; musiconhold.conf = mysql,vchat,musiconhold<br><br>I have no idea if this will help, but here are the tables as I defined them back in 2015.<br><br> create table if not exists static<br> (<br> id int(11) not null auto_increment<br> , cat_metric int(11) not null default '0'<br> , var_metric int(11) not null default '0'<br> , commented int(11) not null default '0'<br> , filename varchar(128) not null default ''<br> , category varchar(128) not null default 'default'<br> , var_name varchar(128) not null default ''<br> , var_val varchar(128) not null default ''<br> , primary key (id)<br> )<br> ;<br><br>-- defaults<br> set @CAT_METRIC = 0;<br> set @FILENAME = 'musiconhold.conf';<br> set @VAR_METRIC = 0;<br><br>-- Funk Dance<br> set @COMMENTED = 0;<br> set @NAME = 'Funk Dance';<br> insert into static set<br> cat_metric = @CAT_METRIC<br> , category = @NAME<br> , commented = @COMMENTED<br> , filename = @FILENAME<br> , var_metric = @VAR_METRIC<br> , var_name = 'directory'<br> , var_val = concat('/source/src/tmp/T2/moh/', @NAME, '/')<br> ;<br> insert into static set<br> cat_metric = @CAT_METRIC<br> , category = @NAME<br> , commented = @COMMENTED<br> , filename = @FILENAME<br> , var_metric = @VAR_METRIC<br> , var_name = 'mode'<br> , var_val = 'files'<br> ;<br> insert into static set<br> cat_metric = @CAT_METRIC<br> , category = @NAME<br> , commented = @COMMENTED<br> , filename = @FILENAME<br> , var_metric = @VAR_METRIC<br> , var_name = 'sort'<br> , var_val = 'random'<br> ;<br> insert into static set<br> cat_metric = @CAT_METRIC<br> , category = @NAME<br> , commented = @COMMENTED<br> , filename = @FILENAME<br> , var_metric = @VAR_METRIC<br> , var_name = 'type'<br> , var_val = 'preset'<br> ;<br>-- insert into static set<br>-- cat_metric = @CAT_METRIC<br>-- , category = @NAME<br>-- , commented = @COMMENTED<br>-- , filename = @FILENAME<br>-- , var_metric = @VAR_METRIC<br>-- , var_name = 'application'<br>-- , var_val = '/usr/bin/mpg123 --mono -b 0 -f 8192 -q -r 8000 -s -@ <a href="http://206.190.136.141:5022/Live" target="_blank">http://206.190.136.141:5022/Live</a>'<br>-- ;<br><br>-- FILES<br>-- set @COMMENTED = 0;<br>-- insert into static set<br>-- cat_metric = @CAT_METRIC<br>-- , category = 'FILES'<br>-- , commented = @COMMENTED<br>-- , filename = @FILENAME<br>-- , var_metric = @VAR_METRIC<br>-- , var_name = 'directory'<br>-- , var_val = '/var/lib/asterisk/moh/'<br>-- ;<br>-- insert into static set<br>-- cat_metric = @CAT_METRIC<br>-- , category = 'FILES'<br>-- , commented = @COMMENTED<br>-- , filename = @FILENAME<br>-- , var_metric = @VAR_METRIC<br>-- , var_name = 'mode'<br>-- , var_val = 'files'<br>-- ;<br><br> create table if not exists musiconhold<br> (<br> name varchar(80) not null<br> , mode varchar(80) not null default ''<br> , directory varchar(255) not null default ''<br> , application varchar(255) not null default ''<br> , digit char(1) not null default ''<br> , sort varchar(16) not null default ''<br> , format varchar(16) not null default ''<br> , stamp timestamp<br> )<br> ;<br><br> insert into musiconhold set<br> name = 'default'<br> , directory = '/var/lib/asterisk/moh'<br> , application = ''<br> , mode = 'files'<br> , digit = ''<br> , sort = 'random'<br> , format = ''<br> ;<br><br> insert into musiconhold set<br> application = '/usr/bin/mpg123 --mono -b 0 -f 8192 -q -r 8000 -s -@ <a href="http://streaming.radionomy.com/80sFunkDanceMusic" target="_blank">http://streaming.radionomy.com/80sFunkDanceMusic</a>'<br> , mode = 'custom'<br> , name = 'foobar'<br> ;<br><br>Hope this helps rather than hinders :)<br><br>-- <br>Thanks in advance,<br>-------------------------------------------------------------------------<br>Steve Edwards <a href="mailto:sedwards@sedwards.com" target="_blank">sedwards@sedwards.com</a> Voice: +1-760-468-3867 PST<br> <a href="https://www.linkedin.com/in/steve-edwards-4244281" target="_blank">https://www.linkedin.com/in/steve-edwards-4244281</a><br><br>-- <br>_____________________________________________________________________<br>-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br><br>Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" target="_blank">https://community.asterisk.org/</a><br><br>New to Asterisk? Start here:<br> <a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Getting+Started</a><br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><o:p></o:p></p></blockquote></div></div></body></html>