asterisk-chan-capi: wrong version

Problem

when asterisk is installed via apt-get install asterisk and chan capi is also installed via apt-get the versions don't match and asterisk won't load chan capi

[May 3 15:45:41] WARNING[1245] loader.c: Module 'chan_capi.so' was not compiled with the same compile-time options as this version of Asterisk.
[May 3 15:45:41] WARNING[1245] loader.c: Module 'chan_capi.so' will not be initialized as it may cause instability.
[May 3 15:45:41] WARNING[1245] loader.c: Module 'chan_capi.so' could not be loaded.

Solution

re compile chan capi

apt-get build-dep asterisk-chan-capi
apt-get --build source asterisk-chan-capi
dpkg -i asterisk-chan-capi_1.1.4-1_i386.deb