From b1f91b97d2085cc845d0f57bd9907de50c995105 Mon Sep 17 00:00:00 2001 From: russell Date: Sat, 1 Nov 2008 21:10:07 +0000 Subject: Merge changes from team/group/appdocsxml This commit introduces the first phase of an effort to manage documentation of the interfaces in Asterisk in an XML format. Currently, a new format is available for applications and dialplan functions. A good number of conversions to the new format are also included. For more information, see the following message to asterisk-dev: http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html git-svn-id: http://svn.digium.com/svn/asterisk/trunk@153365 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_amd.c | 119 +++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 81 insertions(+), 38 deletions(-) (limited to 'apps/app_amd.c') diff --git a/apps/app_amd.c b/apps/app_amd.c index 81298f400..bf3603b3e 100644 --- a/apps/app_amd.c +++ b/apps/app_amd.c @@ -39,45 +39,88 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/config.h" #include "asterisk/app.h" +/*** DOCUMENTATION + + + Attempt to detect answering machines. + + + + Is maximum initial silence duration before greeting. + If this is exceeded set as MACHINE + + + is the maximum length of a greeting. + If this is exceeded set as MACHINE + + + Is the silence after detecting a greeting. + If this is exceeded set as HUMAN + + + Is the maximum time allowed for the algorithm + to decide HUMAN or MACHINE + + + Is the minimum duration of Voice considered to be a word + + + Is the minimum duration of silence after a word to + consider the audio that follows to be a new word + + + Is the maximum number of words in a greeting + If this is exceeded set as MACHINE + + + How long do we consider silence + + + Is the maximum duration of a word to accept. + If exceeded set as MACHINE + + + + This application attempts to detect answering machines at the beginning + of outbound calls. Simply call this application after the call + has been answered (outbound only, of course). + When loaded, AMD reads amd.conf and uses the parameters specified as + default values. Those default values get overwritten when the calling AMD + with parameters. + This application sets the following channel variables: + + + This is the status of the answering machine detection + + + + + + + Indicates the cause that led to the conclusion + + Total Time. + + + Silence Duration - Initial Silence. + + + Silence Duration - afterGreetingSilence. + + + Voice Duration - Greeting. + + + Word Count - maximum number of words. + + + + + + + ***/ static char *app = "AMD"; -static char *synopsis = "Attempts to detect answering machines"; -static char *descrip = -" AMD([initialSilence],[greeting],[afterGreetingSilence],[totalAnalysisTime]\n" -" ,[minimumWordLength],[betweenWordsSilence],[maximumNumberOfWords]\n" -" ,[silenceThreshold],[|maximumWordLength])\n" -" This application attempts to detect answering machines at the beginning\n" -" of outbound calls. Simply call this application after the call\n" -" has been answered (outbound only, of course).\n" -" When loaded, AMD reads amd.conf and uses the parameters specified as\n" -" default values. Those default values get overwritten when calling AMD\n" -" with parameters.\n" -"- 'initialSilence' is the maximum silence duration before the greeting. If\n" -" exceeded then MACHINE.\n" -"- 'greeting' is the maximum length of a greeting. If exceeded then MACHINE.\n" -"- 'afterGreetingSilence' is the silence after detecting a greeting.\n" -" If exceeded then HUMAN.\n" -"- 'totalAnalysisTime' is the maximum time allowed for the algorithm to decide\n" -" on a HUMAN or MACHINE.\n" -"- 'minimumWordLength'is the minimum duration of Voice to considered as a word.\n" -"- 'betweenWordsSilence' is the minimum duration of silence after a word to \n" -" consider the audio that follows as a new word.\n" -"- 'maximumNumberOfWords'is the maximum number of words in the greeting. \n" -" If exceeded then MACHINE.\n" -"- 'silenceThreshold' is the silence threshold.\n" -"- 'maximumWordLength' is the maximum duration of a word to accept. If exceeded then MACHINE\n" -"This application sets the following channel variables upon completion:\n" -" AMDSTATUS - This is the status of the answering machine detection.\n" -" Possible values are:\n" -" MACHINE | HUMAN | NOTSURE | HANGUP\n" -" AMDCAUSE - Indicates the cause that led to the conclusion.\n" -" Possible values are:\n" -" TOOLONG-<%d total_time>\n" -" INITIALSILENCE-<%d silenceDuration>-<%d initialSilence>\n" -" HUMAN-<%d silenceDuration>-<%d afterGreetingSilence>\n" -" MAXWORDS-<%d wordsCount>-<%d maximumNumberOfWords>\n" -" LONGGREETING-<%d voiceDuration>-<%d greeting>\n" -" MAXWORDLENGTH-<%d consecutiveVoiceDuration>\n"; #define STATE_IN_WORD 1 #define STATE_IN_SILENCE 2 @@ -437,7 +480,7 @@ static int load_module(void) { if (load_config(0)) return AST_MODULE_LOAD_DECLINE; - if (ast_register_application(app, amd_exec, synopsis, descrip)) + if (ast_register_application_xml(app, amd_exec)) return AST_MODULE_LOAD_FAILURE; return AST_MODULE_LOAD_SUCCESS; } -- cgit v1.2.3