Asterisk VoIP News

Wednesday, June 15, 2005

Kevin Fleming: So, you want to be an Asterisk Developer?

Kevin Fleming discussed the task of becoming an Asterisk Developer:
Discussed Libraries Required

Debugging

-Easier to debug post-mortem

-Threading models differ by platform

-use make dont-optimize

-check makefiles for debugging defines

-ensure that 'debug' is listed for the console

-always use the -g parameter

-use 'thread apply all bt full' in gdb

-use 'ast_grab_core' (helpful for solving deadlocks)
Patches
-always run 'make update'

-use 'cvs diff -u' (or add 'diff -u' to your .cvsrc file)

-read the patch before submitting

-Watch for new/removed files

keeping out of tree patches up to date can be hard work

Licencing
-Asterisk, Zaptel and LibPRI are dual licenced (GPL and to Digium for commercial distribution)

-Contributions must be disclaimed

-Code can not violate patents etc

-If you make changes you are not required to distribute them

-You are not required to submit changes to Asterisk, although it is recommended

-If your code is committed it will be maintained by Asterisk crew

-The code you have is GPL forever

-The word Asterisk is trademarked

-Always disclaim your code

-You do not lose copyright on the code when you disclaim

Misc
-Prototypes are in module.h

-Use Use Count Tracking - needed for dynamically loadable modules

-usecount function is called by the loader

-Use the macros to implement basic usecount management

-Module has to tell Asterisk what they can do

-Application Modules are supposed to work on a channel that they are provided on

-Applications MUST keep use counts

-Channel modules are probably the most complicated part of Asterisk (allow connection to the outside world). Contains usecount again. Provide approx 25 methods that channels may provide

-Codec Modules are the means of converting from one format of audio to another. Quite simple. Many codecs keep internal state from one frame to another.

Format Modules - provide means to read and write audio formats in all of the formats Asterisk supports

Function Modules - look like variables. Currently only in CVS HEAD. They provide dialplan functions. Most of these are built into pbx_functions.so

CDR Modules - these provide CDR backends to post CDRs into storage systems (DB/txt etc)