astercctools

astercctools is a daemon script provided in asterCC package, it has two features for now

1 get sip peer status

astercctools will connect to your asterisk via AMI and execute command “sip show peers” then parse the result to table `bit_sip_show_peers` in your mysql database.

2 get queue status

astercctools will also execute command “show queue” then parse the result to mysql tables, it would put the resutl to table `queue_stats`,`queue_name`,`queue_agent`,`queue_caller`

using astercctools in your asterisk application, you can read sip and queue status from mysql instead of connecting to asterisk each client seperately, so this would increace efficiency and stability.

here’s the structure of tables metioned above:

CREATE TABLE `bit_sip_show_peers` (
`id` int(10) unsigned NOT NULL auto_increment,
`username` varchar(50) NOT NULL default ”,
`host` varchar(50) NOT NULL default ”,
`dyn` char(1) NOT NULL default ”,
`nat` char(1) NOT NULL default ”,
`port` varchar(5) NOT NULL default ”,
`status` varchar(20) NOT NULL default ”,
`freshtime` datetime NOT NULL default ‘0000-00-00 00:00:00′,
`pbxserver` varchar(50) NOT NULL default ”,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET utf8 DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `bit_queue_stats` (
queue_stats_id int(12) NOT NULL auto_increment,
uniqueid varchar(40) default NULL,
datetime datetime NOT NULL default ‘0000-00-00 00:00:00′,
qname int(6) default NULL,
qagent int(6) default NULL,
qevent int(2) default NULL,
info1 varchar(40) default NULL,
info2 varchar(40) default NULL,
info3 varchar(40) default NULL,
src varchar(32) default NULL,
dst varchar(32) default NULL,
PRIMARY KEY (queue_stats_id),
UNIQUE KEY unico (datetime,qname,qagent,qevent)
) ENGINE=InnoDB DEFAULT CHARSET utf8 DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `bit_queue_name` (
`id` int(10) unsigned NOT NULL auto_increment,
`queuename` varchar(32) NOT NULL default ”,
`curcalls` int NOT NULL default 0,
`limit_type` varchar(32) NOT NULL default ”,
`strategy` varchar(32) NOT NULL default ”,
`holdtime` int NOT NULL default 0,
`w` int NOT NULL default 0,
`calls_answered` int NOT NULL default 0,
`calls_unanswered` int NOT NULL default 0,
`service_level` int NOT NULL default 0,
`t` int NOT NULL default 0,
`data` varchar(255) NOT NULL default ”,
`cretime` datetime NOT NULL default ‘0000-00-00 00:00:00′,
PRIMARY KEY (`id`),
UNIQUE KEY unico (`queuename`)
) ENGINE=HEAP DEFAULT CHARSET utf8 DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `bit_queue_agent` (
`id` int(10) unsigned NOT NULL auto_increment,
`queuename` varchar(32) NOT NULL default ”,
`agent` varchar(32) NOT NULL default ”,
`status` varchar(16) NOT NULL default ”,
`takencalls` int NOT NULL default 0,
`lastcall` int NOT NULL default 0,
`data` varchar(255) NOT NULL default ”,
`cretime` datetime NOT NULL default ‘0000-00-00 00:00:00′,
PRIMARY KEY (`id`)
) ENGINE=HEAP DEFAULT CHARSET utf8 DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `bit_queue_caller` (
`id` int(10) unsigned NOT NULL auto_increment,
`queuename` varchar(32) NOT NULL default ”,
`corder` int NOT NULL default 0,
`caller` varchar(32) NOT NULL default ”,
`waittime` int NOT NULL default 0,
`prio` int NOT NULL default 0,
`data` varchar(255) NOT NULL default ”,
`cretime` datetime NOT NULL default ‘0000-00-00 00:00:00′,
PRIMARY KEY (`id`)
) ENGINE=HEAP DEFAULT CHARSET utf8 DEFAULT COLLATE utf8_general_ci;

See Also

asterCC



astercctools is a daemon script provided in asterCC package, it has two features for now

1 get sip peer status

astercctools will connect to your asterisk via AMI and execute command “sip show peers” then parse the result to table `bit_sip_show_peers` in your mysql database.

2 get queue status

astercctools will also execute command “show queue” then parse the result to mysql tables, it would put the resutl to table `queue_stats`,`queue_name`,`queue_agent`,`queue_caller`

using astercctools in your asterisk application, you can read sip and queue status from mysql instead of connecting to asterisk each client seperately, so this would increace efficiency and stability.

here’s the structure of tables metioned above:

CREATE TABLE `bit_sip_show_peers` (
`id` int(10) unsigned NOT NULL auto_increment,
`username` varchar(50) NOT NULL default ”,
`host` varchar(50) NOT NULL default ”,
`dyn` char(1) NOT NULL default ”,
`nat` char(1) NOT NULL default ”,
`port` varchar(5) NOT NULL default ”,
`status` varchar(20) NOT NULL default ”,
`freshtime` datetime NOT NULL default ‘0000-00-00 00:00:00′,
`pbxserver` varchar(50) NOT NULL default ”,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET utf8 DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `bit_queue_stats` (
queue_stats_id int(12) NOT NULL auto_increment,
uniqueid varchar(40) default NULL,
datetime datetime NOT NULL default ‘0000-00-00 00:00:00′,
qname int(6) default NULL,
qagent int(6) default NULL,
qevent int(2) default NULL,
info1 varchar(40) default NULL,
info2 varchar(40) default NULL,
info3 varchar(40) default NULL,
src varchar(32) default NULL,
dst varchar(32) default NULL,
PRIMARY KEY (queue_stats_id),
UNIQUE KEY unico (datetime,qname,qagent,qevent)
) ENGINE=InnoDB DEFAULT CHARSET utf8 DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `bit_queue_name` (
`id` int(10) unsigned NOT NULL auto_increment,
`queuename` varchar(32) NOT NULL default ”,
`curcalls` int NOT NULL default 0,
`limit_type` varchar(32) NOT NULL default ”,
`strategy` varchar(32) NOT NULL default ”,
`holdtime` int NOT NULL default 0,
`w` int NOT NULL default 0,
`calls_answered` int NOT NULL default 0,
`calls_unanswered` int NOT NULL default 0,
`service_level` int NOT NULL default 0,
`t` int NOT NULL default 0,
`data` varchar(255) NOT NULL default ”,
`cretime` datetime NOT NULL default ‘0000-00-00 00:00:00′,
PRIMARY KEY (`id`),
UNIQUE KEY unico (`queuename`)
) ENGINE=HEAP DEFAULT CHARSET utf8 DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `bit_queue_agent` (
`id` int(10) unsigned NOT NULL auto_increment,
`queuename` varchar(32) NOT NULL default ”,
`agent` varchar(32) NOT NULL default ”,
`status` varchar(16) NOT NULL default ”,
`takencalls` int NOT NULL default 0,
`lastcall` int NOT NULL default 0,
`data` varchar(255) NOT NULL default ”,
`cretime` datetime NOT NULL default ‘0000-00-00 00:00:00′,
PRIMARY KEY (`id`)
) ENGINE=HEAP DEFAULT CHARSET utf8 DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `bit_queue_caller` (
`id` int(10) unsigned NOT NULL auto_increment,
`queuename` varchar(32) NOT NULL default ”,
`corder` int NOT NULL default 0,
`caller` varchar(32) NOT NULL default ”,
`waittime` int NOT NULL default 0,
`prio` int NOT NULL default 0,
`data` varchar(255) NOT NULL default ”,
`cretime` datetime NOT NULL default ‘0000-00-00 00:00:00′,
PRIMARY KEY (`id`)
) ENGINE=HEAP DEFAULT CHARSET utf8 DEFAULT COLLATE utf8_general_ci;

See Also

asterCC



Created by: playsolo, Last modification: Wed 12 of Nov, 2008 (13:41 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+