# From your Mac, copy the module directory to your Linux server
scp -r kamailio-web3-auth/ user@your-server:/tmp/# Ubuntu/Debian
sudo apt-get update
sudo apt-get install kamailio-dev libcurl4-openssl-dev build-essential
# CentOS/RHEL/Rocky
sudo yum install kamailio-devel libcurl-devel gcc make
# or for newer versions:
sudo dnf install kamailio-devel libcurl-devel gcc makeCreate a fixed version of web3_auth.c with proper system paths:
cd /tmp/kamailio-web3-authThen edit web3_auth.c to use system headers instead of relative paths.
# Build the module
make
# Install to Kamailio modules directory
sudo make install
# Or manually copy if make install doesn't work
sudo cp web3_auth.so /usr/lib/x86_64-linux-gnu/kamailio/modules/
# (path may vary: /usr/local/lib/kamailio/modules/ or /usr/lib64/kamailio/modules/)# Find where Kamailio modules are installed
find /usr -name "*.so" -path "*/kamailio/modules*" | head -5
# Or check Kamailio config
kamailio -f /etc/kamailio/kamailio.cfg -c | grep "module_path"If you want to build on your Mac for Linux deployment:
# Create Dockerfile for building
cat > Dockerfile << 'EOF'
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
kamailio-dev \
libcurl4-openssl-dev \
build-essential \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY . .
RUN make
CMD ["cp", "web3_auth.so", "/output/"]
EOF# Build the module using Docker
docker build -t kamailio-web3-builder .
docker run --rm -v $(pwd):/output kamailio-web3-builder
# This creates web3_auth.so in your current directoryIf you know your Kamailio installation paths, update the Makefile:
# Find Kamailio headers location
KAMAILIO_INCLUDE = /usr/include/kamailio
# or /usr/local/include/kamailio
# or /opt/kamailio/include
# Update include flags
INCLUDES = -I$(KAMAILIO_INCLUDE)# Find where Kamailio headers are installed
find /usr -name "sr_module.h" 2>/dev/null
# Update KAMAILIO_PATH in Makefile to the found path# Add Kamailio repository first
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:kamailio/kamailio
sudo apt-get update
sudo apt-get install kamailio-dev# Install curl development headers
sudo apt-get install libcurl4-openssl-dev
# Or for older systems
sudo apt-get install libcurl3-dev# Check module exports
nm -D web3_auth.so | grep web3_auth_check
# Verify module loads correctly
kamailio -f kamailio.cfg -c# Test configuration without starting
kamailio -f /etc/kamailio/kamailio.cfg -c
# Should show no errors about web3_auth module# Add to kamailio.cfg for testing
debug=4
log_stderror=yes
# Start Kamailio in foreground
sudo kamailio -f /etc/kamailio/kamailio.cfg -D -E# Monitor Kamailio logs
tail -f /var/log/kamailio.log | grep -i web3
# Should see initialization messages:
# "Web3 Auth module initializing..."
# "Web3 Auth module initialized successfully"- Dependencies installed (kamailio-dev, libcurl-dev)
- Module compiled successfully (web3_auth.so created)
- Module copied to correct Kamailio modules directory
- Kamailio configuration updated with module load and parameters
- Configuration syntax checked (
kamailio -c) - Test restart of Kamailio service
- Monitor logs for any errors
- Test authentication with SIP client
# On your Mac - copy files
scp -r kamailio-web3-auth/ user@server:/tmp/
# On server - install and build
sudo apt-get install kamailio-dev libcurl4-openssl-dev build-essential
cd /tmp/kamailio-web3-auth
make
sudo cp web3_auth.so /usr/lib/x86_64-linux-gnu/kamailio/modules/
sudo systemctl restart kamailio