aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xChangeLog2
-rwxr-xr-xMakefile10
-rwxr-xr-xapp.c5
-rwxr-xr-xasterisk.c58
-rwxr-xr-xcallerid.c25
-rwxr-xr-xcdr.c30
-rwxr-xr-xcontrib/asterisk-ng-doxygen11
-rwxr-xr-xframe.c84
-rwxr-xr-xfskmodem.c6
-rwxr-xr-xjitterbuf.c11
-rwxr-xr-xmanager.c13
-rwxr-xr-xmuted.c11
-rwxr-xr-xpbx.c158
-rwxr-xr-xpbx/pbx_config.c29
-rwxr-xr-xsay.c53
-rwxr-xr-xtranslate.c33
-rwxr-xr-xulaw.c88
17 files changed, 398 insertions, 229 deletions
diff --git a/ChangeLog b/ChangeLog
index 7578710c5..96320a6f5 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2005-11-14 Russell Bryant <russell@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@digium.com>
diff --git a/Makefile b/Makefile
index 766fc83e1..e5dab8a32 100755
--- a/Makefile
+++ b/Makefile
@@ -392,6 +392,13 @@ ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
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 @@ __rpm: include/asterisk/version.h spec
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 )
diff --git a/app.c b/app.c
index ea83601c2..c90767255 100755
--- a/app.c
+++ b/app.c
@@ -52,11 +52,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#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 @@ int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect,
-/* 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)
{
diff --git a/asterisk.c b/asterisk.c
index f2f7ace53..93831ac0f 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -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 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#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@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] = "";
diff --git a/callerid.c b/callerid.c
index 875071cb8..a0937b24a 100755
--- a/callerid.c
+++ b/callerid.c
@@ -64,12 +64,14 @@ float clidsb = 8000.0 / 1200.0;
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 @@ static inline void gen_tone(unsigned char *buf, int len, int codec, float ddr1,
}
}
+/*! \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 @@ void ast_shrink_phone_number(char *n)
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 @@ int ast_isphonenumber(char *n)
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 @@ char *ast_callerid_merge(char *buf, int bufsiz, const char *name, const char *nu
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 @@ static struct {
{ 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 @@ int ast_parse_caller_presentation(const char *data)
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;
diff --git a/cdr.c b/cdr.c
index c9f7ca3c9..ef9162dc1 100755
--- a/cdr.c
+++ b/cdr.c
@@ -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 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#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_batch_lock);
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 @@ int ast_cdr_register(char *name, char *desc, ast_cdrbe be)
return 0;
}
+/*! unregister a CDR driver */
void ast_cdr_unregister(char *name)
{
struct ast_cdr_beitem *i = NULL;
@@ -157,6 +161,9 @@ void ast_cdr_unregister(char *name)
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 @@ static const char *ast_cdr_getvar_internal(struct ast_cdr *cdr, const char *name
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 @@ void ast_cdr_getvar(struct ast_cdr *cdr, const char *name, char **ret, char *wor
*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 @@ char *ast_cdr_disp2str(int disposition)
return "UNKNOWN";
}
+/*! Converts AMA flag to printable string */
char *ast_cdr_flags2str(int flag)
{
switch(flag) {
@@ -865,7 +877,7 @@ struct ast_cdr *ast_cdr_append(struct ast_cdr *cdr, struct ast_cdr *newcdr)
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 @@ static void reset_batch(void)
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 @@ int ast_cdr_engine_init(void)
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)
{
diff --git a/contrib/asterisk-ng-doxygen b/contrib/asterisk-ng-doxygen
index 6cd6c57bd..8cf834d4a 100755
--- a/contrib/asterisk-ng-doxygen
+++ b/contrib/asterisk-ng-doxygen
@@ -19,11 +19,6 @@
PROJECT_NAME = "Asterisk - the Open Source PBX"
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER = CVS_HEAD
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
@@ -455,6 +450,7 @@ INPUT = ./ \
include/asterisk \
channels \
funcs \
+ stdtime \
apps \
cdr \
codecs \
@@ -716,7 +712,7 @@ ENUM_VALUES_PER_LINE = 4
# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
# probably better off using the HTML help feature.
-GENERATE_TREEVIEW = NO
+GENERATE_TREEVIEW = YES
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
@@ -1083,7 +1079,8 @@ HIDE_UNDOC_RELATIONS = YES
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
-HAVE_DOT = YES
+#Created by Asterisk Makefile
+#HAVE_DOT = NO
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
diff --git a/frame.c b/frame.c
index 63c6c8c9c..fa5538f36 100755
--- a/frame.c
+++ b/frame.c
@@ -56,10 +56,10 @@ AST_MUTEX_DEFINE_STATIC(framelock);
#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 @@ struct ast_smoother {
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 @@ static struct ast_frame *ast_frame_header_new(void)
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 @@ void ast_frfree(struct ast_frame *fr)
}
}
-/*
- * '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 @@ void ast_swapcopy_samples(void *dst, const void *src, int samples)
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 @@ static char frame_show_codec_n_usage[] =
"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 @@ static char frame_stats_usage[] =
" 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 @@ int ast_codec_pref_index(struct ast_codec_pref *pref, int index)
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 @@ void ast_codec_pref_remove(struct ast_codec_pref *pref, int format)
}
-/*--- 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 @@ int ast_codec_pref_append(struct ast_codec_pref *pref, int format)
}
-/*--- 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;
diff --git a/fskmodem.c b/fskmodem.c
index 93bc1e695..18e845c1e 100755
--- a/fskmodem.c
+++ b/fskmodem.c
@@ -74,7 +74,7 @@ static double coef_out[NBW][8]={
};
-/* 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 @@ static inline float filtroM(fsk_data *fskd,float in)
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 @@ static inline float filtroS(fsk_data *fskd,float in)
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;
diff --git a/jitterbuf.c b/jitterbuf.c
index 1f3223158..6f1c1bb71 100755
--- a/jitterbuf.c
+++ b/jitterbuf.c
@@ -22,6 +22,7 @@
/*! \file
*
* \brief jitterbuf: an application-independent jitterbuffer
+ * \author Steve Kann <stevek@stevek.com>
*
*/
@@ -35,7 +36,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#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 @@ void jb_destroy(jitterbuf *jb)
-/* 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 @@ static int longcmp(const void *a, const void *b)
}
#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);
diff --git a/manager.c b/manager.c
index c4bfcec35..1be1a38dc 100755
--- a/manager.c
+++ b/manager.c
@@ -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 @@ static int authenticate(struct mansession *s, struct message *m)
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 @@ static int action_originate(struct mansession *s, struct message *m)
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 @@ static char mandescr_mailboxstatus[] =
" 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 @@ static int ast_manager_register_struct(struct manager_action *act)
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 @@ int ast_manager_register2(const char *action, int auth, int (*func)(struct manse
return 0;
}
+/*! @}
+ END Doxygen group */
static int registered = 0;
diff --git a/muted.c b/muted.c
index 86795a71e..600892cad 100755
--- a/muted.c
+++ b/muted.c
@@ -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 @@ static int open_mixer(void)
}
#endif /* !__Darwin */
+/*! Connect to the asterisk manager interface */
static int connect_asterisk(void)
{
int sock;
@@ -190,6 +194,7 @@ static int connect_asterisk(void)
char *ports;
int port = 5038;
struct sockaddr_in sin;
+
ports = strchr(host, ':');
if (ports) {
*ports = '\0';
@@ -237,6 +242,7 @@ static char *get_line(void)
return NULL;
}
+/*! Login to the asterisk manager interface */
static int login_asterisk(void)
{
char *welcome;
@@ -573,6 +579,7 @@ static int wait_event(void)
char channel[120]="";
char oldname[120]="";
char newname[120]="";
+
resp = get_line();
if (!resp) {
fprintf(stderr, "disconnected (6)\n");
@@ -616,7 +623,7 @@ static void usage(void)
{
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[])
diff --git a/pbx.c b/pbx.c
index 90518f763..c44586caa 100755
--- a/pbx.c
+++ b/pbx.c
@@ -102,7 +102,11 @@ AST_APP_OPTIONS(waitexten_opts, {
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 @@ struct ast_exten {
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 @@ struct ast_include {
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 @@ struct ast_sw {
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 @@ struct ast_app {
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 {
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 @@ static int autofallthrough = 0;
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 @@ static int stateid = 1;
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 @@ int pbx_exec(struct ast_channel *c, /* Channel */
}
-/* 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 @@ int pbx_exec(struct ast_channel *c, /* Channel */
#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 @@ icky:
}
}
+/*! \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 @@ int ast_context_remove_include2(struct ast_context *con, const char *include, co
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 @@ int ast_context_remove_switch(const char *context, const char *sw, const char *d
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 @@ int ast_context_remove_switch2(struct ast_context *con, const char *sw, const ch
}
/*
- * 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 @@ int ast_context_remove_extension(const char *context, const char *extension, int
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 @@ int ast_context_remove_extension2(struct ast_context *con, const char *extension
}
+/*! \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 @@ static char show_hints_help[] =
*/
/*
- * 'show application' CLI command implementation functions ...
+ * \brief 'show application' CLI command implementation functions ...
*/
/*
@@ -5345,18 +5361,27 @@ static void wait_for_hangup(struct ast_channel *chan, void *data)
} 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 @@ static int pbx_builtin_busy(struct ast_channel *chan, void *data)
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 @@ static int pbx_builtin_congestion(struct ast_channel *chan, void *data)
return -1;
}
+/*!
+ * \ingroup applications
+ */
static int pbx_builtin_answer(struct ast_channel *chan, void *data)
{
int delay = 0;
@@ -5393,6 +5424,9 @@ static int pbx_builtin_answer(struct ast_channel *chan, void *data)
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_OPTIONS(resetcdr_opts, {
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 @@ static int pbx_builtin_resetcdr(struct ast_channel *chan, void *data)
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 @@ static int pbx_builtin_setaccount(struct ast_channel *chan, void *data)
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 @@ static int pbx_builtin_setamaflags(struct ast_channel *chan, void *data)
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 @@ static int pbx_builtin_gotoiftime(struct ast_channel *chan, void *data)
return res;
}
+/*!
+ * \ingroup applications
+ */
static int pbx_builtin_execiftime(struct ast_channel *chan, void *data)
{
int res = 0;
@@ -5537,6 +5589,9 @@ static int pbx_builtin_execiftime(struct ast_channel *chan, void *data)
return res;
}
+/*!
+ * \ingroup applications
+ */
static int pbx_builtin_wait(struct ast_channel *chan, void *data)
{
int ms;
@@ -5549,6 +5604,9 @@ static int pbx_builtin_wait(struct ast_channel *chan, void *data)
return 0;
}
+/*!
+ * \ingroup applications
+ */
static int pbx_builtin_waitexten(struct ast_channel *chan, void *data)
{
int ms, res, argc;
@@ -5604,6 +5662,9 @@ static int pbx_builtin_waitexten(struct ast_channel *chan, void *data)
return res;
}
+/*!
+ * \ingroup applications
+ */
static int pbx_builtin_background(struct ast_channel *chan, void *data)
{
int res = 0;
@@ -5700,6 +5761,10 @@ static int pbx_builtin_background(struct ast_channel *chan, void *data)
}
}
+/*! 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 @@ static int pbx_builtin_atimeout(struct ast_channel *chan, void *data)
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 @@ static int pbx_builtin_rtimeout(struct ast_channel *chan, void *data)
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 @@ static int pbx_builtin_dtimeout(struct ast_channel *chan, void *data)
return 0;
}
+/*! Goto
+ * \ingroup applications
+ */
static int pbx_builtin_goto(struct ast_channel *chan, void *data)
{
int res;
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index e43f2e1bf..1bcb2f515 100755
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -19,6 +19,7 @@
/*! \file
*
* \brief Populate and remember extensions from static config file
+ *
*
*/
@@ -120,14 +121,16 @@ static char reload_extensions_help[] =
* Implementation of functions provided by this module
*/
-/*
+/*!
* REMOVE INCLUDE command stuff
*/
static int handle_context_dont_include(int fd, int argc, char *argv[])
{
- if (argc != 5) return RESULT_SHOWUSAGE;
+ if (argc != 5)
+ return RESULT_SHOWUSAGE;
- if (strcmp(argv[3], "in")) return RESULT_SHOWUSAGE;
+ if (strcmp(argv[3], "in"))
+ return RESULT_SHOWUSAGE;
if (!ast_context_remove_include(argv[4], argv[2], registrar)) {
ast_cli(fd, "We are not including '%s' in '%s' now\n",
@@ -361,7 +364,7 @@ static char *complete_context_dont_include(char *line, char *word,
return NULL;
}
-/*
+/*!
* REMOVE EXTENSION command stuff
*/
static int handle_context_remove_extension(int fd, int argc, char *argv[])
@@ -701,7 +704,7 @@ static char *complete_context_remove_extension(char *line, char *word, int pos,
return NULL;
}
-/*
+/*!
* Include context ...
*/
static int handle_context_add_include(int fd, int argc, char *argv[])
@@ -913,8 +916,8 @@ static char *complete_context_add_include(char *line, char *word, int pos,
return NULL;
}
-/*
- * 'save dialplan' CLI command implementation functions ...
+/*!
+ * \brief 'save dialplan' CLI command implementation functions ...
*/
static int handle_save_dialplan(int fd, int argc, char *argv[])
{
@@ -1151,8 +1154,8 @@ static int handle_save_dialplan(int fd, int argc, char *argv[])
return RESULT_SUCCESS;
}
-/*
- * ADD EXTENSION command stuff
+/*!
+ * \brief ADD EXTENSION command stuff
*/
static int handle_context_add_extension(int fd, int argc, char *argv[])
{
@@ -1239,7 +1242,7 @@ static int handle_context_add_extension(int fd, int argc, char *argv[])
return RESULT_SUCCESS;
}
-/* add extension 6123,1,Dial,IAX/212.71.138.13/6123 into local */
+/*! add extension 6123,1,Dial,IAX/212.71.138.13/6123 into local */
static char *complete_context_add_extension(char *line, char *word,
int pos, int state)
{
@@ -1284,7 +1287,7 @@ static char *complete_context_add_extension(char *line, char *word,
return NULL;
}
-/*
+/*!
* IGNOREPAT CLI stuff
*/
static int handle_context_add_ignorepat(int fd, int argc, char *argv[])
@@ -1542,7 +1545,7 @@ static char *complete_context_remove_ignorepat(char *line, char *word,
return NULL;
}
-/*
+/*!
* CLI entries for commands provided by this module
*/
static struct ast_cli_entry context_dont_include_cli =
@@ -1583,7 +1586,7 @@ static struct ast_cli_entry reload_extensions_cli =
{ { "extensions", "reload", NULL}, handle_reload_extensions,
"Reload extensions and *only* extensions", reload_extensions_help };
-/*
+/*!
* Standard module functions ...
*/
int unload_module(void)
diff --git a/say.c b/say.c
index 720d08649..4e9f23703 100755
--- a/say.c
+++ b/say.c
@@ -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@inaccessnetworks.com>
*/
@@ -278,35 +278,40 @@ int ast_say_digits(struct ast_channel *chan, int num, const char *ints, const ch
}
/* 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
-
- 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.
+/*! \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
+
+ \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 @@ int ast_say_digits(struct ast_channel *chan, int num, const char *ints, const ch
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
diff --git a/translate.c b/translate.c
index bfc3932b1..4126851b9 100755
--- a/translate.c
+++ b/translate.c
@@ -46,15 +46,16 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#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 @@ void ast_translator_free_path(struct ast_trans_pvt *p)
}
}
-/* 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 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
}
-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 @@ static void calc_cost(struct ast_translator *t,int samples)
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 @@ static void rebuild_matrix(int samples)
/* 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 @@ static void rebuild_matrix(int samples)
+/*! \brief CLI "show translation" command handler */
static int show_translation(int fd, int argc, char *argv[])
{
#define SHOW_TRANS 11
@@ -346,7 +350,7 @@ static int show_translation(int fd, int argc, char *argv[])
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 int added_cli = 0;
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 @@ int ast_register_translator(struct ast_translator *t)
return 0;
}
+/*! \brief unregister codec translator */
int ast_unregister_translator(struct ast_translator *t)
{
char tmp[80];
@@ -434,9 +439,9 @@ int ast_unregister_translator(struct ast_translator *t)
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;
diff --git a/ulaw.c b/ulaw.c
index 9001cf434..618118d6c 100755
--- a/ulaw.c
+++ b/ulaw.c
@@ -28,60 +28,63 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#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 @@ void ast_ulaw_init(void)
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);
- }
+ }
}