Thursday, September 07, 2006

Error in asterisk codec


After using a predictive dialer i noticed that the call is not going to the agent because of the error:

Sep 6 23:31:34 NOTICE[8187]: channel.c:1906 ast_read: Dropping incompatible voice frame on Local/913107773456@default-dd6f,1 of format g729 since our native format has changed to slin
Sep 6 23:31:34 NOTICE[8187]: channel.c:1906 ast_read: Dropping incompatible voice frame on Local/913107773456@default-dd6f,1 of format g729 since our native format has changed to slin


...

Wednesday, August 30, 2006

Installing web MeetMe

Guide to install Web-MeetMe. by Ghirardi Nicola
1. Download and extract Web-MeetMe gui in the root direcotry of your Web Server (usually /var/www/). The actual version of the package is 1.3.3. Run :
wget http://www.fitawi.com/Asterisk/Web-MeetMe_v1.3.3.tgz
As root run:
cd /var/www/
mv Web-MeetMe_v1.3.3.tgz /var/www/
tar -xzf Web-MeetMe_v1.3.3.tgz
mv Web-MeetMe web-meetme (it's not necessary, if you do this you'll have to edit the index.html file in the same folder in order to match the address)


2. Edit the file Web-MeetMe/lib/defines.php in order to match the configuration of your system ( database configuration). Here is an example of the configurable part of the file with some comment.

define ("WEBROOT", "http://192.168.0.1/");
// IP address of you asterisk server
define ("FSROOT", "/var/www/Web-MeetMe/");
// Absolute address of the folder where the package was extracted
define ("LIBDIR", FSROOT."lib/");
define ("HOST", "localhost");
// Server alias
define ("PORT", "3306");
// The standard port used by Asterisk is 3306
define ("USER", "root");
define ("PASS", "");
// Username and password of your database.
//Default password for mysql if it was installed by asterisk@home is
//passw0rd, otherwise the default password for root user in a normal
//mysql installation is empty (“”).
// It's really dangerous use default password for an obvious security
//issue.
define ("DBNAME", "meetme");
// Database name. Don't change if you want to follow this guide.
define ("DB_TYPE", "mysql"); // mysql o postgres
//This guide is for mysql but can easily be adaptable to postgresql.
// Comment the following three lines if you don't want any kind of
// authentication (every user can handle or delete the conference of
// another user). The only authentication method supported by now is
// based on an Active Directory Server.
define ("AUTH_TYPE", "adLDAP"); // adLDAP or ""
define ("ADMIN_GROUP", "Domain Admins");
include (FSROOT."lib/".AUTH_TYPE.".php");
// In order to configure your Active Directory Server parameters you
// have to edit /lib/adLDAP.php
define ("DB_TABLECDR", "cdr");
define ("DB_TABLESCHED", "booking");
// Name of two tables used by the program. Don't change if you don't
//have any partucoular aim.

3. Download and compile app_cbmysql in /usr/src/asterisk/apps or wherever you have the Asterisk source. Run as root:
cd /usr/src/asterisk/apps
wget http://www.fitawi.com/Asterisk/app_cbmysql.c
Edit the Makefile in that folder using the patch www.fitawi.com/Asterisk/Makefile-cbmysql-patch.txt . Compile Asterisk : run make install in the Asterisk source directory (not the subdirectory apps!!!!). In this way you will compile only app_cbmysql.c and not all the other parts of Asterisk.

Note: A comman error is: /usr/bin/ld: cannot find -lpq. You can avoid this error installin the package postgresql-devel (or the equivalent of your distribution). You have to install it even if you will use mysql as database.

4. Create the database meetme and the table booking folling the file www.fitawi.com/Asterisk/db-tables-v2.txt. Here is the sql code used to create the table.

CREATE TABLE `booking` (
`bookId` INT( 11 ) DEFAULT NULL NOT NULL AUTO_INCREMENT ,
`clientId` INT( 11 ) DEFAULT '0' NOT NULL ,
`roomNo` VARCHAR( 30 ) DEFAULT '0' NOT NULL ,
`roomPass` VARCHAR( 30 ) DEFAULT '0' NOT NULL ,
`silPass` VARCHAR( 30 ) DEFAULT '0' NOT NULL ,
`startTime` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL ,
`endTime` DATETIME DEFAULT '0000-00-00 00:00:00',
`dateReq` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL ,
`dateMod` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL ,
`maxUser` VARCHAR( 30 ) DEFAULT '10' NOT NULL ,
`status` VARCHAR( 30 ) DEFAULT 'A' NOT NULL ,
`confOwner` VARCHAR( 30 ) NOT NULL ,
`confDesc` VARCHAR( 30 ) NOT NULL ,
PRIMARY KEY ( `bookId` )
);


