[asterisk-users] How to write a function with a return value in Asterisk

James FitzGibbon james.fitzgibbon at gmail.com
Wed Aug 8 11:30:38 CDT 2007


On 8/8/07, Mike <list at virtutel.ca> wrote:
>
> I'd be most thankful for some link to a page that shows how to write such
> a
> function in Asterisk.


There is a test application in the source tree (not built by default I
believe), but it doesn't look like anyone has made an equivalent sample
function.

However, many of the functions in 1.4 are pretty simple, and would be a good
jumping off point.  Take func_sha1.c for example: 83 lines in the file, 4
functions and one macro.  You could copy that and do the proper renaming to
make MY_FUNKY_NEW_FUNC that does exactly what func_sha1 does (or
alternatively, nothing by getting rid of the bulk of the sha1() function
therein.

How big it gets as you add whatever magic that function should perform is up
to you of course.

-- 
j.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070808/06c588b3/attachment.htm 


More information about the asterisk-users mailing list