aboutsummaryrefslogtreecommitdiff
path: root/www/asterisk-stat
diff options
context:
space:
mode:
authorLi-Wen Hsu <lwhsu@FreeBSD.org>2007-07-28 09:21:15 +0000
committerLi-Wen Hsu <lwhsu@FreeBSD.org>2007-07-28 09:21:15 +0000
commita369277b0d99e6eb306a59fab75b05dd2a5db3d7 (patch)
treee166a2dcaa372c0c3ea4c5d61f90503fe6acd223 /www/asterisk-stat
parent9c9c45a38bd6929d5f7d0bd97d435ff7176c6d59 (diff)
downloadports-a369277b0d99e6eb306a59fab75b05dd2a5db3d7.tar.gz
ports-a369277b0d99e6eb306a59fab75b05dd2a5db3d7.zip
Notes
Diffstat (limited to 'www/asterisk-stat')
-rw-r--r--www/asterisk-stat/Makefile73
-rw-r--r--www/asterisk-stat/distinfo3
-rw-r--r--www/asterisk-stat/files/cdr_mysql.tbl24
-rw-r--r--www/asterisk-stat/files/cdr_pgsql.tbl23
-rw-r--r--www/asterisk-stat/files/mysql__patch-cdr.php11
-rw-r--r--www/asterisk-stat/files/mysql__patch-defines.php27
-rw-r--r--www/asterisk-stat/files/patch-export_pdf.php11
-rw-r--r--www/asterisk-stat/files/pgsql__patch-cdr.php11
-rw-r--r--www/asterisk-stat/files/pgsql__patch-defines.php23
-rw-r--r--www/asterisk-stat/files/pkg-message.in5
-rw-r--r--www/asterisk-stat/pkg-descr6
11 files changed, 217 insertions, 0 deletions
diff --git a/www/asterisk-stat/Makefile b/www/asterisk-stat/Makefile
new file mode 100644
index 000000000000..42b54b828dcb
--- /dev/null
+++ b/www/asterisk-stat/Makefile
@@ -0,0 +1,73 @@
+# New ports collection makefile for: www/asterisk-stat
+# Date created: 16 June 2007
+# Whom: Fumihiko Kimura <jfkimura@yahoo.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME= asterisk-stat
+PORTVERSION= 2.0.1
+CATEGORIES= www
+MASTER_SITES= http://www.areski.net/${SITE_SUBDIR}/
+DISTNAME= ${PORTNAME}-v${PORTVERSION:S/./_/g}
+
+MAINTAINER= jfkimura@yahoo.com
+COMMENT= ASTERISK Call Detail Records Analizer
+
+LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd
+
+NO_BUILD= yes
+USE_APACHE= yes
+USE_PHP= session gd pcre
+WANT_PHP_WEB= yes
+ASTERISKDIR?= ${WWWDIR}
+SITE_SUBDIR= asterisk-stat-v2
+WRKSRC= ${WRKDIR}/${SITE_SUBDIR}
+SUB_FILES= pkg-message
+SUB_LIST+= ASTERISKDIR=${ASTERISKDIR}
+
+OPTIONS= PGSQL "Use PostgreSQL instead of MySQL" off
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} >= 700000
+BROKEN= Depends on net/asterisk-addons which does not build on 7-CURRENT
+.endif
+
+.if defined(WITH_PGSQL)
+ASTERISKSTATDB= pgsql
+.else
+ASTERISKSTATDB= mysql
+# net/asterisk-addons
+RUN_DEPENDS+= ${LOCALBASE}/lib/asterisk/modules/cdr_addon_mysql.so:${PORTSDIR}/net/asterisk-addons
+.endif
+
+USE_PHP+= ${ASTERISKSTATDB}
+EXTRA_PATCHES+= ${FILESDIR}/${ASTERISKSTATDB}__patch-cdr.php \
+ ${FILESDIR}/${ASTERISKSTATDB}__patch-defines.php
+
+post-patch:
+ @${MV} ${WRKSRC}/images/print.css ${WRKSRC}/css
+ @${CP} ${WRKSRC}/images/spacer.gif ${WRKSRC}/images/clear.gif
+ @${CP} ${WRKSRC}/css/images/*png ${WRKSRC}/images
+ @${RM} ${WRKSRC}/about.php \
+ ${WRKSRC}/lib/defines.php.orig \
+ ${WRKSRC}/cdr.php.orig \
+ ${WRKSRC}/export_pdf.php.orig
+
+do-install:
+ @${MKDIR} ${ASTERISKDIR}
+ @${MV} ${WRKSRC}/lib/defines.php ${WRKSRC}/lib/defines.php-dist
+ ${CP} -r ${WRKSRC}/ ${ASTERISKDIR}
+ ${CP} ${FILESDIR}/cdr_${ASTERISKSTATDB}.tbl ${PREFIX}/etc/asterisk
+ ${CHOWN} -R ${WWWOWN}:${WWWGRP} ${ASTERISKDIR}
+
+post-install:
+ @${FIND} ${WRKSRC}/${file} -not -type d \
+ | ${SED} -ne 's,^${WRKSRC},${ASTERISKDIR:S,^${TARGETDIR}/,,},p' >> ${TMPPLIST}
+ @${FIND} -d ${WRKSRC}/${file} -type d \
+ | ${SED} -ne 's,^${WRKSRC},@dirrm ${ASTERISKDIR:S,^${TARGETDIR}/,,},p' >> ${TMPPLIST}
+ @${ECHO} etc/asterisk/cdr_${ASTERISKSTATDB}.tbl >> ${TMPPLIST}
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>
diff --git a/www/asterisk-stat/distinfo b/www/asterisk-stat/distinfo
new file mode 100644
index 000000000000..c1138aa17e2d
--- /dev/null
+++ b/www/asterisk-stat/distinfo
@@ -0,0 +1,3 @@
+MD5 (asterisk-stat-v2_0_1.tar.gz) = aad3fe2f9826e8d63dfc9bdea2315d4a
+SHA256 (asterisk-stat-v2_0_1.tar.gz) = a7c17742a4b84b2a90f278009a538d25a8c493a4333d9dd13cdd47ed308a19af
+SIZE (asterisk-stat-v2_0_1.tar.gz) = 390475
diff --git a/www/asterisk-stat/files/cdr_mysql.tbl b/www/asterisk-stat/files/cdr_mysql.tbl
new file mode 100644
index 000000000000..78a5f2021e54
--- /dev/null
+++ b/www/asterisk-stat/files/cdr_mysql.tbl
@@ -0,0 +1,24 @@
+USE asterisk;
+
+CREATE TABLE cdr (
+ calldate datetime NOT NULL default '0000-00-00 00:00:00',
+ clid varchar(80) NOT NULL default '',
+ src varchar(80) NOT NULL default '',
+ dst varchar(80) NOT NULL default '',
+ dcontext varchar(80) NOT NULL default '',
+ channel varchar(80) NOT NULL default '',
+ dstchannel varchar(80) NOT NULL default '',
+ lastapp varchar(80) NOT NULL default '',
+ lastdata varchar(80) NOT NULL default '',
+ duration int(11) NOT NULL default '0',
+ billsec int(11) NOT NULL default '0',
+ disposition varchar(45) NOT NULL default '',
+ amaflags int(11) NOT NULL default '0',
+ accountcode varchar(20) NOT NULL default '',
+ uniqueid varchar(32) NOT NULL default '',
+ userfield varchar(255) NOT NULL default ''
+);
+
+ALTER TABLE `cdr` ADD INDEX ( `calldate` );
+ALTER TABLE `cdr` ADD INDEX ( `dst` );
+ALTER TABLE `cdr` ADD INDEX ( `accountcode` );
diff --git a/www/asterisk-stat/files/cdr_pgsql.tbl b/www/asterisk-stat/files/cdr_pgsql.tbl
new file mode 100644
index 000000000000..ff668d27e7eb
--- /dev/null
+++ b/www/asterisk-stat/files/cdr_pgsql.tbl
@@ -0,0 +1,23 @@
+
+CREATE TABLE cdr (
+ calldate timestamp with time zone DEFAULT now() NOT NULL,
+ clid varchar(80) NOT NULL default '',
+ src varchar(80) NOT NULL default '',
+ dst varchar(80) NOT NULL default '',
+ dcontext varchar(80) NOT NULL default '',
+ channel varchar(80) NOT NULL default '',
+ dstchannel varchar(80) NOT NULL default '',
+ lastapp varchar(80) NOT NULL default '',
+ lastdata varchar(80) NOT NULL default '',
+ duration int(11) NOT NULL default '0',
+ billsec int(11) NOT NULL default '0',
+ disposition varchar(45) NOT NULL default '',
+ amaflags int(11) NOT NULL default '0',
+ accountcode varchar(20) NOT NULL default '',
+ uniqueid varchar(32) NOT NULL default '',
+ userfield varchar(255) NOT NULL default ''
+);
+
+CREATE INDEX calldate_ind ON cdr USING btree (calldate);
+CREATE INDEX dst_ind ON cdr USING btree (dst);
+CREATE INDEX accountcode_ind ON cdr USING btree (accountcode);
diff --git a/www/asterisk-stat/files/mysql__patch-cdr.php b/www/asterisk-stat/files/mysql__patch-cdr.php
new file mode 100644
index 000000000000..339406825991
--- /dev/null
+++ b/www/asterisk-stat/files/mysql__patch-cdr.php
@@ -0,0 +1,11 @@
+--- cdr.php.orig Mon Mar 7 19:20:48 2005
++++ cdr.php Thu Jul 20 23:47:46 2006
+@@ -36,7 +36,7 @@
+ <head>
+ <title>Asterisk CDR</title>
+ <meta http-equiv="Content-Type" content="text/html">
+- <link rel="stylesheet" type="text/css" media="print" href="/css/print.css">
++ <link rel="stylesheet" type="text/css" media="print" href="css/print.css">
+ <SCRIPT LANGUAGE="JavaScript" SRC="./encrypt.js"></SCRIPT>
+ <style type="text/css" media="screen">
+ @import url("css/layout.css");
diff --git a/www/asterisk-stat/files/mysql__patch-defines.php b/www/asterisk-stat/files/mysql__patch-defines.php
new file mode 100644
index 000000000000..3a90bfc5be4e
--- /dev/null
+++ b/www/asterisk-stat/files/mysql__patch-defines.php
@@ -0,0 +1,27 @@
+--- lib/defines.php.orig Tue Mar 8 04:07:23 2005
++++ lib/defines.php Thu Jul 20 21:51:35 2006
+@@ -1,7 +1,7 @@
+ <?php
+
+ define ("WEBROOT", "http://domainname.com/asterisk-stat/");
+-define ("FSROOT", "/var/www/html/HTTP2/Asterisk/asterisk-stat-v2/");
++define ("FSROOT", "/usr/local/www/asterisk-stat/");
+
+
+
+@@ -9,11 +9,11 @@
+
+
+ define ("HOST", "localhost");
+-define ("PORT", "5432");
+-define ("USER", "postgres");
++define ("PORT", "3306");
++define ("USER", "asterisk");
+ define ("PASS", "");
+-define ("DBNAME", "cdrasterisk");
+-define ("DB_TYPE", "postgres"); // mysql or postgres
++define ("DBNAME", "asterisk");
++define ("DB_TYPE", "mysql"); // mysql or postgres
+
+
+ define ("DB_TABLENAME", "cdr");
diff --git a/www/asterisk-stat/files/patch-export_pdf.php b/www/asterisk-stat/files/patch-export_pdf.php
new file mode 100644
index 000000000000..b40656fedf02
--- /dev/null
+++ b/www/asterisk-stat/files/patch-export_pdf.php
@@ -0,0 +1,11 @@
+--- export_pdf.php.orig Thu Mar 3 00:11:32 2005
++++ export_pdf.php Thu Jul 20 23:50:45 2006
+@@ -2,7 +2,7 @@
+ include_once(dirname(__FILE__) . "/lib/defines.php");
+ include_once(dirname(__FILE__) . "/lib/Class.Table.php");
+ define(FPDF_FONTPATH,dirname(__FILE__).'/lib/font/');
+-include_once(dirname(__FILE__) . "/lib/fpdf.php');
++include_once(dirname(__FILE__) . "/lib/fpdf.php");
+
+ session_start();
+
diff --git a/www/asterisk-stat/files/pgsql__patch-cdr.php b/www/asterisk-stat/files/pgsql__patch-cdr.php
new file mode 100644
index 000000000000..339406825991
--- /dev/null
+++ b/www/asterisk-stat/files/pgsql__patch-cdr.php
@@ -0,0 +1,11 @@
+--- cdr.php.orig Mon Mar 7 19:20:48 2005
++++ cdr.php Thu Jul 20 23:47:46 2006
+@@ -36,7 +36,7 @@
+ <head>
+ <title>Asterisk CDR</title>
+ <meta http-equiv="Content-Type" content="text/html">
+- <link rel="stylesheet" type="text/css" media="print" href="/css/print.css">
++ <link rel="stylesheet" type="text/css" media="print" href="css/print.css">
+ <SCRIPT LANGUAGE="JavaScript" SRC="./encrypt.js"></SCRIPT>
+ <style type="text/css" media="screen">
+ @import url("css/layout.css");
diff --git a/www/asterisk-stat/files/pgsql__patch-defines.php b/www/asterisk-stat/files/pgsql__patch-defines.php
new file mode 100644
index 000000000000..af94b2f5e686
--- /dev/null
+++ b/www/asterisk-stat/files/pgsql__patch-defines.php
@@ -0,0 +1,23 @@
+--- lib/defines.php.orig Tue Mar 8 04:07:23 2005
++++ lib/defines.php Sat Jun 23 07:26:44 2007
+@@ -1,7 +1,7 @@
+ <?php
+
+ define ("WEBROOT", "http://domainname.com/asterisk-stat/");
+-define ("FSROOT", "/var/www/html/HTTP2/Asterisk/asterisk-stat-v2/");
++define ("FSROOT", "/usr/local/www/asterisk-stat/");
+
+
+
+@@ -10,9 +10,9 @@
+
+ define ("HOST", "localhost");
+ define ("PORT", "5432");
+-define ("USER", "postgres");
++define ("USER", "asterisk");
+ define ("PASS", "");
+-define ("DBNAME", "cdrasterisk");
++define ("DBNAME", "asterisk");
+ define ("DB_TYPE", "postgres"); // mysql or postgres
+
+
diff --git a/www/asterisk-stat/files/pkg-message.in b/www/asterisk-stat/files/pkg-message.in
new file mode 100644
index 000000000000..761a90bcb51e
--- /dev/null
+++ b/www/asterisk-stat/files/pkg-message.in
@@ -0,0 +1,5 @@
+===> asterisk-stat:
+
+ **** NOTE ****
+ Before the first use of Asterisk-stat, copy defines.php-dist to defines.php
+ in %%ASTERISKDIR%%
diff --git a/www/asterisk-stat/pkg-descr b/www/asterisk-stat/pkg-descr
new file mode 100644
index 000000000000..f594151bcd59
--- /dev/null
+++ b/www/asterisk-stat/pkg-descr
@@ -0,0 +1,6 @@
+Asterisk-Stat is providing different reports & Graph to allow
+the Asterisk-admin to analyse quickly
+and easily the traffic on their Asterisk server.
+All the graphic & reports are based over the CDR database.
+
+WWW: http://www.areski.net/asterisk-stat-v2/about.php