Set of modules for producing CDR, CEL and other messages from Asterisk to Apache Kafka.
This module requires the librdkafka library.
Tested on Asterisk 16 @ Ubuntu 20.04
apt-get install asterisk-dev librdkafka-dev cmake git
git clone https://github.com/braams/asterisk-kafka
cd asterisk-kafka
mkdir -p build
cd build
cmake ..
make package
dpkg -i asterisk-kafka*.deb
Tested on Asterisk 16 @ Centos 8
(It's assumed you already have asterisk headers in /usr/src/asterisk and modules in /usr/lib/asterisk/modules)
yum install -y librdkafka-devel cmake git
git clone https://github.com/braams/asterisk-kafka
cd asterisk-kafka
mkdir -p build
cd build
cmake ..
make
make install
docker build -t kafka-single-node kafka
docker run -it --rm --net=host kafka-single-node
Dive into test env
docker build -t asterisk-kafka-buildenv .
docker run --rm -it --net=host -v "$(pwd):/asterisk-kafka" -w /asterisk-kafka asterisk-kafka-buildenv bash
Install packages and run Asterisk
dpkg -i build/asterisk-kafka_*.deb
asterisk -cvvv
Check it works
module show like kafka
cdr show status
cel show status
kafka produce hello world
channel originate Local/100@demo application KafkaProduce some,other
Consume messages
kafkacat -C -b localhost:9092 -t asterisk_cdr -o -1
docker run --rm -it --net=host -v "$(pwd)/clickhouse:/docker-entrypoint-initdb.d" yandex/clickhouse-server
- Extra user fields
- Extra librdkafka configuration (https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md)
- Compression