5. Download cbmysql.conf and copy it in /etc/asterisk. Run:
cd /etc/asterisk
wget http://www.fitawi.com/Asterisk/cbmysql.conf
Edit with your system parameters. A possible configuration is:
[global]
hostname=localhost
dbname=meetme
password=
user=root
port=3306
// database port, the same used in defines.php
sock=/var/run/mysqld/mysqld.sock
//Where the used socket is. Default path is ok for red hat flavour while Debian (and his flavors like Ubuntu) has that file in
/var/run/mysqld/mysqld.sock
OptsAdm=dp
OptsUsr=dp
ConfApp=MeetMe
ConfAppCount=MeetMeCount

6. Edit /etc/asterisk/manager.conf
It's necessary to enable the global user and create the phpagi one if it's not already present adding this code:
[phpagi]
secret = phpagi
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
It's dangerous to leave default password (in every cas). In order to chacge it you have to use the same password in manager.conf and in phpagi.conf in /etc/asterisk.
If that file not exist you have to create it editing phpagi.example.conf in ../Web-MeetMe/phpagi/ .

7. Edit extensions.conf. You can add:
exten => 8600,1,Answer
exten => 8600,2,Wait(1)
exten => 8600,3,CBMysql()
exten => 8600,4,Hangup

8. Check if you have “register_globals = On” in php.ini and the line
“extension=mysql.so” have to be not commented.

9.Reload Asterisk.

Monday, May 15, 2006

Hosted callcenter with nated agents.



I installed asterisk@home2.1 in pentium 4 1.8 Mhz and 512 MB memory. This center start-up from 5 agents and expand up to 10 for two weeks. Monthly call logs of 60k minutes. This is pretty simple config, i just setup sip extens and one trunk provider. The nated asterisk server also act as router for internet browsing and email.

NAT config of the server:

######rc.local#####

touch /var/lock/subsys/local
/usr/local/sbin/motd.sh > /etc/motd
/usr/sbin/amportal start
modprobe iptable_nat
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sysctl -w net.ipv4.ip_forward=1

Trunk config:

Outgoing Settings
trunkname=providername
host=ip.address
type=peer

Incoming Settings
context=from-pstn

Thats it.

Thursday, May 04, 2006

Sip Express Router over CeNtOS

Install Centos Operating System in your Computer.
Update system using YUM command:> yum -y update
Reference commands:
yum search
yum install

Requirements:

- gcc or icc : gcc >= 2.9x; 3.[12] recommended (it will work with older version
but it might require some options tweaking for best performance)
- bison or yacc (Berkley yacc)
- flex
- GNU make (on Linux this is the standard "make", on *BSD and Solaris is
called "gmake") version >= 3.79.
- sed and tr (used in the makefiles)
- GNU tar ("gtar" on Solaris) and gzip if you want "make tar" to work
- GNU install, BSD install or Solaris install if you want "make
install", "make bin", "make sunpkg" to work
- libmysqlclient & libz (zlib) if you want mysql support (the mysql module)
- libexpat if you want the jabber gateway support (the jabber module)
- libxml2 if you want to compile the cpl-c (CPL support) or pa (presence)
modules
- libradiusclient-ng (> 5.0) if you need radius support (the auth_radius,
group_radius, uri_radius and avp_radius modules)
- libpq if you need postgres support (the postgres module)
- ethereal for debugging

Thats it register your windows messenger and call each other.

Tuesday, April 11, 2006

ASTPP in Debain Howto

This howto is orignaly copied in ASTPPDOTORG


Load Debian Sarge

Download the sarge iso and load it on your machine

 vi /etc/apt/sources.list


deb http://ftp.us.debian.org/debian/ sarge main non-free contrib
deb-src http://ftp.us.debian.org/debian/ sarge main non-free contrib
deb http://non-us.debian.org/debian-non-US sarge/non-US main contrib non-free
deb-src http://non-us.debian.org/debian-non-US sarge/non-US main contrib non-free
deb http://security.debian.org/ sarge/updates main contrib non-free

