[asterisk-commits] bkruse: branch group/appdocsxml r128600 - in /team/group/appdocsxml: ./ apps/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 7 09:35:29 CDT 2008


Author: bkruse
Date: Mon Jul  7 09:35:27 2008
New Revision: 128600

URL: http://svn.digium.com/view/asterisk?view=rev&rev=128600
Log:
Patch with some changes for some minor XML errors.

This is a big, and great step towards xmlization :)

(closes issue #13003)
(patch by snuffy, license on file)

Modified:
    team/group/appdocsxml/TODO_appdocsxml
    team/group/appdocsxml/apps/app_amd.c
    team/group/appdocsxml/apps/app_echo.c
    team/group/appdocsxml/apps/app_fax.c
    team/group/appdocsxml/apps/app_jack.c
    team/group/appdocsxml/apps/app_morsecode.c
    team/group/appdocsxml/apps/app_page.c
    team/group/appdocsxml/apps/app_senddtmf.c
    team/group/appdocsxml/doc/xmldocumentation.txt
    team/group/appdocsxml/main/pbx.c

Modified: team/group/appdocsxml/TODO_appdocsxml
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/TODO_appdocsxml?view=diff&rev=128600&r1=128599&r2=128600
==============================================================================
--- team/group/appdocsxml/TODO_appdocsxml (original)
+++ team/group/appdocsxml/TODO_appdocsxml Mon Jul  7 09:35:27 2008
@@ -27,20 +27,23 @@
 can be pulled out in a reliable way. Now we have to do that for
 all the Documentation we have already converted.
 
+Possibly, instead of passing NULL, NULL on ast_register_application
+and ast_function_register, just:
+#define ast_register_application_xml(a, b) ast_register_application(a, b, NULL, NULL) ?
+
+=== DONE ===
 
 Finish ast_register_application_xml
 
 Finish the parsing of /var/lib/asterisk/documentation.xml
 
-Add the parsing of files to one xml blob, and copying to
-/var/lib/asterisk/documentation.xml
-
-
 Fix the XML parsing, it seems that is not returning the right
 XML blob. I will have to talk to russell....Adding the language
 finding support messed up the accuracy of the parsing.
+(yay)
 
-=== DONE ===
+Add the parsing of files to one xml blob, and copying to
+/var/lib/asterisk/documentation.xml
 
 Change from iksemel to some other XML
 parsing library (libxml?)

Modified: team/group/appdocsxml/apps/app_amd.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/apps/app_amd.c?view=diff&rev=128600&r1=128599&r2=128600
==============================================================================
--- team/group/appdocsxml/apps/app_amd.c (original)
+++ team/group/appdocsxml/apps/app_amd.c Mon Jul  7 09:35:27 2008
@@ -39,8 +39,83 @@
 #include "asterisk/config.h"
 #include "asterisk/app.h"
 
-
+/*** DOCUMENTATION
+	<application name="AMD" language="en">
+		<synopsis>
+			Attempt to detect answering machines
+		</synopsis>
+		<description>
+			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.
+		</description>
+		<variable name="AMDSTATUS">
+			This is the status of the answering machine detection
+			<value name="MACHINE" />
+			<value name="HUMAN" />
+			<value name="NOTSURE" />
+			<value name="HANGUP" />
+		</variable>
+		<variable name="AMDCAUSE">
+			Indicates the cause that led to the conclusion
+			<value name="TOOLONG">
+				Total Time
+			</value>
+			<value name="INITIALSILENCE">
+				Silence Duration - Initial Silence
+			</value>
+			<value name="HUMAN">
+				Silence Duration - afterGreetingSilence
+			</value>
+			<value name="LONGGREETING">
+				Voice Duration - Greeting
+			</value>
+			<value name="MAXWORDLENGTH">
+				Word Count - maximum number of words
+			</value>	
+		</variable>
+		<option name="initialSilence">
+			Is maximum initial silence duration before greeting.
+			If this is exceeded set as MACHINE
+		</option>
+		<option name="greeting">
+			is the maximum length of a greeting.
+			If this is exceeded set as MACHINE
+		</option>
+		<option name="afterGreetingSilence">
+			Is the silence after detecting a greeting.
+			If this is exceeded set as HUMAN
+		</option>
+		<option name="totalAnalysis Time">
+			Is the maximum time allowed for the algorithm
+			to decide HUMAN or MACHINE
+		</option>
+		<option name="miniumWordLength">
+			Is the minimum duration of Voice considered to be a word
+		</option>
+		<option name="betweenWordSilence">
+			Is the minimum duration of silence after a word to
+			consider the audio that follows to be a new word
+		</option>
+		<option name="maximumNumberOfWords">
+			Is the maximum number of words in a greeting
+			If this is exceeded set as MACHINE
+		</option>
+		<option name="silenceThreshold">
+			How long do we consider silence
+		</option>
+		<option name="maximumWordLength">
+			Is the maximum duration of a word to accept.
+			If exceeded set as MACHINE
+		</option>
+	</application>
+
+ ***/
 static char *app = "AMD";
+/*
 static char *synopsis = "Attempts to detect answering machines";
 static char *descrip =
 "  AMD([initialSilence],[greeting],[afterGreetingSilence],[totalAnalysisTime]\n"
@@ -78,7 +153,7 @@
 "               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
 
@@ -433,7 +508,7 @@
 {
 	if (load_config(0))
 		return AST_MODULE_LOAD_DECLINE;
-	if (ast_register_application(app, amd_exec, synopsis, descrip))
+	if (ast_register_application(app, amd_exec, NULL, NULL))
 		return AST_MODULE_LOAD_FAILURE;
 	return AST_MODULE_LOAD_SUCCESS;
 }

Modified: team/group/appdocsxml/apps/app_echo.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/apps/app_echo.c?view=diff&rev=128600&r1=128599&r2=128600
==============================================================================
--- team/group/appdocsxml/apps/app_echo.c (original)
+++ team/group/appdocsxml/apps/app_echo.c Mon Jul  7 09:35:27 2008
@@ -33,15 +33,27 @@
 #include "asterisk/module.h"
 #include "asterisk/channel.h"
 
+/*** DOCUMENTATION
+	<application name="Echo" language="en">
+		<synopsis>
+			Echo audio, video, DTMF back to the calling party
+		</synopsis>
+		<description>
+			Echos back any audio, video or DTMF frames read from the calling 
+			channel back to itself. Note: If '#' detected application exits
+		</description>
+	</application>
+ ***/
+
 static char *app = "Echo";
-
+/*
 static char *synopsis = "Echo audio, video, or DTMF back to the calling party";
 
 static char *descrip =
 "  Echo(): This application will echo any audio, video, or DTMF frames read from\n"
 "the calling channel back to itself. If the DTMF digit '#' is received, the\n"
 "application will exit.\n";
-
+*/
 
 static int echo_exec(struct ast_channel *chan, void *data)
 {
@@ -80,7 +92,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, echo_exec, synopsis, descrip);
+	return ast_register_application(app, echo_exec, NULL, NULL);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Simple Echo Application");

Modified: team/group/appdocsxml/apps/app_fax.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/apps/app_fax.c?view=diff&rev=128600&r1=128599&r2=128600
==============================================================================
--- team/group/appdocsxml/apps/app_fax.c (original)
+++ team/group/appdocsxml/apps/app_fax.c Mon Jul  7 09:35:27 2008
@@ -40,8 +40,56 @@
 #include "asterisk/module.h"
 #include "asterisk/manager.h"
 
+/*** DOCUMENTATION
+	<application name="SendFAX" language="en">
+		<synopsis>
+			Send a Fax
+		</synopsis>
+		<description>
+			Send a given TIFF file to the channel as a FAX.
+		</description>
+		<variable name="LOCALSTATIONID">
+			To identify itself to the remote end
+		</variable>
+		<variable name="LOCALHEADERINFO">
+			To generate a header line on each page
+		</variable>
+		<variable name="FAXSTATUS">
+			<value name="SUCCESS"/>
+			<value name="FAILED"/>
+		</variable>
+		<variable name="FAXERROR">
+			Cause of failure
+		</variable>
+		<variable name="REMOTESTATIONID">
+			The CSID of the remote side
+		</variable>
+		<variable name="FAXPAGES">
+			Number of pages sent
+		</variable>
+		<variable name="FAXBITRATE">
+			Transmission rate
+		</variable>
+		<variable name="FAXRESOLUTION">
+			Resolution of sent fax
+		</variable>
+		<option name="filename" required="true">
+			Filename of TIFF file to fax
+		</option>
+		<option name="a">
+			Makes the application behave as the answering machine 
+			(Default behavior is as calling machine)
+		</option>
+		<return>
+	   		<value name="0">Success</value>
+			<value name="1">Failure</value>
+		</return>
+	</application>
+ ***/
+
 static char *app_sndfax_name = "SendFAX";
 static char *app_sndfax_synopsis = "Send a FAX";
+/*
 static char *app_sndfax_desc = 
 "  SendFAX(filename[|options]):\n"
 "Send a given TIFF file to the channel as a FAX.\n"
@@ -64,9 +112,60 @@
 "\n"
 "Returns -1 in case of user hang up or any channel error.\n"
 "Returns 0 on success.\n";
+*/
+
+/*** DOCUMENTATION
+	<application name="ReceiveFAX" language="en">
+		<synopsis>
+			Receive a Fax
+		</synopsis>
+		<description>
+			Receives a FAX from the channel into the given filename 
+			overwriting the file if it already exists. 
+			File created will be in TIFF format.
+		</description>
+		<variable name="LOCALSTATIONID">
+			To identify itself to the remote end
+		</variable>
+		<variable name="LOCALHEADERINFO">
+			To generate a header line on each page
+		</variable>
+		<variable name="FAXSTATUS">
+			<value name="SUCCESS"/>
+			<value name="FAILED"/>
+		</variable>
+		<variable name="FAXERROR">
+			Cause of failure
+		</variable>
+		<variable name="REMOTESTATIONID">
+			The CSID of the remote side
+		</variable>
+		<variable name="FAXPAGES">
+			Number of pages sent
+		</variable>
+		<variable name="FAXBITRATE">
+			Transmission rate
+		</variable>
+		<variable name="FAXRESOLUTION">
+			Resolution of sent fax
+		</variable>
+		<option name="filename" required="true">
+			Filename of TIFF file save incoming fax
+		</option>
+		<option name="c">
+			Makes the application behave as the calling machine 
+			(Default behavior is as answering machine)
+		</option>
+		<return>
+	   		<value name="0">Success</value>
+			<value name="-1">Failure if user hangup or channel error</value>
+		</return>
+	</application>
+ ***/
 
 static char *app_rcvfax_name = "ReceiveFAX";
 static char *app_rcvfax_synopsis = "Receive a FAX";
+/*
 static char *app_rcvfax_desc = 
 "  ReceiveFAX(filename[|options]):\n"
 "Receives a fax from the channel into the given filename overwriting\n"
@@ -90,7 +189,7 @@
 "\n"
 "Returns -1 in case of user hang up or any channel error.\n"
 "Returns 0 on success.\n";
-
+*/
 #define MAX_SAMPLES 240
 
 /* Watchdog. I have seen situations when remote fax disconnects (because of poor line
@@ -723,8 +822,8 @@
 {
 	int res ;
 
-	res = ast_register_application(app_sndfax_name, sndfax_exec, app_sndfax_synopsis, app_sndfax_desc);
-	res |= ast_register_application(app_rcvfax_name, rcvfax_exec, app_rcvfax_synopsis, app_rcvfax_desc);
+	res = ast_register_application(app_sndfax_name, sndfax_exec, NULL, NULL);
+	res |= ast_register_application(app_rcvfax_name, rcvfax_exec, NULL, NULL);
 
 	/* The default SPAN message handler prints to stderr. It is something we do not want */
 	span_set_message_handler(NULL);

Modified: team/group/appdocsxml/apps/app_jack.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/apps/app_jack.c?view=diff&rev=128600&r1=128599&r2=128600
==============================================================================
--- team/group/appdocsxml/apps/app_jack.c (original)
+++ team/group/appdocsxml/apps/app_jack.c Mon Jul  7 09:35:27 2008
@@ -68,8 +68,41 @@
 "                running.\n" \
 "    c(<name>) - By default, Asterisk will use the channel name for the jack client\n" \
 "                name.  Use this option to specify a custom client name.\n"
-
+/*** DOCUMENTATION
+	<application name="JACK" language="en">
+		<synopsis>
+			Jack Audio Connection Kit
+		</synopsis>
+		<description>
+			When executing this application, two jack ports will be created; 
+			one input and one output. Other applications can be hooked up to 
+			these ports to access audio coming from, or being send to the channel.
+		</description>
+		<option name="s">
+			<variable name="name" required="true">
+				Connect to the specified jack server name
+			</variable>
+		</option>
+		<option name="i">
+			<variable name="name" required="true">
+				Connect the output port that gets created to the specified jack input port
+			</variable>
+		</option>
+		<option name="o">
+			<variable name="name" required="true">
+				Connect the input port that gets created to the specified jack output port
+			</variable>
+		</option>
+		<option name="c">
+			<variable name="name" required="true">
+				By default, Asterisk will use the channel name for the jack client name.
+				Use this option to specify a custom client name.
+			</variable>
+		</option>
+	</application>
+ ***/
 static char *jack_app = "JACK";
+/*
 static char *jack_synopsis = 
 "JACK (Jack Audio Connection Kit) Application";
 static char *jack_desc = 
@@ -80,6 +113,7 @@
 "  Valid options:\n"
 COMMON_OPTIONS
 "";
+*/
 
 struct jack_data {
 	AST_DECLARE_STRING_FIELDS(
@@ -977,7 +1011,7 @@
 
 static int load_module(void)
 {
-	if (ast_register_application(jack_app, jack_exec, jack_synopsis, jack_desc)) {
+	if (ast_register_application(jack_app, jack_exec, NULL, NULL)) {
 		return AST_MODULE_LOAD_DECLINE;
 	}
 

Modified: team/group/appdocsxml/apps/app_morsecode.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/apps/app_morsecode.c?view=diff&rev=128600&r1=128599&r2=128600
==============================================================================
--- team/group/appdocsxml/apps/app_morsecode.c (original)
+++ team/group/appdocsxml/apps/app_morsecode.c Mon Jul  7 09:35:27 2008
@@ -34,8 +34,27 @@
 #include "asterisk/module.h"
 #include "asterisk/indications.h"
 
+/*** DOCUMENTATION
+	<application name="Morsecode" language="en">
+		<synopsis>
+			Plays morse code
+		</synopsis>
+		<description>
+			Plays the Morse code equivalent of the passed string.
+		</description>
+		<variable name="MORSEDITLEN">
+			Use this value in (ms) for length of dit
+		</variable>
+		<variable name="MORSETONE">
+			The pitch of the tone in (Hz), default is 800
+		</variable>
+		<option name="string" required="true">
+			String to playback as morse code to channel
+		</option>
+	</application>
+ ***/	
 static char *app_morsecode = "Morsecode";
-
+/*
 static char *morsecode_synopsis = "Plays morse code";
 
 static char *morsecode_descrip =
@@ -44,7 +63,7 @@
 "MORSEDITLEN is set, it will use that value for the length (in ms) of the dit\n"
 "(defaults to 80).  Additionally, if MORSETONE is set, it will use that tone\n"
 "(in Hz).  The tone default is 800.\n";
-
+*/
 
 static char *morsecode[] = {
 	"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /*  0-15 */
@@ -159,7 +178,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app_morsecode, morsecode_exec, morsecode_synopsis, morsecode_descrip);
+	return ast_register_application(app_morsecode, morsecode_exec, NULL, NULL);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Morse code");

Modified: team/group/appdocsxml/apps/app_page.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/apps/app_page.c?view=diff&rev=128600&r1=128599&r2=128600
==============================================================================
--- team/group/appdocsxml/apps/app_page.c (original)
+++ team/group/appdocsxml/apps/app_page.c Mon Jul  7 09:35:27 2008
@@ -44,8 +44,42 @@
 #include "asterisk/devicestate.h"
 #include "asterisk/dial.h"
 
+/*** DOCUMENTATION
+	<application name="Page" language="en">
+		<synopsis>
+			Page series of phones
+		</synopsis>
+		<description>
+			Places outbound calls to the given technology / resource and dumps
+			them into a conference bridge as muted participants. The original
+			caller is dumped into conference as a speaker and the room is
+			destroyed when the original callers leaves.
+		</description>
+		<option name="Technology/Resource" required="true" argsep="&amp;">
+			<argument name="Technology2/Resource2">
+				Optional extra 'devices' to dial.
+				If you need more then one enter them like this:
+				Technology2/Resource2&amp;Technology3/Resourse3&amp;.....
+			</argument>
+			Device to dial
+		</option>
+		<option name="d">
+			Full duplex audio
+		</option>
+		<option name="q">
+			Quiet, do not play beep to caller
+		</option>
+		<option name="r">
+			record the page into file (meetme option 'r')
+		</option>
+		<option name="s">
+			Only dial channel if devicestate says its 'notinuse'
+		</option>
+	</application>
+ ***/
 static const char *app_page= "Page";
 
+/*
 static const char *page_synopsis = "Pages phones";
 
 static const char *page_descrip =
@@ -58,7 +92,7 @@
 "        q - quiet, do not play beep to caller\n"
 "        r - record the page into a file (see 'r' for app_meetme)\n"
 "        s - only dial channel if devicestate says it is not in use\n";
-
+*/
 enum {
 	PAGE_DUPLEX = (1 << 0),
 	PAGE_QUIET = (1 << 1),
@@ -191,7 +225,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app_page, page_exec, page_synopsis, page_descrip);
+	return ast_register_application(app_page, page_exec, NULL, NULL);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Page Multiple Phones");

Modified: team/group/appdocsxml/apps/app_senddtmf.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/apps/app_senddtmf.c?view=diff&rev=128600&r1=128599&r2=128600
==============================================================================
--- team/group/appdocsxml/apps/app_senddtmf.c (original)
+++ team/group/appdocsxml/apps/app_senddtmf.c Mon Jul  7 09:35:27 2008
@@ -35,8 +35,25 @@
 #include "asterisk/manager.h"
 #include "asterisk/channel.h"
 
+/*** DOCUMENTATION
+	<application name="SendDTMF" language="en">
+		<synopsis>
+			Sends arbitrary DTMF digits
+		</synopsis>
+		<description>
+			DTMF digits sent to a channel with half second pause
+			It will pass all digits or terminate if it encounters an error.
+		</description>
+		<option name="digits" required="true">
+			List of digits 0-9,*#,abcd
+		</option>
+		<option name="timeout_ms">
+			Amount of time to wait in ms between tones
+		</option>
+	</application>
+ ***/
 static char *app = "SendDTMF";
-
+/*
 static char *synopsis = "Sends arbitrary DTMF digits";
 
 static char *descrip = 
@@ -44,7 +61,7 @@
 " Accepted digits: 0-9, *#abcd, w (.5s pause)\n"
 " The application will either pass the assigned digits or terminate if it\n"
 " encounters an error.\n";
-
+*/
 
 static int senddtmf_exec(struct ast_channel *chan, void *vdata)
 {
@@ -119,7 +136,7 @@
 	int res;
 
 	res = ast_manager_register2( "PlayDTMF", EVENT_FLAG_CALL, manager_play_dtmf, "Play DTMF signal on a specific channel.", mandescr_playdtmf );
-	res |= ast_register_application(app, senddtmf_exec, synopsis, descrip);
+	res |= ast_register_application(app, senddtmf_exec, NULL, NULL);
 
 	return res;
 }

Modified: team/group/appdocsxml/doc/xmldocumentation.txt
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/doc/xmldocumentation.txt?view=diff&rev=128600&r1=128599&r2=128600
==============================================================================
--- team/group/appdocsxml/doc/xmldocumentation.txt (original)
+++ team/group/appdocsxml/doc/xmldocumentation.txt Mon Jul  7 09:35:27 2008
@@ -1,6 +1,9 @@
 Applications etc now have to be documented with XML.
 This document will outline the format for that documentation.
 A lot of examples will be taken from apps/app_dial.c
+
+Good reference for XML validation (especially tag endings.):
+http://www.validome.org/xml/validate/
 
 Application documentation:
 

Modified: team/group/appdocsxml/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/main/pbx.c?view=diff&rev=128600&r1=128599&r2=128600
==============================================================================
--- team/group/appdocsxml/main/pbx.c (original)
+++ team/group/appdocsxml/main/pbx.c Mon Jul  7 09:35:27 2008
@@ -2665,8 +2665,6 @@
 		ret = mxmlFindElement(lang_node, documentation_tree, var, NULL, NULL, MXML_DESCEND);
 	}
 
-	ast_log(LOG_ERROR, "Ok, documentation_language is '%s' and lang_node is %s null\n", documentation_language, (lang_node) ? "NOT":"");
-
 	if (!ret || !ret->child) {
 		ast_log(LOG_WARNING, "Cannot find varible '%s' in tree '%s'\n", name, var);
 		return NULL;




More information about the asterisk-commits mailing list