Page 1 of 1

How do I get to "active outside channels"?

PostPosted: Thu Mar 04, 2010 10:04 am
by Baylink
Since I'm the guy charged with keeping the T-1s running around here, I'd like to build myself a status page that shows me what's going on on a timeslot by timeslot basis: rows of (usually) 24 colored boxes, one for each timeslot on a span; green if the channel's active, blue if it's idle, yellow if it's been in-use more than a configurable time (for us, about 5 minutes), and red if the entire span is inop. Clearly, the last bit I'll have to dig out of things other than VICIdial, but it seems to me that the other info ought to be in the tables somewhere.

I looked at live_agents, but that only shows me the agent's channel, except for closers where it shows me a loopback.

I'm sure some table must have the information about the client side of each call, but there are a lot of tables. :-) Any pointers?

PostPosted: Thu Mar 04, 2010 11:39 am
by williamconley
/var/log/asterisk/cdr-csv/Master.csv

Asterisk has an option of saving this data to a table instead (or in addition).

PostPosted: Thu Mar 04, 2010 11:43 am
by Baylink
I'm not sure, but that doesn't *look* like something I can query once a second from an AJAX server-side script. ;-)

PostPosted: Thu Mar 04, 2010 11:45 am
by williamconley
that would not be wise. but if you move it into a table and then run a script on it to collect the data you DO want FROM it into another table, you should be good.

PostPosted: Thu Mar 04, 2010 11:46 am
by Baylink
I'm not entirely sure, but it sounds as if you're solving a problem a couple steps removed from what I'm trying to do...

I'm trying to get the info out of the live tables; presumably, if it's in that .csv file, then it's being extracted from somewhere; the 'somewhere' is where I'm trying to go.

PostPosted: Thu Mar 04, 2010 11:50 am
by williamconley
getting the information out is easy. but do you want to parse a multi-megabyte file every second? no. so you have to manipulate the data and extract a limited amount (suitable for fast parsing). mysql is very good at that. then you take that small result and place it in a tiny file and parse it every second.

have you done this before? :) (I am a professional, do not try this at home! LOL)

PostPosted: Thu Mar 04, 2010 12:26 pm
by Baylink
No, I don't want to parse a multimeg file every second. I want to do one 2-way join, and parse the results, inside my code. :-)

I should be able to get a join that will give me outside_channel, outside_server_ip, agent, seat, custphone, call_length with no more than 3 tables, I would hope, and the join shouldn't kill anything.

I just don't know the data dictionary well enough to know where to go, and I'm not aware there's any documented data dictionary available; is there?

PostPosted: Thu Mar 04, 2010 12:40 pm
by williamconley
data dictionary for the asterisk csv log? don't think so.

for vicidial's table structure? Nope. The closest you would get to that is a structure only sql export. of course, you can query the system for structure as well, but that seems an awful stretch when the struct isn't changing and you CAN just look at it in phpMyAdmin and choose your data. It's all MyISAM, so you won't be doing a whole lot within the database

PostPosted: Mon Mar 08, 2010 8:31 am
by Baylink
> but that seems an awful stretch when the struct isn't changing

Not pertinent when the problem is that I don't *know* the structure.

I've got a copy of deZigner laying around somewhere; I'll install that and extract the ERD from the database; that ought to get me where I want to go.

PostPosted: Mon Mar 08, 2010 9:15 am
by williamconley
phpmyadmin ... have a look (built in to vicibox)