apt-get update
apt-get upgrade
  • Note: Accept all the defaults when configuring packages
 apt-get install  autotools-dev build-essential bzip2 debconf-utils debhelper doxygen dpatch esound-common gdk-imlib1 gettext gnome-bin gnome-libs-data gtkodbcconfig0 html2text imlib-base intltool-debian libart2 libasound2 libasound2-dev libaudio2 libesd0 libglib1.2 libglib1.2-dev libgnome32 libgnomesupport0 libgnomeui32 libgnorba27 libgnorbagtk0 libgsm1 libgsm1-dev libgtk1.2 libgtk1.2-common libgtk1.2-dev liblcms1 libltdl3 libltdl3-dev libmng1 libnewt-dev libodbcinstq1 liborbit0 libpng10-0 libpq3 libqt3c102-mt libreadline4-dev libspeex-dev libspeex1 libsqlite0 libsqlite0-dev libtonezone-dev libtonezone1 libungif4g libx11-dev libxcursor1 libxext-dev libxft2 libxi-dev libxi6 libxrandr2 libxrender1 libxt6 libxv-dev libxv1 module-assistant odbcinst1 pkg-config po-debconf postgresql-dev slang1-utf8-dev unixodbc libxml2 libtiff4 libtiff4-dev apache mysql-server libmysqlclient12-dev php4 php4-gd php4-pear openssl libssl-dev cvs bison libncurses5 libncurses5-dev libaudiofile-dev libnet-telnet-perl libipc-signal-perl libproc-waitstat-perl mpg123 mime-construct php4-mysql apache subversion unixodbc-dev x-dev xlibs-static-dev

Get your sourcecode setup

 cd /usr/src
atp-cache search kernel-image
apt-get install kernel-image-2.6.8-2-686 kernel-headers-2.6.8-2-686
reboot

Log Back In via SSH

 cd /usr/src
ln -s kernel-headers-2.6.8-2-686 linux
wget http://internap.dl.sourceforge.net/sourceforge/amportal/AMP-1.10.010.tar.gz
svn checkout http://svn.digium.com/svn/asterisk/branches/1.2 asterisk-1.2
svn checkout http://svn.digium.com/svn/zaptel/branches/1.2 zaptel-1.2
svn checkout http://svn.digium.com/svn/libpri/branches/1.2 libpri-1.2
svn checkout http://svn.digium.com/svn/asterisk-addons/branches/1.2 asterisk-addons-1.2
svn checkout http://svn.digium.com/svn/asterisk-sounds/trunk asterisk-sounds-1.2
wget http://asterisk.gnuinter.net/files/asterisk-perl-0.08.tar.gz
wget http://www.fitawi.com/Asterisk/Web-MeetMe_v2.0.0.tgz
wget http://www.fitawi.com/Asterisk/app_cbmysql.c
wget http://www.fitawi.com/Asterisk/cb-extensions.conf
wget http://www.fitawi.com/Asterisk/cbmysql.conf
wget http://www.fitawi.com/Asterisk/db-table-create-v4.txt
wget http://www.fitawi.com/Asterisk/meetme-duration.diff
 tar zxvf AMP-1.10.010.tar.gz
tar zxvf asterisk-perl-0.08.tar.gz

groupadd asterisk
useradd -c "asterisk PBX" -d /var/lib/asterisk -u 5060 -g asterisk asterisk
mkdir /var/run/asterisk
cd /usr/src/asterisk-1.2
vi Makefile

Search for
ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run

and Change to
ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run/asterisk

 cd /usr/src/libpri-1.2
make clean
make install
cd /usr/src/zaptel-1.2
make clean
make install

cd /usr/src/asterisk-perl-0.08
perl Makefile.PL
make
make install

cd /usr/src/asterisk-1.2
make clean
make install
make samples


cd /usr/src/asterisk-addons-1.2
vi Makefile

Add

 CFLAGS+=-DMYSQL_LOGUNIQUEID

write quit

 make clean
make install

cd /usr/src/asterisk-sounds-1.2 make install

Install AMP

mysqladmin -u root password 'NEWPASSWORD'
mysqladmin create asteriskcdrdb -p
Enter password:

(password is what you entered above, i.e.: password)

mysql -p asteriskcdrdb < /usr/src/AMP/SQL/cdr_mysql_table.sql mysql -p GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109'; flush privileges; quit mysqladmin create asterisk -p mysql -u root -p asterisk < /usr/src/AMP/SQL/newinstall.sql

