{"id":22468925,"url":"https://github.com/bundasmanu/kamailio-docker","last_synced_at":"2026-05-01T01:31:32.349Z","repository":{"id":264236685,"uuid":"855272746","full_name":"bundasmanu/kamailio-docker","owner":"bundasmanu","description":"Custom Kamailio Container to be used as a generic wrapper on multiple purposes (Edge Proxy, Core Server, Registrar Server, etc)","archived":false,"fork":false,"pushed_at":"2026-04-06T18:36:35.000Z","size":105,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-06T20:25:56.826Z","etag":null,"topics":["docker","docker-compose","kamailio","sip","voip"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bundasmanu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-10T15:50:28.000Z","updated_at":"2026-04-06T18:36:43.000Z","dependencies_parsed_at":"2025-02-01T19:40:54.511Z","dependency_job_id":"afc86b47-69eb-40b1-9672-1fbe1804eb9e","html_url":"https://github.com/bundasmanu/kamailio-docker","commit_stats":null,"previous_names":["bundasmanu/kamailio-docker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bundasmanu/kamailio-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bundasmanu%2Fkamailio-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bundasmanu%2Fkamailio-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bundasmanu%2Fkamailio-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bundasmanu%2Fkamailio-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bundasmanu","download_url":"https://codeload.github.com/bundasmanu/kamailio-docker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bundasmanu%2Fkamailio-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32482460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","kamailio","sip","voip"],"created_at":"2024-12-06T11:20:37.917Z","updated_at":"2026-05-01T01:31:32.337Z","avatar_url":"https://github.com/bundasmanu.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kamailio-docker\n\nCustom Kamailio Container to be used as a generic backbone on multiple purposes (Edge Proxy, Core Server, Registrar Server, etc).\n\n- [kamailio-docker](#kamailio-docker)\n  - [Purpose](#purpose)\n  - [What offers?](#what-offers)\n  - [.env file](#env-file)\n  - [Networks](#networks)\n    - [CoreDNS](#coredns)\n  - [PostgreSQL](#postgresql)\n  - [Homer](#homer)\n  - [Build image](#build-image)\n  - [Run Kamailio](#run-kamailio)\n    - [Run Multiple Instances](#run-multiple-instances)\n  - [Test Kamailio code](#test-kamailio-code)\n  - [Sngrep for troubleshooting purposes](#sngrep-for-troubleshooting-purposes)\n  - [kamcmd](#kamcmd)\n  - [psql interface - inside container](#psql-interface---inside-container)\n  - [Workaround on OSX to allow receiveing UDP requests without restrictions in length](#workaround-on-osx-to-allow-receiveing-udp-requests-without-restrictions-in-length)\n\n## Purpose\n\nThe main reasons behind the need to create this repo, are mainly:\n\n- The need to get a easy way to switch between different `Kamailio` versions;\n- The need to make easy the process to install and use only the needed packages;\n- The need to get a functional `backbone` that contains the main modules shared across different possible purposes like: `Edge Proxy`, `Core Proxy`, etc;\n\n## What offers?\n\n- `Kamailio` working in a container;\n- Easy way to manage and switch between different `Kamailio` versions;\n- Easy way to manage `Kamailio` packages;\n- Easy way to run multiple `Kamailio` instances at same time, with same codebase;\n- `kamcmd` integration;\n- `dispatcher` integration implemented;\n- `PostgreSQL` integration implmented - [postgres-kamailio-docker](https://github.com/bundasmanu/postgres-kamailio-docker);\n- `Homer` integration implemented - tested with Homer7 and Homer10;\n- Log file managing;\n\n## .env file\n\n- `DISTRO_IMAGE`: Debian version to be used to build the image;\n- `KAMAILIO_VERSION`: Kamailio Debian repo version to be used to get the packages. We can see the availables versions here: [Kamailio Deb](https://deb.kamailio.org/);\n- `KAMAILIO_PACKAGES`: List of `Kamailio` packages to be installed. The packages must be spearated by a comma;\n- `STARTER_KAM_USER`: User to run `kamailio`;\n- `STARTER_KAM_GROUP`: Group to run `kamailio`;\n- `SHM_MEMORY`: Shared memory to be allocated;\n- `PKG_MEMORY`: Private memory to be allocated;\n- `CONFIGS_FOLDER`: Path to store the `Kamailio` configuration files (mount volume);\n- `CFGFILE`: Starter `Kamailio` configuration file;\n- `TMP_FILE_LOCATION`: Path to store temporary files (`.pid`, `.fifo`, `.sock`);\n- `LOG_FILE_DIR`: Path to store the `kanailio` generated logs (mount volume);\n- `LOG_FILE_NAME`: Name of the log file;\n- `DB_CONNECTION`: Connection to the `Postgres` database;\n- `LISTEN_IP`: IP address to add to `kamailio` listen address (this logic must be addressed by other tools, like: `ansible`);\n- `HEPLIFY_IP`: IP address of `heplify-server` to send `HEP/SIP` requests and logs;\n- `HEP_CAPTURE_ID`: `HEP` capture id to be used when sending `HEP/SIP` requests and logs;\n\n## Networks\n\nBy default, this build was used and thinked for a local environment. But could be used for other purposes, should only be needed to changes the networks on `docker-compose` file and change the IP address on `.env` file.\n\nBut in this setup:\n\n- `common-network`: This is a external network used in common with `postgres` container. More details about how to create the network are described in: [postgres-kamailio-docker](https://github.com/bundasmanu/postgres-kamailio-docker);\n- `all_in_one`: Should point to the `docker` network used by `Homer` containers;\n\n### CoreDNS\n\nIf there is a need to test some logic that implies manage the cluster availability with DNS, we could setup CoreDNS, pointing to our Kamailios.\n\nExample with a local DNS pointing to two kamailios.\n\n```sh\n. {\n    hosts {\n        172.25.0.3 kamailio.cluster\n        172.25.0.4 kamailio.cluster\n        fallthrough\n    }\n    loadbalance\n    forward . 127.0.0.11\n}\n```\n\nSteps:\n\n1. CoreDNS container creation:\n\n    ```sh\n      docker run -d --name coredns \\\n        --network common-network \\\n        --ip 172.25.0.99 \\\n        -v $(pwd)/core_dns_file:/Corefile \\\n        coredns/coredns -conf /Corefile\n    ```\n\n2. Setup container to use it, on compose file:\n\n  ```yaml\n    cap_add:\n      - NET_ADMIN\n      - SYS_TIME\n      - SYS_NICE\n    dns:\n      - 172.25.0.99\n  ```\n\n## PostgreSQL\n\nAll details to handle PostgreSQL container are described in: [postgres-kamailio-docker](https://github.com/bundasmanu/postgres-kamailio-docker).\n\nIf needed, you can execute you custom `sql` scripts or execute more `kamailio sql scripts` to add more needed tables. But, the current implementation supports all the needed modules;\nAdapt only the values to be added on the tables;\n\nIn short:\n\n```sh\ngit clone https://github.com/bundasmanu/postgres-kamailio-docker\ndocker network create --opt com.docker.network.driver.mtu=9000 --subnet=172.25.0.0/24 common-network ## if not created\ndocker compose build kamailio\ndocker compose up -d\n```\n\n## Homer\n\nAt this phase, i advise to use `Homer 10`. By default, the created network will assume the name pointed in `docker-compose` file (`all-in-one_default`), but if the name is not the same please adjust;\n\nTo deploy `Homer 10`:\n\n```bash\ngit clone https://github.com/sipcapture/homer-docker.git\ncd all-in-one\ndocker-compose pull\ndocker-compose up -d\n```\n\nCheck ip address, where `heplify-server` is running, and update, the IP on the `env` var: `HEPLIFY_IP`.\n\n```sh\ndocker inspect heplify-server | grep IPAddress\n```\n\n## Build image\n\n```sh\ndocker compose build kamailio\n```\n\n## Run Kamailio\n\n```sh\ndocker compose run kamailio\n```\n\n### Run Multiple Instances\n\nWhen running multiple instances, you should change three  environment variables:\n\n- `LISTEN_IP`;\n- `LOG_FILE_NAME`;\n- `HEP_CAPTURE_ID`;\n\nAfter that, run container as usual:\n\n```sh\ndocker compose run kamailio\n```\n\n## Test Kamailio code\n\nThis command is useful when developing, we can easy troubleshoot problems;\n\n```sh\ndocker compose run kamailio test\n```\n\n## Sngrep for troubleshooting purposes\n\n```sh\ndocker exec -it \u003ccontainer_id\u003e sngrep\n```\n\n## kamcmd\n\n```sh\ndocker exec -it \u003ccontainer_id\u003e kamcmd \u003ccommand\u003e\ndocker exec -it kamailio kamcmd dispatcher.set_state ap 1 sip:172.25.0.10:5060\ndocker exec -it kamailio kamcmd dispatcher.set_state ap 2 sip:172.25.0.20:5060\n```\n\n## psql interface - inside container\n\n```sh\ndocker exec -it \u003ccontainer_id\u003e psql -h 172.25.0.2 -U postgres -d kamailio\n```\n\n## Workaround on OSX to allow receiveing UDP requests without restrictions in length\n\n```sh\nsudo sysctl -w net.inet.udp.maxdgram=9216\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbundasmanu%2Fkamailio-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbundasmanu%2Fkamailio-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbundasmanu%2Fkamailio-docker/lists"}