mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 11:58:40 +00:00
Implement a new element in AstXML for AMI actions documentation.
A new xml element was created to manage the AMI actions documentation,
using AstXML.
To register a manager action using XML documentation it is now possible
using ast_manager_register_xml().
The CLI command 'manager show command' can be used to show the parsed
documentation.
Example manager xml documentation:
<manager name="ami action name" language="en_US">
<synopsis>
AMI action synopsis.
</synopsis>
<syntax>
<xi:include xpointer="xpointer(...)" /> <-- for ActionID
<parameter name="header1" required="true">
<para>Description</para>
</parameter>
...
</syntax>
<description>
<para>AMI action description</para>
</description>
<see-also>
...
</see-also>
</manager>
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -59,6 +59,23 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
<ref type="application">Read</ref>
|
||||
</see-also>
|
||||
</application>
|
||||
<manager name="PlayDTMF" language="en_US">
|
||||
<synopsis>
|
||||
Play DTMF signal on a specific channel.
|
||||
</synopsis>
|
||||
<syntax>
|
||||
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
|
||||
<parameter name="Channel" required="true">
|
||||
<para>Channel name to send digit to.</para>
|
||||
</parameter>
|
||||
<parameter name="Digit" required="true">
|
||||
<para>The DTMF digit to play.</para>
|
||||
</parameter>
|
||||
</syntax>
|
||||
<description>
|
||||
<para>Plays a dtmf digit on the specified channel.</para>
|
||||
</description>
|
||||
</manager>
|
||||
***/
|
||||
static char *app = "SendDTMF";
|
||||
|
||||
@@ -90,12 +107,6 @@ static int senddtmf_exec(struct ast_channel *chan, const char *vdata)
|
||||
return res;
|
||||
}
|
||||
|
||||
static const char mandescr_playdtmf[] =
|
||||
"Description: Plays a dtmf digit on the specified channel.\n"
|
||||
"Variables: (all are required)\n"
|
||||
" Channel: Channel name to send digit to\n"
|
||||
" Digit: The dtmf digit to play\n";
|
||||
|
||||
static int manager_play_dtmf(struct mansession *s, const struct message *m)
|
||||
{
|
||||
const char *channel = astman_get_header(m, "Channel");
|
||||
@@ -136,7 +147,7 @@ static int load_module(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = ast_manager_register2( "PlayDTMF", EVENT_FLAG_CALL, manager_play_dtmf, "Play DTMF signal on a specific channel.", mandescr_playdtmf );
|
||||
res = ast_manager_register_xml("PlayDTMF", EVENT_FLAG_CALL, manager_play_dtmf);
|
||||
res |= ast_register_application_xml(app, senddtmf_exec);
|
||||
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user