root@nikita:/usr/src/asterisk-addons-1.0.4# make cc -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql -c -o cdr_addon_mysql.o cdr_addon_mysql.c
cdr_addon_mysql.c:24:22: asterisk.h: No such file or directory
make: *** [cdr_addon_mysql.o] Error 1
this is easily fixed by adding the following line to the asterisk-addons Makefile:
CFLAGS+=$(shell if [ -d /usr/src/asterisk-1.0.5 ]; then echo "-I/usr/src/asterisk-1.0.5"; fi)
Note, you will have to change the path to point to your asterisk source directory. Once that's done, just run 'make' again, and 'make install' and everything will be just fine

christo