mysql -u root -p
mysql> GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';

Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
mysql> \q
cd /usr/src/AMP
./install_amp

Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Checking user..OK
Checking for /etc/amportal.conf../etc/amportal.conf does not exist, copying
default
Creating new /etc/amportal.conf
Enter your USERNAME to connect to the 'asterisk' database:
[asteriskuser]
Enter your PASSWORD to connect to the 'asterisk' database:
[amp109]
Enter the hostname of the 'asterisk' database:
[localhost]
Enter a USERNAME to connect to the Asterisk Manager interface:
[admin]
Enter a PASSWORD to connect to the Asterisk Manager interface:
[amp111]
Enter the path to use for your AMP web root:
[/var/www/html]
/var/www
Enter the path to use for your FOP web root:
[/var/www/html/panel]
/var/www/panel
Enter the path to your Apache cgi-bin:
[/var/www/cgi-bin]
/usr/lib/cgi-bin
Enter the IP ADDRESS or hostname used to access the AMP web-admin:
[xx.xx.xx.xx]
XXX.XXX.XXX.XXX
Enter a PASSWORD to perform call transfers with the Flash Operator Panel:\\ [passw0rd]
Use simple Extensions [extensions] admin or separate Devices and Users
[deviceanduser]?
deviceanduser
[extensions] Enter directory in which to store AMP executable scripts:
[/var/lib/asterisk/bin]
Enter directory in which to store super-user scripts:
[/usr/sbin]
/etc/amportal.conf writtenOK
Reading /etc/amportal.conf..OK
Checking for /etc/asterisk/asterisk.conf..OK
Reading /etc/asterisk/asterisk.conf..OK
Connecting to database..OK
Checking current version of AMP..1.10.010beta1
Installing new AMP files..OK
Configuring install for your environment..chown: cannot access `/dev/zap': No such file or directory
OK
Setting permissions on files..chown: cannot access `/dev/zap': No such file or directory
OK
Checking for upgrades..0 found
Generating AMP configs..
Generating extensions_additional.conf..
Generating sip_additional.conf..
No sip accounts defined in sip
Generating zap_additional.conf..
No zap accounts defined in zap
Generating iax_additional.conf..
No iax accounts defined in iax
Generating meetme_additional.conf..
No extensions defined in extensions
Generating queues_additional.conf..
No queues defined in queues
Generating op_buttons_additional.conf..
readline() on closed filehandle ZAPATA at /
var/www/html/admin/retrieve_op_conf_from_mysql.pl line 44.
Notice: no devices defined
Notice: no Queues defined
Notice: no sip trunks defined
Notice: no iax trunks defined
Notice: no AMP Users defined
Generating AMP configs..OK
Restarting Flash Operator Panel..op_server.pl: no process killed
OK
Please Reload Asterisk by visiting http://192.168.1.9/admin
Edit Apache/PHP to allow for large Music on Hold files
Edit such that the line looks like this:
upload_max_filesize = 20M

 vi /etc/php4/apache/php.ini

mkdir /usr/local/apache
mkdir /usr/local/apache/passwd
htpasswd -c /usr/local/apache/passwd/wwwpasswd wwwadmin
New password:
Re-type new password:
Adding password for user wwwadmin

 apachectl restart
amportal start

http://IP-ADDRESS

Installing Web MeetMe?

Taken mostly from http://asteriskpr.blogspot.com/2005/09/guide-to-install-web-meetm_112614171575673316.html

cp Web-MeetMe?_v2.0.0.tgz /var/www/
cd /var/www
tar -xzf Web-MeetMe?_v2.0.0.tgz

Edit the file Web-MeetMe?/lib/defines.php in order to match the configuration of your system ( database configuration). Here is an example of the configurable part of the file with some comment.

define ("WEBROOT", "http://192.168.0.1/");
// IP address of you asterisk server \\ define ("FSROOT", "/var/www/Web-MeetMe?/"); \\ // Absolute address of the folder where the package was extracted
define ("LIBDIR", FSROOT."lib/");
define ("HOST", "localhost"); \\ // Server alias
define ("PORT", "3306");
// The standard port used by Asterisk is 3306
define ("USER", "root");
define ("PASS", ""); \\ // Username and password of your database.
//Default password for mysql if it was installed by asterisk@home is
//passw0rd, otherwise the default password for root user in a normal
//mysql installation is empty (“”).
// It's really dangerous use default password for an obvious security
//issue.
define ("DBNAME", "meetme");
// Database name. Don't change if you want to follow this guide.
define ("DB_TYPE", "mysql"); // mysql o postgres
//This guide is for mysql but can easily be adaptable to postgresql.
// Comment the following three lines if you don't want any kind of
// authentication (every user can handle or delete the conference of
// another user). The only authentication method supported by now is
// based on an Active Directory Server.
define ("AUTH_TYPE", "adLDAP"); // adLDAP or ""
define ("ADMIN_GROUP", "Domain Admins");
include (FSROOT."lib/".AUTH_TYPE.".php");
// In order to configure your Active Directory Server parameters you
// have to edit /lib/adLDAP.php \\ define ("DB_TABLECDR", "cdr");
define ("DB_TABLESCHED", "booking");
// Name of two tables used by the program. Don't change if you don't
//have any partucoular aim.

