[Asterisk-cvs] asterisk ChangeLog, 1.120, 1.121 Makefile, 1.223, 1.224 app.c, 1.85, 1.86 asterisk.c, 1.195, 1.196 callerid.c, 1.38, 1.39 cdr.c, 1.58, 1.59 frame.c, 1.69, 1.70 fskmodem.c, 1.10, 1.11 jitterbuf.c, 1.21, 1.22 manager.c, 1.133, 1.134 muted.c, 1.13, 1.14 pbx.c, 1.302, 1.303 say.c, 1.74, 1.75 translate.c, 1.44, 1.45 ulaw.c, 1.7, 1.8

russell russell
Mon Nov 14 14:10:29 CST 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv19926

Modified Files:
	ChangeLog Makefile app.c asterisk.c callerid.c cdr.c frame.c 
	fskmodem.c jitterbuf.c manager.c muted.c pbx.c say.c 
	translate.c ulaw.c 
Log Message:
finish merging doxygen updates from issue #5605


Index: ChangeLog
===================================================================
RCS file: /usr/cvsroot/asterisk/ChangeLog,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -d -r1.120 -r1.121
--- ChangeLog	14 Nov 2005 10:24:58 -0000	1.120
+++ ChangeLog	14 Nov 2005 19:00:37 -0000	1.121
@@ -1,5 +1,7 @@
 2005-11-14  Russell Bryant  <russell at digium.com>
 
