Asterisk addon asterisk-addons
asterisk-addons
http://www.asterisk.org/index.php?menu=download
asterisk-addons - An addons package, which includes MySQL support for call detail records and MP3 support for MOH
Installation
You must have MySQL installed and the development package prior to installing the app_addon_sql_mysql module.You must already have Asterisk installed before following the directions below.
You must also have the DBD::mysql perl module installed!! Ensure your root@localhost user does not have a password then run the following:
perl -MCPAN -e "install DBD::mysql"
You can then apply your root@localhost password again (or make sure that you have an empty password for root, but be aware...)
You need to use svn or download a ready-made .tar file in order to retrieve the "asterisk-addons":
# cd /usr/src
(the following command retrieves an old version of the addons. much better to get the current version of digium's site: http://ftp.digium.com/pub/asterisk/ currently)
# svn checkout http://svn.digium.com/svn/asterisk-addons/branches/1.2 asterisk-addons
Compile /usr/src/asterisk-addons as follows:
# cd asterisk-addons
# make clean
# make install
Contents
- app_addon_sql_mysql - Asterisk cmd MYSQL - Access MySQL from the Dialplan
- cdr_addon_mysql - Asterisk cdr mysql - Store CDR records in a MySQL database.
- format_mp3 - Alternate mp3 player - Asterisk config musiconhold.conf
- res_perl - Asterisk cmd Perl - Execute Perl code from the Dialplan
See Also
- Asterisk voicemail database - Database support in voicemail
- Asterisk Download
- Asterisk Installation tips
- Asterisk addons
- AGX Extra Addons for Asterisk contains additionals apps that for licensing issue are not included into the official addon package
Comments
333mysql.h no such file or directory...
<BR># cd /usr/include
<BR># ln -s /opt/mysql/include/mysql mysql
<P>Then it worked... (Substitute /opt/mysql/include/mysql with the location for your headers.)
333Error by loading modules
asterisk-1.2.9.1
asterisk-addons-1.2.3
Unable to load module cdr_addon_mysql.so
Aug 9 01:45:49 WARNING5028: loader.c:325 load_resource: /usr/lib/asterisk/modules/cdr_addon_mysql.so: undefined symbol: pure_virtual
Unable to load module app_addon_sql_mysql.so
Aug 9 01:47:25 WARNING5074: loader.c:325 load_resource: /usr/lib/asterisk/modules/app_addon_sql_mysql.so: undefined symbol: pure_virtual
333Re: this doesn't appear to work on debian
333Re: it works, almost
cc -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql -c -o cdr_addon_mysql.o cdr_addon_mysql.c
cc -shared -Xlinker -x -o cdr_addon_mysql.so cdr_addon_mysql.o -lmysqlclient -lz -L/usr/lib/mysql
thanx so much ! great community (:mrgreen:)(:mrgreen:)
333it works, almost
i have trouble with compiling the app_addon_sq_mysql.c too, running just make in the addons dir does`nt work it and gcc-ing it complains about an undeclared function in the lock.h , my sources are fresh from the cvs, maybe it gets fixed tommorrow, or am i doing horribly wrong ?! (:rolleyes:)
333Re: Doesn't compile - Suse 9.1
No way to retract this post tho.
333Re: this doesn't appear to work on debian
I'll ammend the instructions
333Doesn't compile - Suse 9.1
./mkdep -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql `ls *.c`
make -C format_mp3 all
make1: Entering directory `/home/bill/asterisk-addons-1.0.4/format_mp3'
gcc -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -D_REENTRANT -D_GNU_SOURCE -O6 -c -o common.o common.c
gcc -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -D_REENTRANT -D_GNU_SOURCE -O6 -c -o dct64_i386.o dct64_i386.c
gcc -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -D_REENTRANT -D_GNU_SOURCE -O6 -c -o decode_ntom.o decode_ntom.c
gcc -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -D_REENTRANT -D_GNU_SOURCE -O6 -c -o layer3.o layer3.c
gcc -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -D_REENTRANT -D_GNU_SOURCE -O6 -c -o tabinit.o tabinit.c
gcc -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -D_REENTRANT -D_GNU_SOURCE -O6 -c -o interface.o interface.c
gcc -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -D_REENTRANT -D_GNU_SOURCE -O6 -c -o format_mp3.o format_mp3.c
gcc -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -D_REENTRANT -D_GNU_SOURCE -O6 -shared -Xlinker -x -o format_mp3.so common.o dct64_i386.o decode_ntom.o layer3.o tabinit.o interface.o format_mp3.o
make1: Leaving directory `/home/bill/asterisk-addons-1.0.4/format_mp3'
cc -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql -c -o cdr_addon_mysql.o cdr_addon_mysql.c
cc -shared -Xlinker -x -o cdr_addon_mysql.so cdr_addon_mysql.o -lmysqlclient -lz -L/usr/lib/mysql
/usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** cdr_addon_mysql.so Error 1
333this doesn't appear to work on debian
app_addon_sql_mysql.c:31:25: mysql/mysql.h: No such file or directory
cdr_addon_mysql.c:24:22: asterisk.h: No such file or directory
cdr_addon_mysql.c:33:19: mysql.h: No such file or directory
cdr_addon_mysql.c:34:20: errmsg.h: No such file or directory