mysqladmin -p create meetme

mysql -p

use meetme;

CREATE TABLE `booking` ( `bookId` INT( 11 ) DEFAULT NULL NOT NULL AUTO_INCREMENT , `clientId` INT( 11 ) DEFAULT '0' NOT NULL , `roomNo` VARCHAR( 30 ) DEFAULT '0' NOT NULL , `roomPass` VARCHAR( 30 ) DEFAULT '0' NOT NULL , `silPass` VARCHAR( 30 ) DEFAULT '0' NOT NULL , `startTime` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL , `endTime` DATETIME DEFAULT '0000-00-00 00:00:00', `dateReq` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL , `dateMod` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL , `maxUser` VARCHAR( 30 ) DEFAULT '10' NOT NULL , `status` VARCHAR( 30 ) DEFAULT 'A' NOT NULL , `confOwner` VARCHAR( 30 ) NOT NULL , `aFlags` VARCHAR( 10 ) NOT NULL , `uFlags` VARCHAR( 10 ) NOT NULL , `confDesc` VARCHAR( 30 ) NOT NULL , PRIMARY KEY ( `bookId` ) );

GRANT ALL PRIVILEGES ON meetme.* TO meetme@localhost IDENTIFIED BY 'password';

flush privileges;

Download and compile app_cbmysql in /usr/src/asterisk/apps or wherever you have the Asterisk source. Run as root:

cp app_cbmysql /usr/src/asterisk-1.2/apps/

Edit the Makefile in /usr/src/asterisk-1.2/apps/ using the patch Makefile-cbmysql-patch.txt

Note: A comman error is: /usr/bin/ld: cannot find -lpq. You can avoid this error installin the package postgresql-devel (or the equivalent of your distribution). You have to install it even if you will use mysql as database.

Download cbmysql.conf and copy it in /etc/asterisk. Run:
cd /etc/asterisk
wget http://www.fitawi.com/Asterisk/cbmysql.conf
Edit with your system parameters. A possible configuration is:
[global]
hostname=localhost
dbname=meetme
password=
user=root
port=3306
// database port, the same used in defines.php
sock=/var/run/mysqld/mysqld.sock
//Where the used socket is. Default path is ok for red hat flavour while Debian (and his flavors like Ubuntu) has that file in
/var/run/mysqld/mysqld.sock
OptsAdm?=dp
OptsUsr?=dp
ConfApp?=MeetMe?
ConfAppCount?=MeetMeCount?
Edit /etc/asterisk/manager_custom.conf
It's necessary to enable the global user and create the phpagi one if it's not already present adding this code:
[phpagi]
secret = phpagi
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
It's dangerous to leave default password (in every cas). In order to chacge it you have to use the same password in manager.conf and in phpagi.conf in /etc/asterisk.
If that file not exist you have to create it editing phpagi.example.conf in ../Web-MeetMe?/phpagi/ .
Edit extensions_custom.conf. You can add:
exten => 8600,1,Answer
exten => 8600,2,Wait(1)
exten => 8600,3,CBMysql?()
exten => 8600,4,Hangup
Check if you have register_globals = On in /etc/apache/php.ini and the line extension=mysql.so have to be not commented.

Reload Asterisk.

Installing ASTPP

apt-get install sysutils libwww-perl libintl-perl

cd /usr/src/asterisk-addons-1.2
Vi Makefile
###Add/Make sure its there
CFLAGS+=-DMYSQL_LOGUNIQUEID
## write quit
make clean
make install
amportal stop
amportal start

mysqladmin -p create astpp
mysql -p
use astpp

  • Only paste one table at a time into mysql or it hangs sometimes.

