[asterisk-dev] Show Channels Concise Deprecation in 1.6

Atis Lezdins atis at iq-labs.net
Tue Dec 9 16:05:17 CST 2008


On Tue, Dec 9, 2008 at 5:35 PM, Miguel Molina <mmolina at millenium.com.co> wrote:
> I think that the Realtime Channels (status) is a great functionality, and so
> the rejected "Queue Status Realtime". I would like to take a look on the
> rejected one, do you have the bug ID? And why it got rejected? And if they
> got rejected what is the best way to take out realtime status data of what
> is happening inside asterisk as an alternative to listening to manager
> events which I think is somewhat complicated to handle?
>
> I usually prefer having the realtime status data of the calls/queues on a
> database for easy reporting and visualizing. I already had a parser/database
> updater for the "core show channels concise" command which works fine if
> there are not deadlocks on asterisk as you
> pointed it. As I solved the deadlock problem that I had, the command put no
> problems, but I prefer your Realtime approach.

That was exactly my point. But i'm happy anyway as i can use it, feel
free to do the same :)
Those patches are quite simple, maintaining them between versions
shouldn't be a problem.

The only complex one would be "queue member status in realtime" which
hooks into app_queue's device state handler, there were lot of changes
and refactoring from 1.4 to 1.6.
There's "lastcall", "status", etc, all synced with realtime, so that
took me few days to up-port. Unfortunately i have it only in my
"asterisk patch set" and it can't be just scraped out for 1.4 as it's
based on lots of backports.
1.6 version should be simpler, but i still would have to scrape out
from patch set and test. So, if you're interested also in that, just
bug me :)

>
> Finally, do you have a small howto on configuring the database tables and
> asterisk configuration files? It would be very useful to use your patches.

Philipp already sent the links for discussion/bug. If you have 1.6.0,
you can just apply patch, create tables and add "queue_callers" and/or
"channels" definitions in extconfig.conf. Here goes samples from my
setup:

tables:
CREATE TABLE `channels` (
            `uniqueid` varchar(40) NOT NULL,
            `started` int(10) unsigned default NULL,
            `channel` varchar(80) default NULL,
            `flags` enum('MASQ','ZOMBIE') default NULL,
            `state` varchar(20) default NULL,
            `callerid_num` varchar(40) default NULL,
            `callerid_name` varchar(80) default NULL,
            `accountcode` varchar(40) default NULL,
            `context` varchar(40) default NULL,
            `exten` varchar(40) default NULL,
            `priority` varchar(5) default NULL,
            `application` varchar(40) default NULL,
            `data` varchar(80) default NULL,
            `bridgedto` varchar(40) default NULL,
            PRIMARY KEY  (`uniqueid`),
            KEY `i_channel9_flags` (`channel`(9),`flags`),
            KEY `i_accountcode_uniqueid_flags`
(`accountcode`,`uniqueid`,`flags`)
          ) ENGINE=MyISAM DEFAULT CHARSET=latin1

CREATE TABLE `queue_callers` (
                 `uniqueid` varchar(40) NOT NULL,
                 `queue` varchar(128) default NULL,
                 `channel` varchar(128) default NULL,
                 `priority` varchar(11) default NULL,
                 `callerid_name` varchar(80) default NULL,
                 `callerid_num` varchar(40) default NULL,
                 `accountcode` varchar(80) default NULL,
                 `started` int(10) unsigned default NULL,
                 PRIMARY KEY  (`uniqueid`),
                 KEY `i_queue_prio_started` (`queue`,`priority`,`started`)
               ) ENGINE=MyISAM DEFAULT CHARSET=latin1

extconfig.conf:

queue_callers => mysql,asterisk,queue_callers
channels => mysql,asterisk,channels

For more on that, just read any doc on realtime config.

For 1.4, you will have to first apply both patches from
http://ftp.iq-labs.net/realtime_store_destroy-1.4/
One is for asterisk, another is for asterisk-addons
(res_config_mysql), so that they support INSERT and DELETE.

Regards,
Atis

-- 
Atis Lezdins,
VoIP Project Manager / Developer,
IQ Labs Inc,
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835



More information about the asterisk-dev mailing list