From 6cd346ebe1988229d5266f5981c7cfc502d4ca70 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Sun, 1 May 2005 19:34:50 +0000 Subject: add some notes regarding the distinction between applications and functions git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5542 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- doc/CODING-GUIDELINES | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'doc/CODING-GUIDELINES') diff --git a/doc/CODING-GUIDELINES b/doc/CODING-GUIDELINES index b9fcfba1e..f4eb9a19b 100755 --- a/doc/CODING-GUIDELINES +++ b/doc/CODING-GUIDELINES @@ -4,7 +4,13 @@ To be accepted into the codebase, all non-trivial changes must be disclaimed to Digium or placed in the public domain. For more information see http://bugs.digium.com -Patches should be in the form of a unified (-u) diff. +Patches should be in the form of a unified (-u) diff, made from the directory +above the top-level Asterisk source directory. For example: + +- the base code you are working from is in ~/work/asterisk-base +- the changes are in ~/work/asterisk-new + +~/work$ diff -urN asterisk-base asterisk-new All code, filenames, function names and comments must be in ENGLISH. @@ -168,3 +174,21 @@ and then any parameters that the command needs. For example: not *CLI> show iax2 peer + +== New dialplan applications/functions == + +There are two methods of adding functionality to the Asterisk +dialplan: applications and functions. Applications (found generally in +the apps/ directory) should be collections of code that interact with +a channel and/or user in some significant way. Functions (which can be +provided by any type of module) are used when the provided +functionality is simple... getting/retrieving a value, for +example. Functions should also be used when the operation is in no way +related to a channel (a computation or string operation, for example). + +Applications are registered and invoked using the +ast_register_application function; see the apps/app_skel.c file for an +example. + +Functions are registered using 'struct ast_custom_function_obj' +structures and the ast_custom_function_register function. -- cgit v1.2.3