-
Notifications
You must be signed in to change notification settings - Fork 2
Architecture
GABPBX follows the classic Asterisk modular architecture: a small core loads channel drivers, dialplan applications, dialplan functions, media translators, file formats, resources, CDR/CEL backends and PBX engines.
The system is designed around runtime-loadable modules. Most behavior is added
by .so modules built from the source directories under the project root.
Core engine:
-
main/gabpbx.cstarts the process and runtime. -
main/loader.cloads and unloads modules. -
main/channel.cowns channel allocation, state and core channel behavior. -
main/pbx.cexecutes dialplan logic. -
main/bridging.cprovides bridge behavior for connected channels. -
main/rtp_engine.cabstracts RTP engines and payload mappings. -
main/manager.cimplements AMI. -
main/cli.cimplements the console CLI. -
main/config.cparses configuration files. -
main/logger.chandles logs and verbose output. -
main/sched.cprovides scheduling. -
main/taskprocessor.cprovides queued task execution. -
main/devicestate.candmain/event.cprovide device and event state.
Module families:
-
channels/- channel drivers and signaling/media endpoints. -
apps/- dialplan applications. -
funcs/- dialplan functions. -
res/- shared resources and service modules. -
codecs/- audio translators. -
formats/- file format handlers. -
cdr/- Call Detail Record backends. -
cel/- Channel Event Logging backends. -
pbx/- PBX/dialplan engines. -
bridges/- bridge technologies. -
addons/- optional or legacy add-on modules.
Configuration:
-
configs/*.conf.samplecontains sample runtime configuration. -
menuselectcontrols which modules are selected for build. -
modules.confcontrols which modules load at runtime.
A normal SIP call through chan_sofia follows this high-level path:
- Sofia-SIP receives SIP signaling.
-
chan_sofiamaps SIP state into a GABPBX channel. - The core PBX sends the channel into a dialplan context.
- Dialplan applications execute, commonly
Dial(). - The target channel is allocated by its channel driver.
- The bridge layer joins the channels.
- RTP media is negotiated through the RTP engine.
- CDR/CEL modules record the call lifecycle.
This is the same broad architecture as Asterisk, with GABPBX-specific work
focused heavily on chan_sofia, realtime operation, media support and
production behavior.
Modules are normally built as .so files and installed into the GABPBX module
directory. Runtime loading is controlled by:
/etc/gabpbx/modules.conf
Use:
*CLI> module show
*CLI> module show like sofia
*CLI> module load chan_sofia.so
*CLI> module unload <module>.so
Some modules are not safe or useful to unload after active use. SIP channel driver switching should be done with a full GABPBX restart.
Realtime allows configuration data to be stored outside flat files, commonly in PostgreSQL, ODBC, SQLite or other backends.
Important pieces:
-
res/res_realtime.c- realtime data lookup/rewrite. -
res/res_config_pgsql.c- PostgreSQL realtime configuration driver. -
res/res_config_odbc.c- ODBC realtime configuration driver. -
res/res_config_sqlite3.c- SQLite realtime configuration driver. -
funcs/func_realtime.c- dialplan read/write/store/destroy access. -
configs/extconfig.conf.sample- maps realtime families to backends.
For chan_sofia, the important families are:
sippeers
sipregs
sippeers stores peer configuration. sipregs can optionally store
registration state separately.
Media is split into several layers:
- Channel driver SDP/signaling logic.
- RTP engine and RTP instance handling.
- Codec translators.
- File format modules.
- DSP helpers for DTMF, fax/tone detection and audio processing.
- SRTP and UDPTL resources where required.
Important files:
main/rtp_engine.c
res/res_rtp_gabpbx.c
res/res_srtp.c
main/dsp.c
main/udptl.c
codecs/codec_opus.c
channels/chan_sofia.c
When documenting or modifying behavior, read the source first. Many modules preserve compatibility with Asterisk behavior, while selected GABPBX modules extend or deliberately improve that behavior.
SIP — chan_sofia
Subsystems
Realtime & data
Operations