[asterisk-doc] How to write new application for Asterisk by using C

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Thu Jul 20 06:21:22 MST 2006


On Thursday 20 July 2006 01:38, Thabang Kevin Khanye wrote:
> Ok, thats touching.. Regarding the application that links to
> asterisk, I was forwarded to asterisk.org/doxygen, app_skel.c, look
> there. After you've figured out what that diagram means, please
> disect it and give us the summarised version.

The diagram is just a dependency graph.  Myself, I usually just look
at the source code.

Would it be helpful for you to know that when I code a new
application, I copy an existing application and modify it?  And I'm
one of the more prolific application authors.  Probably one of the
simplest applications that actually does something is app_sayunixtime.
This is because the vast majority of the code that I wrote for it got
added to say.c because it would be useful elsewhere.  So all of the
code in app_sayunixtime.c is just parsing arguments and calling a
common API.

app_skel shows you how to parse more complex application arguments,
such as options that themselves take an argument, e.g. M(foo).  You
may or may not need them, but having the simplest case for parsing
them is probably helpful.

-- 
Tilghman


More information about the asterisk-doc mailing list