+	* many files: Merge doxygen documentation updates. (issue #5605)
+
 	* apps/app_dial.c: Fix typo in RetryDial description.
 
 2005-11-12  Russell Bryant  <russell at digium.com>

Index: Makefile
===================================================================
RCS file: /usr/cvsroot/asterisk/Makefile,v
retrieving revision 1.223
retrieving revision 1.224
diff -u -d -r1.223 -r1.224
--- Makefile	8 Nov 2005 03:31:45 -0000	1.223
+++ Makefile	14 Nov 2005 19:00:37 -0000	1.224
@@ -392,6 +392,13 @@
   CFLAGS+=$(ASTCFLAGS)
 endif
 
+# This is used when generating the doxygen documentation
+ifneq ($(wildcard /usr/local/bin/dot)$(wildcard /usr/bin/dot),)
+  HAVEDOT=yes
+else
+  HAVEDOT=no
+endif
+
 LIBS+=-lssl
 
 INSTALL=install
@@ -826,7 +833,8 @@
 	rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
 
 progdocs:
-	doxygen contrib/asterisk-ng-doxygen
+	(cat contrib/asterisk-ng-doxygen; echo "HAVE_DOT=$(HAVEDOT) \
+	PROJECT_NUMBER=$(ASTERISKVERSION)  -  $(ASTERISKVERSIONNUM)") | doxygen - 
 
 mpg123:
 	@wget -V >/dev/null || (echo "You need wget" ; false )

Index: app.c
===================================================================
RCS file: /usr/cvsroot/asterisk/app.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- app.c	11 Nov 2005 01:01:19 -0000	1.85
+++ app.c	14 Nov 2005 19:00:37 -0000	1.86
@@ -52,11 +52,12 @@
 #define MAX_OTHER_FORMATS 10
 
 
-/* 
+/* !
 This function presents a dialtone and reads an extension into 'collect' 
 which must be a pointer to a **pre-initilized** array of char having a 
 size of 'size' suitable for writing to.  It will collect no more than the smaller 
 of 'maxlen' or 'size' minus the original strlen() of collect digits.
+\return 0 if extension does not exist, 1 if extension exists
 */
 int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect, size_t size, int maxlen, int timeout) 
 {
@@ -103,7 +104,7 @@
 
 
 
-/* set timeout to 0 for "standard" timeouts. Set timeout to -1 for 
+/*! \param timeout set timeout to 0 for "standard" timeouts. Set timeout to -1 for 
    "ludicrous time" (essentially never times out) */
 int ast_app_getdata(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout)
 {

Index: asterisk.c
===================================================================
RCS file: /usr/cvsroot/asterisk/asterisk.c,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -d -r1.195 -r1.196
--- asterisk.c	8 Nov 2005 04:13:18 -0000	1.195
+++ asterisk.c	14 Nov 2005 19:00:38 -0000	1.196
@@ -21,6 +21,10 @@
 /*!
  * \mainpage Asterisk -- An Open Source Telephony Toolkit
  *
+ * \par Developer Documentation for Asterisk
+ * This is the main developer documentation for Asterisk. It is 
+ * generated by running "make progdocs".
+ * \par Additional documentation
  * \arg \ref DevDoc 
  * \arg \ref ConfigFiles
  *
@@ -121,32 +125,42 @@
 #define AST_MAX_CONNECTS 128
 #define NUM_MSGS 64
 
+/*! \brief Welcome message when starting a CLI interface */
 #define WELCOME_MESSAGE ast_verbose( "Asterisk " ASTERISK_VERSION ", Copyright (C) 1999 - 2005 Digium.\n"); \
 		ast_verbose( "Written by Mark Spencer <markster at digium.com>\n"); \
 		ast_verbose( "=========================================================================\n")
 
-int option_verbose=0;
-int option_debug=0;
-int option_exec_includes=0;
-int option_nofork=0;
-int option_quiet=0;
-int option_console=0;
-int option_highpriority=0;
-int option_remote=0;
-int option_exec=0;
-int option_initcrypto=0;
-int option_nocolor;
-int option_dumpcore = 0;
-int option_cache_record_files = 0;
-int option_timestamp = 0;
-int option_overrideconfig = 0;
-int option_reconnect = 0;
-int option_transcode_slin = 1;
-int option_transmit_silence_during_record = 0;
-int option_maxcalls = 0;
-double option_maxload = 0.0;
-int option_dontwarn = 0;
-int option_priority_jumping = 1;
+/*! \defgroup main_options 
+ \brief Main configuration options from \ref Config_ast "asterisk.conf" or 
+  the operating system command line when starting Asterisk 
+  Some of them can be changed in the CLI 
+ */
+/*! @{ */
+int option_verbose=0;			/*!< Verbosity level */
+int option_debug=0;			/*!< Debug level */
+int option_exec_includes=0;		/*!< Allow \#exec in config files? */
+int option_nofork=0;			/*!< Do not fork */
+int option_quiet=0;			/*!< Keep quiet */
+int option_console=0;			/*!< Console mode, no background */
+int option_highpriority=0;		/*!< Run in realtime Linux priority */
+int option_remote=0;			/*!< Remote CLI */
+int option_exec=0;			/*!< */
+int option_initcrypto=0;		/*!< Initialize crypto keys for RSA auth */
+int option_nocolor;			/*!< Don't use termcap colors */
+int option_dumpcore = 0;			/*!< Dump core when failing */
+int option_cache_record_files = 0;		/*!< Cache sound files */
+int option_timestamp = 0;			/*!< Timestamp in logging */
+int option_overrideconfig = 0;			/*!< */
+int option_reconnect = 0;			/*!< */
+int option_transcode_slin = 1;			/*!< */
+int option_maxcalls = 0;			/*!< */
+double option_maxload = 0.0;			/*!< Max load avg on system */
+int option_dontwarn = 0;			/*!< */
+int option_priority_jumping = 1;		/*!< Enable priority jumping as result value for apps */
+int option_transmit_silence_during_record = 0;	/*!< Transmit silence during record() app */
+
+/*! @} */
+
 int fully_booted = 0;
 char record_cache_dir[AST_CACHE_DIR_LEN] = AST_TMP_DIR;
 char debug_filename[AST_FILENAME_MAX] = "";

Index: callerid.c
===================================================================
RCS file: /usr/cvsroot/asterisk/callerid.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- callerid.c	26 Oct 2005 18:54:24 -0000	1.38
+++ callerid.c	14 Nov 2005 19:00:38 -0000	1.39
@@ -64,12 +64,14 @@
 float sasdr, sasdi;
 float casdr1, casdi1, casdr2, casdi2;
 
-#define CALLERID_SPACE	2200.0		/* 2200 hz for "0" */
-#define CALLERID_MARK	1200.0		/* 1200 hz for "1" */
+#define CALLERID_SPACE	2200.0		/*!< 2200 hz for "0" */
+#define CALLERID_MARK	1200.0		/*!< 1200 hz for "1" */
 #define SAS_FREQ		 440.0
 #define CAS_FREQ1		2130.0
 #define CAS_FREQ2		2750.0
 
+#define AST_CALLERID_UNKNOWN	"<unknown>"
+
 static inline void gen_tones(unsigned char *buf, int len, int codec, float ddr1, float ddi1, float ddr2, float ddi2, float *cr1, float *ci1, float *cr2, float *ci2)
 {
 	int x;
@@ -107,9 +109,9 @@
 	}
 }
 
+/*! \brief Initialize stuff for inverse FFT */
 void callerid_init(void)
 {
-	/* Initialize stuff for inverse FFT */
 	cid_dr[0] = cos(CALLERID_SPACE * 2.0 * M_PI / 8000.0);
 	cid_di[0] = sin(CALLERID_SPACE * 2.0 * M_PI / 8000.0);
 	cid_dr[1] = cos(CALLERID_MARK * 2.0 * M_PI / 8000.0);
@@ -614,6 +616,10 @@
 	n[y] = '\0';
 }
 
+/*! \brief checks if string consists only of digits and * \# and + 
+	\return 1 if string is valid AST phone number
+	\return 0 if not
+*/
 int ast_isphonenumber(char *n)
 {
 	int x;
@@ -625,6 +631,9 @@
 	return 1;
 }
 
+/*! \brief parse string for caller id information 
+	\return returns -1 on failure, otherwise 0
+*/
 int ast_callerid_parse(char *instr, char **name, char **location)
 {
 	char *ns, *ne;
@@ -705,6 +714,7 @@
 		ast_copy_string(buf, unknown, bufsiz);
 	return buf;
 }
+
 int ast_callerid_split(const char *buf, char *name, int namelen, char *num, int numlen)
 {
 	char *tmp;
@@ -744,6 +754,11 @@
 	{  AST_PRES_NUMBER_NOT_AVAILABLE, "unavailable", "Number Unavailable"},
 };
 
+/*! \brief Convert caller ID text code to value 
+	used in config file parsing
+	\param data text string
+	\return value AST_PRES_ from callerid.h 
+*/
 int ast_parse_caller_presentation(const char *data)
 {
 	int i;
@@ -756,6 +771,10 @@
 	return -1;
 }
 
+/*! \brief Convert caller ID pres value to explanatory string 
+	\param data value (see callerid.h AST_PRES_ ) 
+	\return string for human presentation
+*/
 const char *ast_describe_caller_presentation(int data)
 {
 	int i;

Index: cdr.c
===================================================================
RCS file: /usr/cvsroot/asterisk/cdr.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- cdr.c	6 Nov 2005 21:00:34 -0000	1.58
+++ cdr.c	14 Nov 2005 19:00:38 -0000	1.59
@@ -22,8 +22,13 @@
  * 
  * Includes code and algorithms from the Zapata library.
  *
+ * \note We do a lot of checking here in the CDR code to try to be sure we don't ever let a CDR slip
+ * through our fingers somehow.  If someone allocates a CDR, it must be completely handled normally
+ * or a WARNING shall be logged, so that we can best keep track of any escape condition where the CDR
+ * isn't properly generated and posted.
  */
 
+
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
@@ -48,6 +53,7 @@
 #include "asterisk/cli.h"
 #include "asterisk/module.h"
 
+/*! Default AMA flag for billing records (CDR's) */
 int ast_default_amaflags = AST_CDR_DOCUMENTATION;
 char ast_default_accountcode[AST_MAX_ACCOUNT_CODE] = "";
 
@@ -93,13 +99,10 @@
 AST_MUTEX_DEFINE_STATIC(cdr_pending_lock);
 static ast_cond_t cdr_pending_cond;
 
-/*
- * We do a lot of checking here in the CDR code to try to be sure we don't ever let a CDR slip
- * through our fingers somehow.  If someone allocates a CDR, it must be completely handled normally
- * or a WARNING shall be logged, so that we can best keep track of any escape condition where the CDR
- * isn't properly generated and posted.
- */
 
+/*! Register a CDR driver. Each registered CDR driver generates a CDR 
+	\return 0 on success, -1 on failure 
+*/
 int ast_cdr_register(char *name, char *desc, ast_cdrbe be)
 {
 	struct ast_cdr_beitem *i;
@@ -139,6 +142,7 @@
 	return 0;
 }
 
+/*! unregister a CDR driver */
 void ast_cdr_unregister(char *name)
 {
 	struct ast_cdr_beitem *i = NULL;
@@ -157,6 +161,9 @@
 	AST_LIST_UNLOCK(&be_list);
 }
 
+/*! Duplicate a CDR record 
+	\returns Pointer to new CDR record
+*/
 struct ast_cdr *ast_cdr_dup(struct ast_cdr *cdr) 
 {
 	struct ast_cdr *newcdr;
@@ -197,6 +204,7 @@
 	return NULL;
 }
 
+/*! CDR channel variable retrieval */
 void ast_cdr_getvar(struct ast_cdr *cdr, const char *name, char **ret, char *workspace, int workspacelen, int recur) 
 {
 	struct tm tm;
@@ -263,6 +271,9 @@
 		*ret = workspace;
 }
 
+/*! Set a CDR channel variable 
+	\note You can't set the CDR variables that belong to the actual CDR record, like "billsec".
+*/
 int ast_cdr_setvar(struct ast_cdr *cdr, const char *name, const char *value, int recur) 
 {
 	struct ast_var_t *newvariable;
@@ -670,6 +681,7 @@
 	return "UNKNOWN";
 }
 
+/*! Converts AMA flag to printable string */
 char *ast_cdr_flags2str(int flag)
 {
 	switch(flag) {
@@ -865,7 +877,7 @@
 	return ret;
 }
 
-/* Don't call without cdr_batch_lock */
+/*! \note Don't call without cdr_batch_lock */
 static void reset_batch(void)
 {
 	batch->size = 0;
@@ -873,7 +885,7 @@
 	batch->tail = NULL;
 }
 
-/* Don't call without cdr_batch_lock */
+/*! \note Don't call without cdr_batch_lock */
 static int init_batch(void)
 {
 	/* This is the single meta-batch used to keep track of all CDRs during the entire life of the program */
@@ -1241,7 +1253,7 @@
 	return res;
 }
 
-/* This actually gets called a couple of times at shutdown.  Once, before we start
+/* \note This actually gets called a couple of times at shutdown.  Once, before we start
    hanging up channels, and then again, after the channel hangup timeout expires */
 void ast_cdr_engine_term(void)
 {

Index: frame.c
===================================================================
RCS file: /usr/cvsroot/asterisk/frame.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- frame.c	31 Oct 2005 18:15:02 -0000	1.69
+++ frame.c	14 Nov 2005 19:00:38 -0000	1.70
@@ -56,10 +56,10 @@
 #define TYPE_MASK	 0x3
 
 struct ast_format_list {
-	int visible; /* Can we see this entry */
-	int bits; /* bitmask value */
-	char *name; /* short name */
-	char *desc; /* Description */
+	int visible;	/*!< Can we see this entry */
+	int bits;	/*!< bitmask value */
+	char *name;	/*!< short name */
+	char *desc;	/*!< Description */
 };
 
 struct ast_smoother {
@@ -77,6 +77,36 @@
 	int len;
 };
 
+/*! \brief Definition of supported media formats (codecs) */
+static struct ast_format_list AST_FORMAT_LIST[] = {
+	{ 1, AST_FORMAT_G723_1 , "g723" , "G.723.1"},	/*!< codec_g723_1.c */
+	{ 1, AST_FORMAT_GSM, "gsm" , "GSM"},		/*!< codec_gsm.c */
+	{ 1, AST_FORMAT_ULAW, "ulaw", "G.711 u-law" },	/*!< codec_ulaw.c */
+	{ 1, AST_FORMAT_ALAW, "alaw", "G.711 A-law" },	/*!< codec_alaw.c */
+	{ 1, AST_FORMAT_G726, "g726", "G.726" },	/*!< codec_g726.c */
+	{ 1, AST_FORMAT_ADPCM, "adpcm" , "ADPCM"},	/*!< codec_adpcm.c */
+	{ 1, AST_FORMAT_SLINEAR, "slin",  "16 bit Signed Linear PCM"},	/*!<  */
+	{ 1, AST_FORMAT_LPC10, "lpc10", "LPC10" },	/*!< codec_lpc10.c */
+	{ 1, AST_FORMAT_G729A, "g729", "G.729A" },	/*!< Binary commercial distribution */
+	{ 1, AST_FORMAT_SPEEX, "speex", "SpeeX" },	/*!< codec_speex.c */
+	{ 1, AST_FORMAT_ILBC, "ilbc", "iLBC"},	/*!< codec_ilbc.c */
+	{ 0, 0, "nothing", "undefined" },
+	{ 0, 0, "nothing", "undefined" },
+	{ 0, 0, "nothing", "undefined" },
+	{ 0, 0, "nothing", "undefined" },
+	{ 0, AST_FORMAT_MAX_AUDIO, "maxaudio", "Maximum audio format" },
+	{ 1, AST_FORMAT_JPEG, "jpeg", "JPEG image"},	/*!< See format_jpeg.c */
+	{ 1, AST_FORMAT_PNG, "png", "PNG image"},	/*!< Image format */
+	{ 1, AST_FORMAT_H261, "h261", "H.261 Video" },	/*!< Passthrough */
+	{ 1, AST_FORMAT_H263, "h263", "H.263 Video" },	/*!< Passthrough support, see format_h263.c */
+	{ 1, AST_FORMAT_H263_PLUS, "h263p", "H.263+ Video" },	/*!< See format_h263.c */
+	{ 0, 0, "nothing", "undefined" },
+	{ 0, 0, "nothing", "undefined" },
+	{ 0, 0, "nothing", "undefined" },
+	{ 0, 0, "nothing", "undefined" },
+	{ 0, AST_FORMAT_MAX_VIDEO, "maxvideo", "Maximum video format" },
+};
+
 void ast_smoother_reset(struct ast_smoother *s, int size)
 {
 	memset(s, 0, sizeof(struct ast_smoother));
@@ -236,11 +266,10 @@
 	return f;
 }
 
-/*
- * Important: I should be made more efficient.  Frame headers should
+/*!
+ * \todo Important: I should be made more efficient.  Frame headers should
  * most definitely be cached
  */
-
 void ast_frfree(struct ast_frame *fr)
 {
 	if (fr->mallocd & AST_MALLOCD_DATA) {
@@ -267,8 +296,8 @@
 	}
 }
 
-/*
- * 'isolates' a frame by duplicating non-malloc'ed components
+/*!
+ * \brief 'isolates' a frame by duplicating non-malloc'ed components
  * (header, src, data).
  * On return all components are malloc'ed
  */
@@ -449,34 +478,6 @@
 		dst_s[i] = (src_s[i]<<8) | (src_s[i]>>8);
 }
 
-static struct ast_format_list AST_FORMAT_LIST[] = {
-	{ 1, AST_FORMAT_G723_1 , "g723" , "G.723.1"},
-	{ 1, AST_FORMAT_GSM, "gsm" , "GSM"},
-	{ 1, AST_FORMAT_ULAW, "ulaw", "G.711 u-law" },
-	{ 1, AST_FORMAT_ALAW, "alaw", "G.711 A-law" },
-	{ 1, AST_FORMAT_G726, "g726", "G.726" },
-	{ 1, AST_FORMAT_ADPCM, "adpcm" , "ADPCM"},
-	{ 1, AST_FORMAT_SLINEAR, "slin",  "16 bit Signed Linear PCM"},
-	{ 1, AST_FORMAT_LPC10, "lpc10", "LPC10" },
-	{ 1, AST_FORMAT_G729A, "g729", "G.729A" },
-	{ 1, AST_FORMAT_SPEEX, "speex", "SpeeX" },
-	{ 1, AST_FORMAT_ILBC, "ilbc", "iLBC"},
-	{ 0, 0, "nothing", "undefined" },
-	{ 0, 0, "nothing", "undefined" },
-	{ 0, 0, "nothing", "undefined" },
-	{ 0, 0, "nothing", "undefined" },
-	{ 0, AST_FORMAT_MAX_AUDIO, "maxaudio", "Maximum audio format" },
-	{ 1, AST_FORMAT_JPEG, "jpeg", "JPEG image"},
-	{ 1, AST_FORMAT_PNG, "png", "PNG image"},
-	{ 1, AST_FORMAT_H261, "h261", "H.261 Video" },
-	{ 1, AST_FORMAT_H263, "h263", "H.263 Video" },
-	{ 1, AST_FORMAT_H263_PLUS, "h263p", "H.263+ Video" },
-	{ 0, 0, "nothing", "undefined" },
-	{ 0, 0, "nothing", "undefined" },
-	{ 0, 0, "nothing", "undefined" },
-	{ 0, 0, "nothing", "undefined" },
-	{ 0, AST_FORMAT_MAX_VIDEO, "maxvideo", "Maximum video format" },
-};
 
 struct ast_format_list *ast_get_format_list_index(int index) 
 {
@@ -652,6 +653,7 @@
 "Usage: show codec <number>\n"
 "       Displays codec mapping\n";
 
+/*! Dump a frame for debugging purposes */
 void ast_frame_dump(char *name, struct ast_frame *f, char *prefix)
 {
 	char *n = "unknown";
@@ -835,7 +837,7 @@
 "       Displays debugging statistics from framer\n";
 #endif
 
-/* XXX no unregister function here ??? */
+/* Builtin Asterisk CLI-commands for debugging */
 static struct ast_cli_entry my_clis[] = {
 { { "show", "codecs", NULL }, show_codecs, "Shows codecs", frame_show_codecs_usage },
 { { "show", "audio", "codecs", NULL }, show_codecs, "Shows audio codecs", frame_show_codecs_usage },
@@ -923,7 +925,7 @@
 	return slot ? AST_FORMAT_LIST[slot-1].bits : 0;
 }
 
-/*--- ast_codec_pref_remove: Remove codec from pref list ---*/
+/*! \brief ast_codec_pref_remove: Remove codec from pref list ---*/
 void ast_codec_pref_remove(struct ast_codec_pref *pref, int format)
 {
 	struct ast_codec_pref oldorder;
@@ -949,7 +951,7 @@
 	
 }
 
-/*--- ast_codec_pref_append: Append codec to list ---*/
+/*! \brief ast_codec_pref_append: Append codec to list ---*/
 int ast_codec_pref_append(struct ast_codec_pref *pref, int format)
 {
 	size_t size = 0;
@@ -978,7 +980,7 @@
 }
 
 
-/*--- sip_codec_choose: Pick a codec ---*/
+/*! \brief ast_codec_choose: Pick a codec ---*/
 int ast_codec_choose(struct ast_codec_pref *pref, int formats, int find_best)
 {
 	size_t size = 0;

Index: fskmodem.c
===================================================================
RCS file: /usr/cvsroot/asterisk/fskmodem.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- fskmodem.c	24 Oct 2005 20:12:05 -0000	1.10
+++ fskmodem.c	14 Nov 2005 19:00:38 -0000	1.11
@@ -74,7 +74,7 @@
 };
 
 
-/* Filtro pasa-banda para frecuencia de MARCA */
+/*! Filtro pasa-banda para frecuencia de MARCA */
 static inline float filtroM(fsk_data *fskd,float in)
 {
 	int i,j;
@@ -91,7 +91,7 @@
 	return s;
 }
 
-/* Filtro pasa-banda para frecuencia de ESPACIO */
+/*! Filtro pasa-banda para frecuencia de ESPACIO */
 static inline float filtroS(fsk_data *fskd,float in)
 {
 	int i,j;
@@ -108,7 +108,7 @@
 	return s;
 }
 
-/* Filtro pasa-bajos para datos demodulados */
+/*! Filtro pasa-bajos para datos demodulados */
 static inline float filtroL(fsk_data *fskd,float in)
 {
 	int i,j;

Index: jitterbuf.c
===================================================================
RCS file: /usr/cvsroot/asterisk/jitterbuf.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- jitterbuf.c	24 Oct 2005 20:12:05 -0000	1.21
+++ jitterbuf.c	14 Nov 2005 19:00:38 -0000	1.22
@@ -22,6 +22,7 @@
 /*! \file
  *
  * \brief jitterbuf: an application-independent jitterbuffer
+ * \author Steve Kann <stevek at stevek.com>
  *
  */
 
@@ -35,7 +36,7 @@
 
 #include "jitterbuf.h"
 
-/* define these here, just for ancient compiler systems */
+/*! define these here, just for ancient compiler systems */
 #define JB_LONGMAX 2147483647L
 #define JB_LONGMIN (-JB_LONGMAX - 1L)
 
@@ -114,10 +115,6 @@
 
 
 
-/* simple history manipulation */
-/* maybe later we can make the history buckets variable size, or something? */
-/* drop parameter determines whether we will drop outliers to minimize
- * delay */
 #if 0
 static int longcmp(const void *a, const void *b) 
 {
@@ -125,6 +122,10 @@
 }
 #endif
 
+/*!	\brief simple history manipulation 
+ 	\note maybe later we can make the history buckets variable size, or something? */
+/* drop parameter determines whether we will drop outliers to minimize
+ * delay */
 static int history_put(jitterbuf *jb, long ts, long now, long ms) 
 {
 	long delay = now - (ts - jb->info.resync_offset);

Index: manager.c
===================================================================
RCS file: /usr/cvsroot/asterisk/manager.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -d -r1.133 -r1.134
--- manager.c	8 Nov 2005 03:35:40 -0000	1.133
+++ manager.c	14 Nov 2005 19:00:38 -0000	1.134
@@ -25,6 +25,11 @@
  * \ref amiconf
  */
 
+/*! \addtogroup Group_AMI AMI functions 
+*/
+/*! @{ 
+ Doxygen group */
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -569,6 +574,7 @@
 	return -1;
 }
 
+/*! \brief PING: Manager PING */
 static char mandescr_ping[] = 
 "Description: A 'Ping' action will ellicit a 'Pong' response.  Used to keep the "
 "  manager connection open.\n"
@@ -1084,6 +1090,8 @@
 	return 0;
 }
 
+/*! 	\brief Help text for manager command mailboxstatus
+ */
 static char mandescr_mailboxstatus[] = 
 "Description: Checks a voicemail account for status.\n"
 "Variables: (Names marked with * are required)\n"
@@ -1094,6 +1102,7 @@
 "	Mailbox: <mailboxid>\n"
 "	Waiting: <count>\n"
 "\n";
+
 static int action_mailboxstatus(struct mansession *s, struct message *m)
 {
 	char *mailbox = astman_get_header(m, "Mailbox");
@@ -1599,6 +1608,8 @@
 	return 0;
 }
 
+/*! \brief register a new command with manager, including online help. This is 
+	the preferred way to register a manager command */
 int ast_manager_register2(const char *action, int auth, int (*func)(struct mansession *s, struct message *m), const char *synopsis, const char *description)
 {
 	struct manager_action *cur;
@@ -1620,6 +1631,8 @@
 
 	return 0;
 }
+/*! @}
+ END Doxygen group */
 
 static int registered = 0;
 

Index: muted.c
===================================================================
RCS file: /usr/cvsroot/asterisk/muted.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- muted.c	24 Oct 2005 20:12:05 -0000	1.13
+++ muted.c	14 Nov 2005 19:00:38 -0000	1.14
@@ -22,7 +22,10 @@
 /*! \file
  * \brief Mute Daemon
  *
- * Specially written for Malcolm Davenport, but I think I'll use it too
+ * \note Specially written for Malcolm Davenport, but I think I'll use it too
+ * Connects to the Asterisk Manager Interface, AMI, and listens for events
+ * on certain devices. If a phone call is connected to one of the devices (phones)
+ * the local sound is muted to a lower volume during the call.
  *
  */
 
@@ -183,6 +186,7 @@
 }
 #endif /* !__Darwin */
 
+/*! Connect to the asterisk manager interface */
 static int connect_asterisk(void)
 {
 	int sock;
@@ -190,6 +194,7 @@
 	char *ports;
 	int port = 5038;
 	struct sockaddr_in sin;
+
 	ports = strchr(host, ':');
 	if (ports) {
 		*ports = '\0';
@@ -237,6 +242,7 @@
 		return NULL;
 }
 
+/*! Login to the asterisk manager interface */
 static int login_asterisk(void)
 {
 	char *welcome;
@@ -573,6 +579,7 @@
 	char channel[120]="";
 	char oldname[120]="";
 	char newname[120]="";
+
 	resp = get_line();
 	if (!resp) {
 		fprintf(stderr, "disconnected (6)\n");
@@ -616,7 +623,7 @@
 {
 	printf("Usage: muted [-f] [-d]\n"
 	       "        -f : Do not fork\n"
-		   "        -d : Debug (implies -f)\n");
+	       "        -d : Debug (implies -f)\n");
 }
 
 int main(int argc, char *argv[])

Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.302
retrieving revision 1.303
diff -u -d -r1.302 -r1.303
--- pbx.c	11 Nov 2005 00:32:45 -0000	1.302
+++ pbx.c	14 Nov 2005 19:00:38 -0000	1.303
@@ -102,7 +102,11 @@
 
 struct ast_context;
 
-/* ast_exten: An extension */
+/*!\brief ast_exten: An extension 
+	The dialplan is saved as a linked list with each context
+	having it's own linked list of extensions - one item per
+	priority.
+*/
 struct ast_exten {
 	char *exten;			/* Extension name */
 	int matchcid;			/* Match caller id ? */
@@ -119,7 +123,7 @@
 	char stuff[0];
 };
 
-/* ast_include: include= support in extensions.conf */
+/*! \brief ast_include: include= support in extensions.conf */
 struct ast_include {
 	char *name;		
 	char *rname;		/* Context to include */
@@ -130,7 +134,7 @@
 	char stuff[0];
 };
 
-/* ast_sw: Switch statement in extensions.conf */
+/*! \brief ast_sw: Switch statement in extensions.conf */
 struct ast_sw {
 	char *name;
 	const char *registrar;			/* Registrar */
@@ -141,26 +145,27 @@
 	char stuff[0];
 };
 
+/*! \brief ast_ignorepat: Ignore patterns in dial plan */
 struct ast_ignorepat {
 	const char *registrar;
 	struct ast_ignorepat *next;
 	char pattern[0];
 };
 
-/* ast_context: An extension context */
+/*! \brief ast_context: An extension context */
 struct ast_context {
-	ast_mutex_t lock; 			/* A lock to prevent multiple threads from clobbering the context */
-	struct ast_exten *root;			/* The root of the list of extensions */
-	struct ast_context *next;		/* Link them together */
-	struct ast_include *includes;		/* Include other contexts */
-	struct ast_ignorepat *ignorepats;	/* Patterns for which to continue playing dialtone */
-	const char *registrar;			/* Registrar */
-	struct ast_sw *alts;			/* Alternative switches */
-	char name[0];				/* Name of the context */
+	ast_mutex_t lock; 			/*!< A lock to prevent multiple threads from clobbering the context */
+	struct ast_exten *root;			/*!< The root of the list of extensions */
+	struct ast_context *next;		/*!< Link them together */
+	struct ast_include *includes;		/*!< Include other contexts */
+	struct ast_ignorepat *ignorepats;	/*!< Patterns for which to continue playing dialtone */
+	const char *registrar;			/*!< Registrar */
+	struct ast_sw *alts;			/*!< Alternative switches */
+	char name[0];				/*!< Name of the context */
 };
 
 
-/* ast_app: An application */
+/*! \brief ast_app: A registered application */
 struct ast_app {
 	int (*execute)(struct ast_channel *chan, void *data);
 	const char *synopsis;			/* Synopsis text for 'show applications' */
@@ -169,7 +174,7 @@
 	char name[0];				/* Name of the application */
 };
 
-/* ast_state_cb: An extension state notify */
+/*! \brief ast_state_cb: An extension state notify register item */
 struct ast_state_cb {
 	int id;
 	void *data;
@@ -177,12 +182,15 @@
 	struct ast_state_cb *next;
 };
 	    
-/* Hints are pointers from an extension in the dialplan to one or more devices (tech/name) */
+/*! \brief Structure for dial plan hints
+
+  Hints are pointers from an extension in the dialplan to one or
+  more devices (tech/name) */
 struct ast_hint {
-	struct ast_exten *exten;	/* Extension */
-	int laststate; 			/* Last known state */
-	struct ast_state_cb *callbacks;	/* Callback list for this extension */
-	struct ast_hint *next;		/* Pointer to next hint in list */
+	struct ast_exten *exten;	/*!< Extension */
+	int laststate; 			/*!< Last known state */
+	struct ast_state_cb *callbacks;	/*!< Callback list for this extension */
+	struct ast_hint *next;		/*!< Pointer to next hint in list */
 };
 
 int ast_pbx_outgoing_cdr_failed(void);
@@ -224,9 +232,10 @@
 AST_MUTEX_DEFINE_STATIC(maxcalllock);
 static int countcalls = 0;
 
-AST_MUTEX_DEFINE_STATIC(acflock); 		/* Lock for the custom function list */
+AST_MUTEX_DEFINE_STATIC(acflock); 		/*!< Lock for the custom function list */
 static struct ast_custom_function *acf_root = NULL;
 
+/*! \brief Declaration of builtin applications */
 static struct pbx_builtin {
 	char name[AST_MAX_APP];
 	int (*execute)(struct ast_channel *chan, void *data);
@@ -507,13 +516,14 @@
 struct ast_hint *hints = NULL;
 struct ast_state_cb *statecbs = NULL;
 
-int pbx_exec(struct ast_channel *c, 		/* Channel */
-		struct ast_app *app,		/* Application */
-		void *data,			/* Data for execution */
-		int newstack)			/* Force stack increment */
+/* 
+   \note This function is special. It saves the stack so that no matter
+   how many times it is called, it returns to the same place */
+int pbx_exec(struct ast_channel *c, 		/*!< Channel */
+		struct ast_app *app,		/*!< Application */
+		void *data,			/*!< Data for execution */
+		int newstack)			/*!< Force stack increment */
 {
-	/* This function is special. It saves the stack so that no matter
-	   how many times it is called, it returns to the same place */
 	int res;
 	
 	char *saved_c_appl;
@@ -542,7 +552,7 @@
 }
 
 
-/* Go no deeper than this through includes (not counting loops) */
+/*! Go no deeper than this through includes (not counting loops) */
 #define AST_PBX_MAX_STACK	128
 
 #define HELPER_EXISTS 0
@@ -552,6 +562,8 @@
 #define HELPER_MATCHMORE 4
 #define HELPER_FINDLABEL 5
 
+/*! \brief Find application handle in linked list
+ */
 struct ast_app *pbx_findapp(const char *app) 
 {
 	struct ast_app *tmp;
@@ -1144,6 +1156,9 @@
 	}
 }
 
+/*! \brief CLI function to show installed custom functions 
+    \addtogroup CLI_functions
+ */
 static int handle_show_functions(int fd, int argc, char *argv[])
 {
 	struct ast_custom_function *acf;
@@ -2620,8 +2635,8 @@
 	return -1;
 }
 
-/*
- * This function locks contexts list by &conlist, search for the rigt context
+/*!
+ * \note This function locks contexts list by &conlist, search for the rigt context
  * structure, leave context list locked and call ast_context_remove_switch2
  * which removes switch, unlock contexts list and return ...
  */
@@ -2653,13 +2668,13 @@
 	return -1;
 }
 
-/*
- * When we call this function, &conlock lock must be locked, because when
+/*!
+ * \brief This function locks given context, removes switch, unlock context and
+ * return.
+ * \note When we call this function, &conlock lock must be locked, because when
  * we giving *con argument, some process can remove/change this context
  * and after that there can be segfault.
  *
- * This function locks given context, removes switch, unlock context and
- * return.
  */
 int ast_context_remove_switch2(struct ast_context *con, const char *sw, const char *data, const char *registrar)
 {
@@ -2693,7 +2708,7 @@
 }
 
 /*
- * This functions lock contexts list, search for the right context,
+ * \note This functions lock contexts list, search for the right context,
  * call ast_context_remove_extension2, unlock contexts list and return.
  * In this function we are using
  */
@@ -2723,15 +2738,15 @@
 	return -1;
 }
 
-/*
- * When do you want to call this function, make sure that &conlock is locked,
- * because some process can handle with your *con context before you lock
- * it.
- *
- * This functionc locks given context, search for the right extension and
+/*!
+ * \brief This functionc locks given context, search for the right extension and
  * fires out all peer in this extensions with given priority. If priority
  * is set to 0, all peers are removed. After that, unlock context and
  * return.
+ * \note When do you want to call this function, make sure that &conlock is locked,
+ * because some process can handle with your *con context before you lock
+ * it.
+ *
  */
 int ast_context_remove_extension2(struct ast_context *con, const char *extension, int priority, const char *registrar)
 {
@@ -2837,6 +2852,7 @@
 }
 
 
+/*! \brief Dynamically register a new dial plan application */
 int ast_register_application(const char *app, int (*execute)(struct ast_channel *, void *), const char *synopsis, const char *description)
 {
 	struct ast_app *tmp, *prev, *cur;
@@ -2982,7 +2998,7 @@
  */
 
 /*
- * 'show application' CLI command implementation functions ...
+ * \brief 'show application' CLI command implementation functions ...
  */
 
 /*
@@ -5345,18 +5361,27 @@
 	} while(f);
 }
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_progress(struct ast_channel *chan, void *data)
 {
 	ast_indicate(chan, AST_CONTROL_PROGRESS);
 	return 0;
 }
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_ringing(struct ast_channel *chan, void *data)
 {
 	ast_indicate(chan, AST_CONTROL_RINGING);
 	return 0;
 }
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_busy(struct ast_channel *chan, void *data)
 {
 	ast_indicate(chan, AST_CONTROL_BUSY);		
@@ -5365,6 +5390,9 @@
 	return -1;
 }
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_congestion(struct ast_channel *chan, void *data)
 {
 	ast_indicate(chan, AST_CONTROL_CONGESTION);
@@ -5373,6 +5401,9 @@
 	return -1;
 }
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_answer(struct ast_channel *chan, void *data)
 {
 	int delay = 0;
@@ -5393,6 +5424,9 @@
 	return res;
 }
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_setlanguage(struct ast_channel *chan, void *data)
 {
 	static int deprecation_warning = 0;
@@ -5415,6 +5449,9 @@
 	AST_APP_OPTION('v', AST_CDR_FLAG_KEEP_VARS),
 });
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_resetcdr(struct ast_channel *chan, void *data)
 {
 	char *args;
@@ -5434,6 +5471,9 @@
 	return 0;
 }
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_setaccount(struct ast_channel *chan, void *data)
 {
 	/* Copy the account code  as specified */
@@ -5444,6 +5484,9 @@
 	return 0;
 }
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_setamaflags(struct ast_channel *chan, void *data)
 {
 	/* Copy the AMA Flags as specified */
@@ -5454,12 +5497,18 @@
 	return 0;
 }
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_hangup(struct ast_channel *chan, void *data)
 {
 	/* Just return non-zero and it will hang up */
 	return -1;
 }
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_gotoiftime(struct ast_channel *chan, void *data)
 {
 	int res=0;
@@ -5486,6 +5535,9 @@
 	return res;
 }
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_execiftime(struct ast_channel *chan, void *data)
 {
 	int res = 0;
@@ -5537,6 +5589,9 @@
 	return res;
 }
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_wait(struct ast_channel *chan, void *data)
 {
 	int ms;
@@ -5549,6 +5604,9 @@
 	return 0;
 }
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_waitexten(struct ast_channel *chan, void *data)
 {
 	int ms, res, argc;
@@ -5604,6 +5662,9 @@
 	return res;
 }
 
+/*!
+ * \ingroup applications
+ */
 static int pbx_builtin_background(struct ast_channel *chan, void *data)
 {
 	int res = 0;
@@ -5700,6 +5761,10 @@
 	}
 }
 
+/*! AbsoluteTimeout
+ * \ingroup applications
+ * \todo Remove in 1.3 dev
+ */
 static int pbx_builtin_atimeout(struct ast_channel *chan, void *data)
 {
 	static int deprecation_warning = 0;
@@ -5717,6 +5782,10 @@
 	return 0;
 }
 
+/*! ResponseTimeout
+ * \ingroup applications
+ * \todo Remove in 1.3 dev
+ */
 static int pbx_builtin_rtimeout(struct ast_channel *chan, void *data)
 {
 	static int deprecation_warning = 0;
@@ -5737,6 +5806,10 @@
 	return 0;
 }
 
+/*! DigitTimeout
+ * \ingroup applications
+ * \todo Remove in 1.3 dev
+ */
 static int pbx_builtin_dtimeout(struct ast_channel *chan, void *data)
 {
 	static int deprecation_warning = 0;
@@ -5757,6 +5830,9 @@
 	return 0;
 }
 
+/*! Goto
+ * \ingroup applications
+ */
 static int pbx_builtin_goto(struct ast_channel *chan, void *data)
 {
 	int res;

Index: say.c
===================================================================
RCS file: /usr/cvsroot/asterisk/say.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- say.c	8 Nov 2005 02:14:42 -0000	1.74
+++ say.c	14 Nov 2005 19:00:38 -0000	1.75
@@ -21,7 +21,7 @@
  *
  * \brief Say numbers and dates (maybe words one day too)
  * 
- * 12-16-2004 : Support for Greek added by InAccess Networks (work funded by HOL, www.hol.gr)
+ * \note 12-16-2004 : Support for Greek added by InAccess Networks (work funded by HOL, www.hol.gr)
  *  						George Konstantoulakis <gkon at inaccessnetworks.com>
  */
 
@@ -278,35 +278,40 @@
 }
 
 /* Forward declarations */
-/* Syntaxes supported, not really language codes.
-      da    - Danish
-      de    - German
-      en    - English (US)
-      en_GB - English (British)
-      es    - Spanish, Mexican
-      fr    - French
-      he    - Hebrew
-      it    - Italian
-      nl    - Dutch
-      no    - Norwegian
-      pl    - Polish       
-      pt    - Portuguese
-      se    - Swedish
-      tw    - Taiwanese
-      ru    - Russian
+/*! \page Def_syntaxlang Asterisk Language Syntaxes supported
+    \not Not really language codes.
+	For these language codes, Asterisk will change the syntax when
+	saying numbers (and in some cases dates and voicemail messages
+	as well)
+      \arg \b da    - Danish
+      \arg \b de    - German
+      \arg \b en    - English (US)
+      \arg \b en_GB - English (British)
+      \arg \b es    - Spanish, Mexican
+      \arg \b fr    - French
+      \arg \b he    - Hebrew
+      \arg \b it    - Italian
+      \arg \b nl    - Dutch
+      \arg \b no    - Norwegian
+      \arg \b pl    - Polish       
+      \arg \b pt    - Portuguese
+      \arg \b se    - Swedish
+      \arg \b tw    - Taiwanese
+      \arg \b ru    - Russian
 
- Gender:
- For Some languages the numbers differ for gender and plural
- Use the option argument 'f' for female, 'm' for male and 'n' for neuter in languages like Portuguese, French, Spanish and German.
- use the option argument 'c' is for commune and 'n' for neuter gender in nordic languages like Danish, Swedish and Norwegian.
+ \par Gender:
+ For Some languages the numbers differ for gender and plural.
+ \arg Use the option argument 'f' for female, 'm' for male and 'n' for neuter in languages like Portuguese, French, Spanish and German.
+ \arg use the option argument 'c' is for commune and 'n' for neuter gender in nordic languages like Danish, Swedish and Norwegian.
  use the option argument 'p' for plural enumerations like in German
  
  Date/Time functions currently have less languages supported than saynumber().
 
- Note that in future, we need to move to a model where we can differentiate further - e.g. between en_US & en_UK
+ \todo Note that in future, we need to move to a model where we can differentiate further - e.g. between en_US & en_UK
 
  See contrib/i18n.testsuite.conf for some examples of the different syntaxes
 
+ \par Portuguese
  Portuguese sound files needed for Time/Date functions:
  pt-ah
  pt-ao
@@ -317,10 +322,12 @@
  pt-meiodia
  pt-sss
 
+ \par Spanish
  Spanish sound files needed for Time/Date functions:
  es-de
  es-el
 
+ \par Italian
  Italian sound files needed for Time/Date functions:
  ore-una
  ore-mezzanotte

Index: translate.c
===================================================================
RCS file: /usr/cvsroot/asterisk/translate.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- translate.c	24 Oct 2005 20:12:05 -0000	1.44
+++ translate.c	14 Nov 2005 19:00:38 -0000	1.45
@@ -46,15 +46,16 @@
 
 #define MAX_RECALC 200 /* max sample recalc */
 
-/* This could all be done more efficiently *IF* we chained packets together
+/*! \note
+   This could all be done more efficiently *IF* we chained packets together
    by default, but it would also complicate virtually every application. */
    
 AST_MUTEX_DEFINE_STATIC(list_lock);
 static struct ast_translator *list = NULL;
 
 struct ast_translator_dir {
-	struct ast_translator *step;	/* Next step translator */
-	int cost;			/* Complete cost to destination */
+	struct ast_translator *step;	/*!< Next step translator */
+	int cost;			/*!< Complete cost to destination */
 };
 
 struct ast_frame_delivery {
@@ -100,7 +101,7 @@
 	}
 }
 
-/* Build a set of translators based upon the given source and destination formats */
+/*! Build a set of translators based upon the given source and destination formats */
 struct ast_trans_pvt *ast_translator_build_path(int dest, int source)
 {
 	struct ast_trans_pvt *tmpr = NULL, *tmp = NULL;
@@ -218,15 +219,16 @@
 }
 
 
-static void calc_cost(struct ast_translator *t,int samples)
+static void calc_cost(struct ast_translator *t, int samples)
 {
 	int sofar=0;
 	struct ast_translator_pvt *pvt;
 	struct ast_frame *f, *out;
 	struct timeval start;
 	int cost;
+
 	if(!samples)
-	  samples = 1;
+		samples = 1;
 	
 	/* If they don't make samples, give them a terrible score */
 	if (!t->sample) {
@@ -264,19 +266,20 @@
 		t->cost = 1;
 }
 
+/*! \brief Use the list of translators to build a translation matrix */
 static void rebuild_matrix(int samples)
 {
 	struct ast_translator *t;
 	int changed;
 	int x,y,z;
+
 	if (option_debug)
-		ast_log(LOG_DEBUG, "Reseting translation matrix\n");
-	/* Use the list of translators to build a translation matrix */
+		ast_log(LOG_DEBUG, "Resetting translation matrix\n");
 	bzero(tr_matrix, sizeof(tr_matrix));
 	t = list;
 	while(t) {
-	  if(samples)
-	    calc_cost(t,samples);
+		if(samples)
+			calc_cost(t, samples);
 	  
 		if (!tr_matrix[t->srcfmt][t->dstfmt].step ||
 		     tr_matrix[t->srcfmt][t->dstfmt].cost > t->cost) {
@@ -290,7 +293,7 @@
 		/* Don't you just love O(N^3) operations? */
 		for (x=0; x< MAX_FORMAT; x++)				/* For each source format */
 			for (y=0; y < MAX_FORMAT; y++) 			/* And each destination format */
-				if (x != y)							/* Except ourselves, of course */
+				if (x != y)				/* Except ourselves, of course */
 					for (z=0; z < MAX_FORMAT; z++) 	/* And each format it might convert to */
 						if ((x!=z) && (y!=z)) 		/* Don't ever convert back to us */
 							if (tr_matrix[x][y].step && /* We can convert from x to y */
@@ -319,6 +322,7 @@
 
 
 
+/*! \brief CLI "show translation" command handler */
 static int show_translation(int fd, int argc, char *argv[])
 {
 #define SHOW_TRANS 11
@@ -346,7 +350,7 @@
 	ast_cli(fd, "         Translation times between formats (in milliseconds)\n");
 	ast_cli(fd, "          Source Format (Rows) Destination Format(Columns)\n\n");
 	ast_mutex_lock(&list_lock);
-	for (x=-1;x<SHOW_TRANS; x++) {
+	for (x = -1; x < SHOW_TRANS; x++) {
 		/* next 2 lines run faster than using strcpy() */
 		line[0] = ' ';
 		line[1] = '\0';
@@ -375,7 +379,7 @@
 static char show_trans_usage[] =
 "Usage: show translation [recalc] [<recalc seconds>]\n"
 "       Displays known codec translators and the cost associated\n"
-"with each conversion.  if the arguement 'recalc' is supplied along\n"
+"with each conversion.  If the argument 'recalc' is supplied along\n"
 "with optional number of seconds to test a new test will be performed\n"
 "as the chart is being displayed.\n";
 
@@ -410,6 +414,7 @@
 	return 0;
 }
 
+/*! \brief unregister codec translator */
 int ast_unregister_translator(struct ast_translator *t)
 {
 	char tmp[80];
@@ -434,9 +439,9 @@
 	return (u ? 0 : -1);
 }
 
+/*! \brief Calculate our best translator source format, given costs, and a desired destination */
 int ast_translator_best_choice(int *dst, int *srcs)
 {
-	/* Calculate our best source format, given costs, and a desired destination */
 	int x,y;
 	int best = -1;
 	int bestdst = 0;

Index: ulaw.c
===================================================================
RCS file: /usr/cvsroot/asterisk/ulaw.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- ulaw.c	24 Oct 2005 20:12:05 -0000	1.7
+++ ulaw.c	14 Nov 2005 19:00:38 -0000	1.8
@@ -28,60 +28,63 @@
 
 #include "asterisk/ulaw.h"
 
-#define ZEROTRAP    /* turn on the trap as per the MIL-STD */
-#define BIAS 0x84   /* define the add-in bias for 16 bit samples */
+#define ZEROTRAP    /*!< turn on the trap as per the MIL-STD */
+#define BIAS 0x84   /*!< define the add-in bias for 16 bit samples */
 #define CLIP 32635
 
 unsigned char __ast_lin2mu[16384];
 short __ast_mulaw[256];
 
-static unsigned char
-linear2ulaw(short sample)
+
+static unsigned char linear2ulaw(short sample)
 {
-  static int exp_lut[256] = {0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,
-                             4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
-                             5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-                             5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
-                             6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
-                             6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
-                             6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
-                             6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
-                             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-                             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-                             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-                             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-                             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-                             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-                             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-                             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7};
-  int sign, exponent, mantissa;
-  unsigned char ulawbyte;
+	static int exp_lut[256] = {
+		0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,
+		4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+		5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+		5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+		6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+		6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+		6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+		6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+		7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+		7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+		7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+		7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+		7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+		7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+		7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+		7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 };
+	int sign, exponent, mantissa;
+	unsigned char ulawbyte;
 
-  /* Get the sample into sign-magnitude. */
-  sign = (sample >> 8) & 0x80;          /* set aside the sign */
-  if (sign != 0) sample = -sample;              /* get magnitude */
-  if (sample > CLIP) sample = CLIP;             /* clip the magnitude */
+	/* Get the sample into sign-magnitude. */
+	sign = (sample >> 8) & 0x80;          /* set aside the sign */
+	if (sign != 0) 
+		sample = -sample;              /* get magnitude */
+	if (sample > CLIP)
+		sample = CLIP;             /* clip the magnitude */
 
-  /* Convert from 16 bit linear to ulaw. */
-  sample = sample + BIAS;
-  exponent = exp_lut[(sample >> 7) & 0xFF];
-  mantissa = (sample >> (exponent + 3)) & 0x0F;
-  ulawbyte = ~(sign | (exponent << 4) | mantissa);
+	/* Convert from 16 bit linear to ulaw. */
+	sample = sample + BIAS;
+	exponent = exp_lut[(sample >> 7) & 0xFF];
+	mantissa = (sample >> (exponent + 3)) & 0x0F;
+	ulawbyte = ~(sign | (exponent << 4) | mantissa);
 #ifdef ZEROTRAP
-  if (ulawbyte == 0) ulawbyte = 0x02;   /* optional CCITT trap */
+	if (ulawbyte == 0)
+		ulawbyte = 0x02;   /* optional CCITT trap */
 #endif
 
-  return(ulawbyte);
+	return ulawbyte;
 }
 
+/*!
+ * \brief  Set up mu-law conversion table
+ */
 void ast_ulaw_init(void)
 {
 	int i;
-	/* 
-	 *  Set up mu-law conversion table
-	 */
-	for(i = 0;i < 256;i++)
-	   {
+	for(i = 0;i < 256;i++) {
 		short mu,e,f,y;
 		static short etab[]={0,132,396,924,1980,4092,8316,16764};
 
@@ -92,12 +95,11 @@
 		y += etab[e];
 		if (mu & 0x80) y = -y;
 	        __ast_mulaw[i] = y;
-	   }
-	  /* set up the reverse (mu-law) conversion table */
-	for(i = -32768; i < 32768; i++)
-	   {
+	}
+	/* set up the reverse (mu-law) conversion table */
+	for(i = -32768; i < 32768; i++) {
 		__ast_lin2mu[((unsigned short)i) >> 2] = linear2ulaw(i);
-	   }
+	}
 
 }
 




More information about the svn-commits mailing list