Download the codecs from http://asterisk.hosting.lv. Separate codecs are available for both g.729 and g.723.1.
Because the free ones are pre-compiled, we'll need to download the correct codec for the Asterisk box. Run cat /proc/cpuinfo and note the output. Look specifically at the model name and the flags, such as:
Process: 0
vendor_id: Genuine Intel
cpu family: 6
model: 8
model name: Pentium III (Coppermine)
stepping: 3
cpu MHz: 648.110
cache size: 256 KB
fdiv_bug: no
hlt_bug: no
f00f_bug: no
coma_bug: no
fpu: yes
fpu_exception: yes
cpuid level: 2
wp: yes
flags: fpu vme de pse tsc msr pae mce cx8 mtrr pge mca cmov pat pse36 mmx fxsr sse
bogomips: 1297.41
From this information we can see that it is a Pentium III processor and it is using sse. This is the 2 bits of required information that we need. If you don’t see sse in your flag then the file you need must contain the words no-sse.
So from the information above to obtain the G729 codec we need to get the file codec_g729-gcc-pentium3.so and for the G723 codec we need to get the file g723-gcc-pentium3.so.
After downloading the codec, store it in /usr/lib/asterisk/modules.
Note: if Asterisk doesn't start, you may need to download the icc versions instead of the 'gcc' ones.
Showing posts with label asterisk. Show all posts
Showing posts with label asterisk. Show all posts
Tuesday, October 21, 2008
Slimming down Asterisk
Use the following as a starting point:
[modules]
autoload=no
load => res_indications.so
load => res_features.so
load => res_agi.so
load => res_crypto.so
load => res_musiconhold.so
load => pbx_functions.so
load => pbx_spool.so
load => pbx_loopback.so
load => pbx_config.so
;load => chan_zap.so
load => chan_local.so
load => chan_features.so
load => chan_sip.so
;load => cdr_manager.so
;load => cdr_pgsql.so
load => cdr_addon_mysql.so
load => cdr_csv.so
load => codec_adpcm.so
load => codec_gsm.so
load => codec_a_mu.so
load => codec_ulaw.so
load => codec_alaw.so
load => codec_g726.so
load => format_gsm.so
load => format_wav_gsm.so
load => format_g723.so
load => format_g726.so
load => format_g729.so
load => format_pcm_alaw.so
load => format_pcm.so
load => format_sln.so
load => format_wav.so
load => func_callerid.so
load => app_playback.so
load => app_softhangup.so
load => app_setcidname.so
load => app_milliwatt.so
load => app_macro.so
load => app_verbose.so
load => app_setcdruserfield.so
load => app_read.so
load => app_dial.so
load => app_cdr.so
load => app_cut.so
load => app_echo.so
load => app_setcallerid.so
load => app_readfile.so
load => app_setcidnum.so
load => app_db.so
[global]
chan_modem.so = no
Storage calculation for Recordings
Basic calculation
Based on self-generated white noise file of 30 seconds, sampled at 8KHz in GSM format:
Assumptions
Storage capacity approximations
Based on self-generated white noise file of 30 seconds, sampled at 8KHz in GSM format:
- 30 secs requires 49KB space
- 1 min -> 100KB
- 1 hr -> 6MB
Assumptions
- Operating hours: 9 hours a day, 26 days a month
- Phone lines are 100% saturated 100% of the time:
- Total hours a month = 30 * 9 * 26 = 7,020 hours of recording
- Total server storage capacity = 600GB
- OS and applications consume 100GB. Remaining space = 500GB
- 7,020 hrs -> 42GB, e.g. 1 month requires 42GB storage space
Storage capacity approximations
- 60GB = 10,000 hours = 416 days' worth of recordings
- 80GB = 13,333 hours = 555 days' worth of recordings
- 100GB = 16,666 hours = 695 days' worth of recordings
- 120GB = 20,000 hours = 832 days' worth of recordings
- 160GB = 26,666 hours = 1,111 days' worth of recordings
- 200GB = 33,333 hours = 1,388 days' worth of recordings
Monday, March 31, 2008
mpg123 compile error on 64bit system
decode_i586.s:44: Error: suffix or operands invalid for `push'
The mpg123 patch for amd64 can be found here: www.lanvik-icu.com/mpg123-0.59r-amd64.diff.txt
Download it into a clean mpg123-0.59r directory.
cd into the directory
Code:
The mpg123 patch for amd64 can be found here: www.lanvik-icu.com/mpg123-0.59r-amd64.diff.txt
Download it into a clean mpg123-0.59r directory.
cd into the directory
Code:
user@box: patch < mpg123-0.59r-amd64.diff
user@box: make linux-x86_64
Thursday, December 6, 2007
asterisk + mySQL table = refined
You have two options in /usr/src/asterisk-addons:
1. Add CFLAGS+=-DMYSQL_LOGUNIQUEID to the Makefile.
2. Add a #define MYSQL_LOGUNIQUEID to the top of cdr_addon_mysql.c.
- perform the usual make clean, make, make install.
Table definitions for Asterisk cdr_mysql
Create the database
mysql --user=root --password=password -h dbhost
CREATE DATABASE asterisk;
GRANT INSERT
ON asterisk.*
TO asterisk@localhost
IDENTIFIED BY 'yourpassword';
(Remote MySQL server permissions)
GRANT INSERT
ON asterisk.*
TO asterisk@localhost
IDENTIFIED BY 'yourpassword';
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` );
/etc/asterisk/cdr_mysql.conf
[global]
hostname=192.168.10.5
dbname=asterisk
table=cdr
password=asterisk
user=asterisk
port=3306
sock=/var/lib/mysql/mysql.sock
;userfield=1
/etc/asterisk/modules.conf
load => cdr_addon_mysql.so
[global]
1. Add CFLAGS+=-DMYSQL_LOGUNIQUEID to the Makefile.
2. Add a #define MYSQL_LOGUNIQUEID to the top of cdr_addon_mysql.c.
- perform the usual make clean, make, make install.
Table definitions for Asterisk cdr_mysql
Create the database
mysql --user=root --password=password -h dbhost
CREATE DATABASE asterisk;
GRANT INSERT
ON asterisk.*
TO asterisk@localhost
IDENTIFIED BY 'yourpassword';
(Remote MySQL server permissions)
GRANT INSERT
ON asterisk.*
TO asterisk@localhost
IDENTIFIED BY 'yourpassword';
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` );
/etc/asterisk/cdr_mysql.conf
[global]
hostname=192.168.10.5
dbname=asterisk
table=cdr
password=asterisk
user=asterisk
port=3306
sock=/var/lib/mysql/mysql.sock
;userfield=1
/etc/asterisk/modules.conf
load => cdr_addon_mysql.so
[global]
genksyms not found on 64bit kernel
http://folk.uio.no/oeysteio/orinoco-usb/building.html
$ cd /lib/modules/$(uname -r)/
$ rm build
$ ln -s source build
$ cd build/
$ su
(root password)
$ make mrproper
$ make cloneconfig
$ make prepare-all
Important: You must change make prepare-all
to make prepare scripts
if you get an error similar to:
/bin/sh: scripts/genksyms/genksyms: No such file or directory
Friday, July 13, 2007
Unique ID in asterisk & mySQL
Storing the Unique ID
Q: It would appear that the "uniqueid" field is not being populated in the MySQL CDR DB. Is this an obsolete field or is a bug?A: You need to define MYSQL_LOGUNIQUEID at compile time for it to use that field.
You have two options in /usr/src/asterisk-addons:
1. Add CFLAGS+=-DMYSQL_LOGUNIQUEID to the Makefile.
2. Add a #define MYSQL_LOGUNIQUEID to the top of cdr_addon_mysql.c.
Finally perform the usual make clean, make, make install. Be sure to check the Makefile for the presence of this flag after having done a CVS update! You will most probably also want to index the uniqueid field in your cdr table to improve performance.
You will also have to add a `uniqueid` column in your mysql database after the `accountcode` column:
ALTER TABLE `cdr` ADD `uniqueid` VARCHAR(32) NOT NULL default '' after `accountcode`;
What would I need all this for? For example you are running an AGI script and would like to be able to related AGI data with the CDR table. The problem is that the AGI script will lose connection to the call as soon as the caller hangs up, so you'll need a way to find the correct cdr entry (that'll also be created only after the call has been completed).
Wednesday, July 11, 2007
Asterisk + MySQL
http://www.voip-info.org/wiki-Asterisk+cdr+mysql
Asterisk can store CDR records in a MySQL database, as an alternative to CSV text files and other database formats.
Due to Mysql client libraries licensing, the Mysql billing application is no longer an integrated part of the Asterisk standard distribution. It is now located in the asterisk-addons CVS directory.
You must have mysql and mysql-devel packages installed.
# make clean
# make
# make install
A sample configuration file, can be found on the cdr_mysql.conf page.
Copy the sample configuration file to /etc/asterisk/cdr_mysql.conf and edit it according to your requirements. Then edit your modules.conf to load cdr_addon_mysql.so and finally restart asterisk; before the restart you should, however, check that your cdr table has been created correctly and is accessible to the username and password you specified.
Table definitions for Asterisk cdr_mysql
Create the database
mysql --user=root --password=password -h dbhost
CREATE DATABASE asterisk;
GRANT INSERT
ON asterisk.*
TO asterisk@localhost
IDENTIFIED BY 'yourpassword';
(Remote MySQL server permissions)
GRANT INSERT
ON asterisk.*
TO asterisk@localhost
IDENTIFIED BY 'yourpassword';
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 '',
`userfield` varchar(255) NOT NULL default ''
);
ALTER TABLE `cdr` ADD INDEX ( `calldate` );
ALTER TABLE `cdr` ADD INDEX ( `dst` );
ALTER TABLE `cdr` ADD INDEX ( `accountcode` );
/etc/asterisk/cdr_mysql.conf
[global]
hostname=192.168.10.5
dbname=asterisk
table=cdr
password=asterisk
user=asterisk
port=3306
sock=/var/lib/mysql/mysql.sock
;userfield=1
/etc/asterisk/modules.conf
load => cdr_addon_mysql.so
[global]
Asterisk can store CDR records in a MySQL database, as an alternative to CSV text files and other database formats.
Due to Mysql client libraries licensing, the Mysql billing application is no longer an integrated part of the Asterisk standard distribution. It is now located in the asterisk-addons CVS directory.
You must have mysql and mysql-devel packages installed.
Compile
# cd asterisk-addons-1.2# make clean
# make
# make install
A sample configuration file, can be found on the cdr_mysql.conf page.
Copy the sample configuration file to /etc/asterisk/cdr_mysql.conf and edit it according to your requirements. Then edit your modules.conf to load cdr_addon_mysql.so and finally restart asterisk; before the restart you should, however, check that your cdr table has been created correctly and is accessible to the username and password you specified.
Table definitions for Asterisk cdr_mysql
Create the database
mysql --user=root --password=password -h dbhost
CREATE DATABASE asterisk;
GRANT INSERT
ON asterisk.*
TO asterisk@localhost
IDENTIFIED BY 'yourpassword';
(Remote MySQL server permissions)
GRANT INSERT
ON asterisk.*
TO asterisk@localhost
IDENTIFIED BY 'yourpassword';
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 '',
`userfield` varchar(255) NOT NULL default ''
);
ALTER TABLE `cdr` ADD INDEX ( `calldate` );
ALTER TABLE `cdr` ADD INDEX ( `dst` );
ALTER TABLE `cdr` ADD INDEX ( `accountcode` );
/etc/asterisk/cdr_mysql.conf
[global]
hostname=192.168.10.5
dbname=asterisk
table=cdr
password=asterisk
user=asterisk
port=3306
sock=/var/lib/mysql/mysql.sock
;userfield=1
/etc/asterisk/modules.conf
load => cdr_addon_mysql.so
[global]
Subscribe to:
Posts (Atom)