
Explore sip foundations and core protocols with camelio as a sip proxy and rtp media engine, secure with tls and srtp, and learn registrations, enum routing through docker labs.
Explore chameleon, an open source sip server based on the sip express router, enabling scalable real-time communications with a Kemi scripting layer for secure, extendable signaling.
Kamailio does not process media or RTP packets. It handles signaling and SIP invites, is not a back-to-back user agent, and requires a restart for config changes to take effect.
Learn SIP, a layer seven session initiation protocol that establishes, modifies, and tears down multimedia sessions like phone calls, video calls, and instant messages, defined by RFC 3261.
Explore the SIP message structure—start line, headers, blank line, and body—and how requests like invite, register, ack, cancel, and options establish, modify, or terminate sessions.
Explore how SIP responses inform the UAC of transaction state via a status line, SIP 2.0, and codes like 180 ringing, with headers and zero content length.
Explore SIP response codes from provisional 1xx to global 6xx, understand 100, 180/183 ringing, 200 ok, redirects, and client, server, and global failures.
Explore SIP header fields and their role in message routing and call setup. Learn about mandatory headers like from, call-id, max-forwards, and the request-uri.
Explore the session description protocol (sdp) used with sip, including the c line, m line, and a line, and learn how sdp defines transport, codecs, and one-way audio.
Installing Git
The first application you need to install is Git. If you are not familiar with Git, it is a version system that is used in development projects. Git can be used when doing solo development, or working in a team.
In this course we are going to use Git branches through this course.
Installation on Linux (debian-based) :
sudo apt-get install git-all
Installation on Mac or Windows:
Navigate to https://git-scm.com/. Download and install using the links
Install docker across Mac, Windows, and Linux with Docker Desktop or Docker Engine, set up the apt repository, install Docker Compose plugin, and verify with hello world.
Verify the main branch and learn to pull and checkout remote branches with git branch -a and git checkout -b <local> origin/<branch> to set up tracking.
Learn how to avoid using sudo on Linux by creating a Docker group, adding your user to it, and running Docker and Docker Compose without elevated privileges.
Sign up for a Docker Hub account and authenticate locally to resolve docker compose pull issues. Learn to run docker login to access the Camelio container on remote machines.
Navigate to the cloned project and ensure docker is running. Run docker compose up -d, then use docker ps to verify sdn grep and camellia edge containers.
Explore the Chameleon Kamailio config, navigate defined values, global parameters, and modules, then study routing logic with request, branch, reply, and failure routes.
Set up a test environment and make your first SIP call, inspecting the invite, from header, and tag, plus the 100 Trying. Explore SIP transactions, dialogs, and Kamailio configuration.
Troubleshoot sip call routing with Kamailio by analyzing invite flow, record-route and via headers, and understand loose routing vs strict routing and network bridging between internal and external.
Create an external back-to-back user agent, adjust docker-compose and camellia settings for auto answer with a 200 OK, then verify a successful sip call.
Learn to manipulate the request uri in Kamailio with pseudo variables, distinguishing between the full uri and the username portion, and set Alice in the sip message.
Learn how to add x headers to SIP traffic in Kamailio, specifically an x source IP header on outgoing invites, using route blocks and the append header function.
Refactor the chameleon cfg to improve readability and maintainable structure through separation of concerns; move from a single large file to modular files, despite added navigation complexity.
Refactor globals by creating globals.cfg, copying the global parameters, and using an include file directive to load it in the container, then reload camelio-edge.
Learn to refactor Kamailio modules by creating structured module cfg files, preserving load order with include directives, and testing changes via docker restarts and logs.
Refactor the main route by organizing routes into a routes folder, creating request_main.cfg, updating chameleon config with include statements, and committing changes in git.
Refactor your Kamailio routes by moving them into separate files (relay.cfg, req_init.cfg, dialogue, manage_branch.cfg, manage_reply.cfg, manage_failure.cfg), include them, and restart Kamailio via Docker, then commit changes.
Refactor the chameleon code to reduce config clutter and strengthen separation of concerns. Commit and push changes to a remote repo, then prepare for building a proxy or sbc function.
Explore flags in Kamailio, using per-transaction and per-branch flags in a 32-flag bit array to identify call origins and control routing with the set flag operator.
Define the outbound sip socket using chameleon flag logic and the force send socket function, then implement a set_socket route and test with docker camellia.
Learn to load and configure the db_mysql module in Kamailio, create a db_url from environment variables in globals.cfg, and expose docker compose variables for the Camelio read-write user and host.
Learn how record route headers shape SIP routing through a proxy, including via headers and route sets. See how removing record route affects ACK delivery and retransmissions.
Understand how the sip via header routes responses by showing proxies add and strip topmost via headers as requests traverse. Record-route headers route requests.
Dive into RTP troubleshooting for SIP routing by verifying record routing, configuring Camelio for signaling, and ensuring media is routed through an RTP proxy to resolve one-way audio.
Explore the RTP engine conf for Kamailio, build and run a custom Docker image, and review interfaces, ports, and user space versus kernel space considerations.
Configure RTP engine instances through a database for flexible multi-instance setups, using the RTP engine sql insert file and cam ctl db exec, then verify with cam ctl db connect.
Configure RTP engine module for Kamailio by creating its cfg, loading the module, sourcing the db url from environment variables, and using avp style variables original sdp and modified sdp.
Learn how to configure Kamailio RTP replies by mirroring the request logic, updating SDP and origin information, and handling HTTP responses to ensure reliable call teardown.
Welcome to "Learning SIP with Kamailio"! This comprehensive course is tailored for IT professionals with a minimum of 2 years of experience, who are adept with the Linux command line and possess fundamental knowledge of version control using GIT. If you're ready to embark on a journey into the intricate realm of Session Initiation Protocol (SIP) and Kamailio, you're in the right place.
Throughout this hands-on learning experience, you'll delve into the core principles of SIP, building a robust foundation for SIP and VoIP development. Kamailio, renowned for its versatility as a SIP proxy, will be our guiding tool as we navigate through the intricacies of SIP traffic management. From configuring Kamailio to seamlessly handle SIP requests to integrating RTP Engine for optimal media stream handling, you'll acquire practical skills essential for modern VoIP infrastructure.
One of the focal points of this course is security, and rightly so. In an age where cybersecurity threats loom large, it's imperative to fortify SIP communications against potential vulnerabilities. Through in-depth exploration, you'll learn how to implement Transport Layer Security (TLS) and Secure Real-time Transport Protocol (SRTP) to safeguard your SIP communications, ensuring privacy and integrity.
But that's not all. SIP registrations and ENUM routing are pivotal components of any SIP infrastructure. With expert guidance, you'll master the intricacies of SIP registrations, understanding how devices authenticate and maintain their presence on the network. Additionally, ENUM routing, a powerful mechanism for efficient call routing, will be thoroughly dissected, empowering you to optimize call delivery and enhance network efficiency.
Throughout the course, emphasis is placed on practical application. You'll roll up your sleeves and dive into real-world scenarios, deploying Docker containers to simulate SIP environments, and putting your newfound knowledge to the test. By the end of the journey, you won't just have scratched the surface; you'll have developed a solid foundation for SIP and VoIP development, equipped with the skills and confidence to tackle complex challenges head-on.
So, if you're ready to elevate your SIP expertise, join us on this enriching adventure. Let's unlock the potential of SIP with Kamailio together!