Error when compiling chan_iax2

I’m trying to install asterisk but it fails to compile on ubuntu 8.10. Do you know what could be the problem ?

inlined from âtry_firmwareâ at chan_iax2.c:1447:
/usr/include/bits/fcntl2.h:51: error: call to â__open_missing_modeâ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
make[1]: *** [chan_iax2.o] error

thx in advance