mod_example
has been written to be, huh, an example, so I tried to stuff in it many useful features, in the simplest way. You can use it as a base, adding and subtracting features:
mod_example.c
code layout:
Declarations:
The module's mandatory three functions (
example_load
,example_runtime
,example_shutdown
)Module definition
A data structure (
globals
) we'll use to keep state and configurationThe function (
example_on_state_change
) we'll execute when channel state changesThe table (
example_state_handler
) describing which function to execute at which state change
Implementations:
The function (
example_on_state_change
) we'll execute when channel state changesThe function (
do_config
) we use to read values fromconfig
file and initialize theglobals
data structureThe function (
example_api
) we use to implement an API commandThe function (
example_event_handler
) we use to implement reactions to eventsThe function (
example_app
) we use to implement a dialplan applicationModules' mandatory...