CREATE TABLE `accounts` (

  `number` varchar(20) NOT NULL default '',
`language` varchar(10) default NULL,
`pricelist` varchar(80) NOT NULL default '',
`status` int(11) NOT NULL default '0',
`reseller` varchar(40) NOT NULL default '',
`sweep` int(11) default NULL,
`cc` varchar(20) NOT NULL default '',
`creation` timestamp(14) NOT NULL,
`pin` int(11) default NULL,
`credit_limit` int(11) default NULL,
`balance` decimal(20,6) default NULL,
`posttoexternal` int(11) NOT NULL default '0',
`password` varchar(80) default NULL,
`credit` int(11) NOT NULL default '0',
`first_name` varchar(40) NOT NULL default '',
`middle_name` varchar(40) NOT NULL default '',
`last_name` varchar(40) NOT NULL default '',
`company_name` varchar(40) NOT NULL default '',
`address_1` varchar(80) NOT NULL default '',
`address_2` varchar(80) NOT NULL default '',
`address_3` varchar(80) NOT NULL default '',
`postal_code` varchar(12) NOT NULL default '',
`province` varchar(40) NOT NULL default '',
`city` varchar(80) NOT NULL default '',
`country` varchar(40) NOT NULL default '',
`telephone_1` varchar(40) NOT NULL default '',
`telephone_2` varchar(40) NOT NULL default '',
`fascimile` varchar(40) NOT NULL default '',
`email` varchar(80) NOT NULL default '',
`currency` char(3) NOT NULL default '',
`type` int(11) default '0',
PRIMARY KEY (`number`),
KEY `brand` (`pricelist`),
KEY `brand_2` (`pricelist`)

) TYPE=MyISAM;

CREATE TABLE `ani_map` (

  `number` char(20) NOT NULL default '',
`account` char(20) NOT NULL default '',
PRIMARY KEY (`number`)

) TYPE=MyISAM;

CREATE TABLE `callingcardbrands` (

  `name` char(40) NOT NULL default '',
`language` char(10) NOT NULL default '',
`pricelist` char(40) NOT NULL default '',
`status` int(11) NOT NULL default '1',
`validfordays` char(4) NOT NULL default '',
`pin` int(11) NOT NULL default '0',
`maint_fee_pennies` int(11) NOT NULL default '0',
`maint_fee_days` int(11) NOT NULL default '0',
`disconnect_fee_pennies` int(11) NOT NULL default '0',
`minute_fee_minutes` int(11) NOT NULL default '0',
`minute_fee_pennies` int(11) NOT NULL default '0',
PRIMARY KEY (`name`)

) TYPE=MyISAM;

CREATE TABLE `ip_map` (

  `ip` char(15) NOT NULL default '',
`account` char(20) NOT NULL default '',
PRIMARY KEY (`ip`)

) TYPE=MyISAM;

