SMPP Module for Kamailio =====================
This module implements SMPP (Short Message Peer-to-Peer) protocol support for Kamailio. It supports both SMPP v3.4 and v5.0 protocols and provides database authentication for SMPP clients.
Features -------- * SMPP v3.4 and v5.0 support * Database authentication * IP-based access control * Multiple concurrent binds support * Connection tracking * Automatic unbind on timeout * TLS/SSL support * Message queuing * Rate limiting * Character set conversion
Configuration ------------ The module can be configured in two ways:
1. Using Kamailio's main configuration file (kamailio.cfg): ``` loadmodule "smpp.so"
# Basic configuration modparam("smpp", "config_file", "/etc/kamailio/mod_smpp.conf") ```
2. Using the dedicated configuration file (mod_smpp.conf): The module looks for the configuration file at `/etc/kamailio/mod_smpp.conf` by default. You can override this location using the config_file parameter.
Configuration Parameters ---------------------- All parameters can be set either in kamailio.cfg or in mod_smpp.conf:
Basic Settings: * smpp_port (integer) - Port to listen for SMPP connections (default: 2775) * max_connections (integer) - Maximum number of concurrent connections (default: 100) * smpp_version (integer) - SMPP protocol version (34 for v3.4, 50 for v5.0)
Database Settings: * db_url (string) - Database URL for authentication * auth_table (string) - Name of the authentication table (default: smpp_auth)
Protocol Settings: * max_pdu_size (integer) - Maximum PDU size in bytes (default: 4096) * enquire_link_interval (integer) - Interval for keep-alive messages in seconds (default: 30) * inactivity_timeout (integer) - Connection timeout in seconds (default: 60)
Security Settings: * enable_ip_acl (integer) - Enable IP-based access control (default: 1) * max_failed_binds (integer) - Maximum failed bind attempts before blocking (default: 3) * block_duration (integer) - Block duration after max failed binds in seconds (default: 300)
Logging Settings: * log_level (integer) - Log level (1-4: error, warn, info, debug) (default: 3) * debug_pdu (integer) - Enable detailed PDU logging (default: 0) * log_file (string) - Log file path (default: /var/log/kamailio/smpp.log)
Advanced Settings: * window_size (integer) - Window size for windowing/throttling (default: 10) * max_message_rate (integer) - Maximum message rate per second (0 = unlimited) * default_charset (string) - Character set for message conversion (default: UTF-8) * enable_queue (integer) - Enable message queuing (default: 1) * max_queue_size (integer) - Maximum queue size (default: 1000)
TLS Settings: * enable_tls (integer) - Enable TLS support (default: 0) * tls_cert_file (string) - TLS certificate file path * tls_key_file (string) - TLS private key file path * tls_ca_file (string) - TLS CA certificate file path
Database Schema -------------- The module requires a database table for authentication. Create it using:
mysql -u user -p database_name < smpp.sql
Example Configuration ------------------- 1. In kamailio.cfg: ``` loadmodule "smpp.so" modparam("smpp", "config_file", "/etc/kamailio/mod_smpp.conf") ```
2. In mod_smpp.conf: ``` # Basic settings smpp_port = 2775 max_connections = 100 smpp_version = 34
# Database settings db_url = "mysql://kamailio:kamailiorw@localhost/kamailio" auth_table = "smpp_auth"
# Security settings enable_ip_acl = 1 max_failed_binds = 3
# TLS settings enable_tls = 1 tls_cert_file = "/etc/kamailio/certs/smpp_cert.pem" tls_key_file = "/etc/kamailio/certs/smpp_key.pem" tls_ca_file = "/etc/kamailio/certs/ca.pem" ```
Dependencies ----------- * Kamailio Core * Database module (mysql, postgresql, etc.) * TLS module (if TLS support is enabled)
Author ------ Kamailio Project (https://www.kamailio.org) Tarik Ogut (tarikogut@gmail.com)