How drachtio/drachtio-server works
drachtio-server is a SIP signaling engine controlled by JavaScript applications over an authenticated TCP/TLS admin connection. Its central workflow is to receive SIP traffic, select an application or routing action, exchange SIP requests and responses, and maintain transaction and dialog state. It also supports SIP proxying, configurable transports, logging, Homer capture, Prometheus metrics, and optional HTTP routing. The graph reflects README capabilities and the supplied source excerpts; wiring for unsampled subsystems is shown only where documented, and some internal control-flow links are omitted where excerpts do not establish them.
Main entry points: controller.cpp Server Controller · client-controller.cpp Client Connections · pending-request-controller.cpp Pending Requests · sip-dialog-controller.cpp Dialog Control
Components 20
Runtime and Configuration
- drachtio Server
src/main.cpp - Configuration
src/drachtio-config.cpp - Server Controller
src/controller.cpp
SIP Processing
- SIP Transports
src/sip-transports.cpp - Request Handling
src/request-handler.cpp - Request Router
src/request-router.cpp - Pending Requests
src/pending-request-controller.cpp - SIP Proxy
src/sip-proxy-controller.cpp - Dialog Control
src/sip-dialog-controller.cpp - Dialog State
src/sip-dialog.cpp - SIP Timers
src/timer-queue-manager.cpp
Application Control
- Client Connections
src/client-controller.cpp - Client Protocol
src/client.cpp
Monitoring and Operations
- Metrics Collection
src/stats-collector.cpp - Blacklist
src/blacklist.cpp - Call Records
src/cdr.cpp
Other components
- JavaScript App
- SIP Peer
- Homer
- Prometheus
Connections 23
- JavaScript App → Client Connections: connects
- Client Connections → Client Protocol: creates sessions
- Client Protocol → Client Connections: sends messages
- Client Connections → JavaScript App: dispatches SIP
- SIP Peer → SIP Transports: sends SIP
- SIP Transports → Server Controller: delivers traffic
- Server Controller → Pending Requests: tracks requests
- Pending Requests → Client Connections: routes requests
- Server Controller → Request Router: selects routing
- Request Router → Request Handling: requests HTTP route
- Server Controller → SIP Proxy: starts proxying
- Server Controller → Dialog Control: handles dialog traffic
- Dialog Control → Dialog State: updates state
- Dialog Control → Client Connections: dispatches SIP
- SIP Proxy → SIP Timers: schedules timers
- Pending Requests → SIP Timers: schedules expiry
- drachtio Server → Configuration: loads settings
- Configuration → Server Controller: configures runtime
- Server Controller → Metrics Collection: collects metrics
- Metrics Collection → Prometheus: exposes metrics
- Server Controller → Homer: sends SIP capture
- Server Controller → Blacklist: checks policy
- Server Controller → Call Records: records calls