CREATE TABLE `callingcardcdrs` (

  `id` int(11) NOT NULL auto_increment,
`cardnumber` char(40) NOT NULL default '',
`clid` char(80) NOT NULL default '',
`destination` char(40) NOT NULL default '',
`disposition` char(20) NOT NULL default '',
`callstart` char(40) NOT NULL default '',
`seconds` int(11) NOT NULL default '0',
`debit` decimal(20,6) NOT NULL default '0.000000',
`credit` decimal(20,6) NOT NULL default '0.000000',
`status` int(11) NOT NULL default '0',
`notes` char(80) NOT NULL default '',
PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=1 ;

CREATE TABLE `callingcards` (

  `id` int(11) NOT NULL auto_increment,
`cardnumber` varchar(20) NOT NULL default '',
`language` varchar(10) NOT NULL default '',
`value` int(11) NOT NULL default '0',
`used` int(11) NOT NULL default '0',
`brand` varchar(20) NOT NULL default '',
`created` timestamp(14) NOT NULL,
`firstused` timestamp(14) NOT NULL,
`expiry` timestamp(14) NOT NULL,
`validfordays` varchar(4) NOT NULL default '',
`inuse` int(11) NOT NULL default '0',
`pin` varchar(20) default NULL,
`account` varchar(20) NOT NULL default '',
`maint_fee_pennies` int(11) NOT NULL default '0',
`maint_fee_days` int(11) NOT NULL default '0',
`maint_day` int(11) NOT NULL default '0',
`disconnect_fee_pennies` int(11) NOT NULL default '0',
`minute_fee_minutes` int(11) NOT NULL default '0',
`minute_fee_pennies` int(11) NOT NULL default '0',
`timeused` int(11) NOT NULL default '0',
`invoice` varchar(20) NOT NULL default '0',
`status` int(11) NOT NULL default '1',
PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=1 ;

CREATE TABLE `cdrs` (

  `cardnum` char(40) default NULL,
`callerid` char(80) default NULL,
`callednum` char(80) default NULL,
`trunk` char(40) default NULL,
`disposition` char(20) default NULL,
`billseconds` int(11) default NULL,
`billcost` int(11) default NULL,
`callstart` char(40) default NULL,
`debit` decimal(20,6) default NULL,
`credit` decimal(20,6) default NULL,
`uniqueid` char(40) default NULL,
`status` int(11) NOT NULL default '0',
`notes` char(80) default NULL,
`id` int(11) NOT NULL auto_increment,
`provider` char(40) default NULL,
PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=42857 ;

CREATE TABLE `charge_to_account` (

  `id` int(11) NOT NULL auto_increment,
`charge_id` int(11) NOT NULL default '0',
`cardnum` char(20) NOT NULL default '',
`status` int(11) NOT NULL default '1',
PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=10 ;

CREATE TABLE `charges` (

  `id` int(11) NOT NULL auto_increment,
`pricelist` varchar(80) NOT NULL default '',
`description` varchar(80) NOT NULL default '',
`charge` int(11) NOT NULL default '0',
`sweep` int(11) NOT NULL default '0',
`status` int(11) NOT NULL default '1',
PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=4 ;

CREATE TABLE `counters` (

  `id` int(11) NOT NULL auto_increment,
`package` char(40) NOT NULL default '',
`seconds` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=1 ;

CREATE TABLE `dids` (

  `number` char(40) NOT NULL default '',
`account` char(40) default NULL,
`connectcost` int(11) NOT NULL default '0',
`includedseconds` int(11) NOT NULL default '0',
`cost` int(11) NOT NULL default '0',
`extensions` char(180) default NULL,
`status` int(11) NOT NULL default '1',
`provider` char(40) default NULL,
`country` char(80) default NULL,
`province` char(80) default NULL,
`city` char(80) default NULL,
`monthlycost` int(11) NOT NULL default '0',
PRIMARY KEY (`number`)

) TYPE=MyISAM;

CREATE TABLE `extension_list` (

  `id` int(11) NOT NULL auto_increment,
`extension_id` int(11) NOT NULL default '0',
`cardnum` char(20) NOT NULL default '',
PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=1 ;

CREATE TABLE `outbound_routes` (

  `pattern` varchar(40) default NULL,
`id` int(11) NOT NULL auto_increment,
`comment` varchar(80) default NULL,
`connectcost` int(11) NOT NULL default '0',
`includedseconds` int(11) NOT NULL default '0',
`cost` int(11) NOT NULL default '0',
`provider` varchar(80) default NULL,
`inc` varchar(10) default NULL,
`strip` varchar(40) default NULL,
`prepend` varchar(40) default NULL,
`status` int(11) NOT NULL default '1',
`trunk` varchar(30) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `trunk` (`trunk`),
KEY `trunk_2` (`trunk`)

) TYPE=MyISAM AUTO_INCREMENT=5 ;

CREATE TABLE `packages` (

  `id` int(11) NOT NULL auto_increment,
`name` varchar(40) NOT NULL default '',
`pricelist` varchar(80) NOT NULL default '',
`pattern` varchar(40) NOT NULL default '',
`includedseconds` int(11) default NULL,
`status` int(11) NOT NULL default '1',
PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=1 ;

CREATE TABLE `pbx_list` (

  `id` int(11) NOT NULL auto_increment,
`pbx_id` int(11) NOT NULL default '0',
`cardnum` char(20) NOT NULL default '',
PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=1 ;

CREATE TABLE `pricelists` (

  `name` char(40) NOT NULL default '',
`publishednum` char(40) default NULL,
`markup` int(11) default NULL,
`inc` int(11) default NULL,
`status` int(11) NOT NULL default '1',
PRIMARY KEY (`name`)

) TYPE=MyISAM;

CREATE TABLE `providers` (

  `id` int(11) NOT NULL auto_increment,
`name` char(20) default NULL,
`status` int(11) NOT NULL default '1',
`credit` int(11) default NULL,
`credit_limit` int(11) default NULL,
`balance` decimal(20,6) default NULL,
`password` char(80) default NULL,
PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=6 ;

CREATE TABLE `queue_list` (

  `id` int(11) NOT NULL auto_increment,
`queue_id` int(11) NOT NULL default '0',
`cardnum` char(20) NOT NULL default '',
PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=1 ;

CREATE TABLE `resellers` (

  `name` char(40) NOT NULL default '',
`status` int(11) default NULL,
`posttoexternal` int(11) default NULL,
`agile_site_id` int(11) default NULL,
`config_file` char(80) default NULL,
PRIMARY KEY (`name`)

) TYPE=MyISAM;

CREATE TABLE `routes` (

  `pattern` varchar(40) NOT NULL default '',
`comment` varchar(80) default NULL,
`connectcost` int(11) NOT NULL default '0',
`includedseconds` int(11) NOT NULL default '0',
`cost` int(11) NOT NULL default '0',
`pricelist` varchar(80) NOT NULL default '',
`id` int(11) NOT NULL auto_increment,
`status` int(11) NOT NULL default '1',
`inc` int(11) default NULL,
`reseller` varchar(40) default NULL,
PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=3340 ;

CREATE TABLE `trunks` (

  `name` char(40) NOT NULL default '',
`tech` char(10) default NULL,
`path` char(40) NOT NULL default '',
`provider` char(100) default NULL,
`status` int(11) NOT NULL default '1',
PRIMARY KEY (`name`)

) TYPE=MyISAM;

export CVSROOT=:pserver:anonymous@aleph.aleph-com.net:/cvs
cvs login
###CVS password is blank.
cvs checkout -r stable astpp
cd astpp

vi Makefile
####I changed all my paths to what I know they are
####Make sure the apache user is 'asterisk' or whatever you use for AMP

  1. write quit

make install

cd /var/lib/astpp

cp sample.astpp-config.conf astpp-config.conf cp sample.astpp-enh-config.conf astpp-enh-config.conf cp sample.reseller-config.conf reseller-config.conf

vi astpp-config.conf

cdr_dbhost = localhost
astman_host = localhost
asterisk_server = localhost
cdr_dbpass =
dbhost = localhost
dbpass =
currency_name =

  1. write quit

vi astpp-enh-config.conf

externalbill =

  1. write quit
  1. Open a web browser

http://

Friday, March 10, 2006

A2billing on asterisk@home


I finally make it..

Heres how i do:

Specs:
Pentium III-800256mb Memory40 GB hdTDM400p digium card

>install asterisk@home 2.1>change security (root password, maint.....etc)
>change ip address
>yum -y update
>configure trunk with sip provider
>modify extensions_custom.conf with this settings
[from-external]
exten => s,1,Answer
exten => s,2,Wait,2
exten => s,3,DeadAGI,a2billing.php
exten => s,4,Wait,2
exten => s,5,Hangup

>modify zapata-auto.conf with this parameters
context=from-external
group=0
channel => 1 (up to 4)

#%^&**Patch**()#
http://sourceforge.net/forum/forum.php?thread_id=1396155&forum_id=420324
>read conversation and look for the following:
>cd /usr/src/a2billing/A2Billing_AGI
>cp -r libs_a2billing /var/lib/asterisk/agi-bin
>cd /var/lib/asterisk/agi-bin
>chown asterisk:asterisk libs_a2billing514
>configure the a2billing system(trunk,groups) andcreate pins for testing.
>insert local extensions or local POTS in tdm400 card
>call extension and will prompt the pin and dial thedestination.

thats it...

//jollyr

 Posted by Picasa

After revisiting the google and search for a picture manager i found Picasa which i used when it is on demo last 2 years(big improvement) then i see the link of the Hello program which is to manage a sharing of pictures on the fly when chatting to someone and i found link also of this blogger site on picasa which you can edit and publish blog like this.

One thing get interest of me is the google adds that is ready to register in this picasa application which pay you per click ( idont know if it is true) but i did not try yet thinking of paypal payment which is not applicable in the Philippines(banned).. Posted by Picasa

Thursday, March 09, 2006

RRD Tool Reference

Before installing rrdtool you must installthe following module

1. Time:HiRes
2. File-Tail
3. freetype
4. libart_lgpl

Now all the libraries are set go to RRD home page and follow the instruction how to install the rrdtool applicaion in the rrd build page.
note: if you get an error on libart and freetype module not found. edit the 'configure' in the rrdtool dir and put the ff.
eg. CPPFLAGS="$CPPFLAGS -I/usr/include/libart-2.0must be: CPPFLAGS="$CPPFLAGS -I/usr/local/include/libart-2.0
same also in freetype
eg.CPPFLAGS="$CPPFLAGS -I/usr/local/include/freetype2must be: CPPFLAGS="$CPPFLAGS -I/usr/local/include/freetype2
In the mailgraph.pl script just the following command line
eg: use lib qw(/usr/local/rrdtool-1.2.12/lib/perl ../lib/perl );
Same also in the mailgraph.cgi
eg: use lib qw(/usr/local/rrdtool-1.2.12/lib/perl ../lib/perl );
optional:looks like it cant find the perl module RRDs.pm try looking on the box for it with this commandline:
find / -name RRDs.pm