[asterisk-commits] Refactor usage pattern of xmldoc info tag. (asterisk[master])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Aug 16 13:13:51 CDT 2016
Joshua Colp has submitted this change and it was merged.
Change subject: Refactor usage pattern of xmldoc info tag.
......................................................................
Refactor usage pattern of xmldoc info tag.
This updates func_channel.c and main/message.c to use a generic xpointer
include instead of including info from each channel driver. Now the
name attribute of info is CHANNEL or CHANNEL_EXAMPLES to be included in
documentation for func_channel. Setting the name attribute of info to
MessageToInfo or MessageFromInfo causes it to be included in the
MessageSend application and AMI action.
Change-Id: I89fd8276a3250824241a618009714267d3a8d1ea
---
M addons/chan_ooh323.c
M channels/chan_dahdi.c
M channels/chan_iax2.c
M channels/chan_sip.c
M channels/pjsip/dialplan_functions.c
M channels/sip/dialplan_functions.c
M doc/appdocsxml.xslt
M funcs/func_channel.c
M main/message.c
M res/res_pjsip_messaging.c
M res/res_xmpp.c
11 files changed, 22 insertions(+), 31 deletions(-)
Approvals:
Joshua Colp: Looks good to me, approved; Verified
diff --git a/addons/chan_ooh323.c b/addons/chan_ooh323.c
index 127ba0c..2a89565 100644
--- a/addons/chan_ooh323.c
+++ b/addons/chan_ooh323.c
@@ -23,7 +23,7 @@
***/
/*** DOCUMENTATION
-<info name="OOH323CHANNEL" language="en_US" tech="OOH323">
+<info name="CHANNEL" language="en_US" tech="OOH323">
<enumlist>
<enum name="faxdetect">
<para>R/W Fax Detect</para>
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index cbe7dba..8cccf84 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -178,7 +178,7 @@
<para>This application will Accept the R2 call either with charge or no charge.</para>
</description>
</application>
- <info name="DAHDICHANNEL" language="en_US" tech="DAHDI">
+ <info name="CHANNEL" language="en_US" tech="DAHDI">
<enumlist>
<enum name="dahdi_channel">
<para>R/O DAHDI channel related to this channel.</para>
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 1b3e287..456ba8f 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -212,7 +212,7 @@
<para>Gets or sets a variable that is sent to a remote IAX2 peer during call setup.</para>
</description>
</function>
- <info name="IAXCHANNEL" language="en_US" tech="IAX">
+ <info name="CHANNEL" language="en_US" tech="IAX">
<enumlist>
<enum name="osptoken">
<para>R/O Get the peer's osptoken.</para>
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 2c44208..f57d467 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -568,11 +568,11 @@
for all of the sip peers will be retrieved.</para>
</description>
</manager>
- <info name="SIPMessageFromInfo" language="en_US" tech="SIP">
+ <info name="MessageFromInfo" language="en_US" tech="SIP">
<para>The <literal>from</literal> parameter can be a configured peer name
or in the form of "display-name" <URI>.</para>
</info>
- <info name="SIPMessageToInfo" language="en_US" tech="SIP">
+ <info name="MessageToInfo" language="en_US" tech="SIP">
<para>Specifying a prefix of <literal>sip:</literal> will send the
message as a SIP MESSAGE request.</para>
</info>
diff --git a/channels/pjsip/dialplan_functions.c b/channels/pjsip/dialplan_functions.c
index 322f564..4d888c8 100644
--- a/channels/pjsip/dialplan_functions.c
+++ b/channels/pjsip/dialplan_functions.c
@@ -109,7 +109,7 @@
<ref type="function">PJSIP_MEDIA_OFFER</ref>
</see-also>
</function>
-<info name="PJSIPCHANNEL" language="en_US" tech="PJSIP">
+<info name="CHANNEL" language="en_US" tech="PJSIP">
<enumlist>
<enum name="rtp">
<para>R/O Retrieve media related information.</para>
@@ -411,7 +411,7 @@
</enum>
</enumlist>
</info>
-<info name="PJSIPCHANNEL_EXAMPLES" language="en_US" tech="PJSIP">
+<info name="CHANNEL_EXAMPLES" language="en_US" tech="PJSIP">
<example title="PJSIP specific CHANNEL examples">
; Log the current Call-ID
same => n,Log(NOTICE, ${CHANNEL(pjsip,call-id)})
diff --git a/channels/sip/dialplan_functions.c b/channels/sip/dialplan_functions.c
index 9883788..53d15dd 100644
--- a/channels/sip/dialplan_functions.c
+++ b/channels/sip/dialplan_functions.c
@@ -24,7 +24,7 @@
***/
/*** DOCUMENTATION
-<info name="SIPCHANNEL" language="en_US" tech="SIP">
+<info name="CHANNEL" language="en_US" tech="SIP">
<enumlist>
<enum name="peerip">
<para>R/O Get the IP address of the peer.</para>
diff --git a/doc/appdocsxml.xslt b/doc/appdocsxml.xslt
index 6e4c5ac..f067dec 100644
--- a/doc/appdocsxml.xslt
+++ b/doc/appdocsxml.xslt
@@ -6,7 +6,10 @@
<xsl:template match="node()|@*">
<xsl:copy>
- <xsl:apply-templates select="node()|@*"/>
+ <xsl:for-each select="node()|@*">
+ <xsl:sort select="@tech"/>
+ <xsl:apply-templates select="."/>
+ </xsl:for-each>
</xsl:copy>
</xsl:template>
diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index 9831dd7..e816dca 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -236,11 +236,7 @@
<para>R/W The maximum number of forwards allowed.</para>
</enum>
</enumlist>
- <xi:include xpointer="xpointer(/docs/info[@name='SIPCHANNEL'])" />
- <xi:include xpointer="xpointer(/docs/info[@name='PJSIPCHANNEL'])" />
- <xi:include xpointer="xpointer(/docs/info[@name='IAXCHANNEL'])" />
- <xi:include xpointer="xpointer(/docs/info[@name='DAHDICHANNEL'])" />
- <xi:include xpointer="xpointer(/docs/info[@name='OOH323CHANNEL'])" />
+ <xi:include xpointer="xpointer(/docs/info[@name='CHANNEL'])" />
</parameter>
</syntax>
<description>
@@ -266,7 +262,7 @@
; Log the current state of the channel
same => n,Log(NOTICE, This channel is: ${CHANNEL(state)})
</example>
- <xi:include xpointer="xpointer(/docs/info[@name='PJSIPCHANNEL_EXAMPLES'])" />
+ <xi:include xpointer="xpointer(/docs/info[@name='CHANNEL_EXAMPLES'])" />
</description>
</function>
***/
diff --git a/main/message.c b/main/message.c
index 54c604c..0fc67ec 100644
--- a/main/message.c
+++ b/main/message.c
@@ -123,16 +123,12 @@
<syntax>
<parameter name="to" required="true">
<para>A To URI for the message.</para>
- <xi:include xpointer="xpointer(/docs/info[@name='PJSIPMessageToInfo'])" />
- <xi:include xpointer="xpointer(/docs/info[@name='SIPMessageToInfo'])" />
- <xi:include xpointer="xpointer(/docs/info[@name='XMPPMessageToInfo'])" />
+ <xi:include xpointer="xpointer(/docs/info[@name='MessageToInfo'])" />
</parameter>
<parameter name="from" required="false">
<para>A From URI for the message if needed for the
message technology being used to send this message.</para>
- <xi:include xpointer="xpointer(/docs/info[@name='PJSIPMessageFromInfo'])" />
- <xi:include xpointer="xpointer(/docs/info[@name='SIPMessageFromInfo'])" />
- <xi:include xpointer="xpointer(/docs/info[@name='XMPPMessageFromInfo'])" />
+ <xi:include xpointer="xpointer(/docs/info[@name='MessageFromInfo'])" />
</parameter>
</syntax>
<description>
@@ -168,16 +164,12 @@
<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
<parameter name="To" required="true">
<para>The URI the message is to be sent to.</para>
- <xi:include xpointer="xpointer(/docs/info[@name='PJSIPMessageToInfo'])" />
- <xi:include xpointer="xpointer(/docs/info[@name='SIPMessageToInfo'])" />
- <xi:include xpointer="xpointer(/docs/info[@name='XMPPMessageToInfo'])" />
+ <xi:include xpointer="xpointer(/docs/info[@name='MessageToInfo'])" />
</parameter>
<parameter name="From">
<para>A From URI for the message if needed for the
message technology being used to send this message.</para>
- <xi:include xpointer="xpointer(/docs/info[@name='PJSIPMessageFromInfo'])" />
- <xi:include xpointer="xpointer(/docs/info[@name='SIPMessageFromInfo'])" />
- <xi:include xpointer="xpointer(/docs/info[@name='XMPPMessageFromInfo'])" />
+ <xi:include xpointer="xpointer(/docs/info[@name='MessageFromInfo'])" />
</parameter>
<parameter name="Body">
<para>The message body text. This must not contain any newlines as that
diff --git a/res/res_pjsip_messaging.c b/res/res_pjsip_messaging.c
index b508a2a..7efb1a2 100644
--- a/res/res_pjsip_messaging.c
+++ b/res/res_pjsip_messaging.c
@@ -24,11 +24,11 @@
***/
/*** DOCUMENTATION
- <info name="PJSIPMessageFromInfo" language="en_US" tech="PJSIP">
+ <info name="MessageFromInfo" language="en_US" tech="PJSIP">
<para>The <literal>from</literal> parameter can be a configured endpoint
or in the form of "display-name" <URI>.</para>
</info>
- <info name="PJSIPMessageToInfo" language="en_US" tech="PJSIP">
+ <info name="MessageToInfo" language="en_US" tech="PJSIP">
<para>Specifying a prefix of <literal>pjsip:</literal> will send the
message as a SIP MESSAGE request.</para>
</info>
diff --git a/res/res_xmpp.c b/res/res_xmpp.c
index c2b7796..32e1dd1 100644
--- a/res/res_xmpp.c
+++ b/res/res_xmpp.c
@@ -278,11 +278,11 @@
<para>Sends a message to a Jabber Client.</para>
</description>
</manager>
- <info name="XMPPMessageToInfo" language="en_US" tech="XMPP">
+ <info name="MessageToInfo" language="en_US" tech="XMPP">
<para>Specifying a prefix of <literal>xmpp:</literal> will send the
message as an XMPP chat message.</para>
</info>
- <info name="XMPPMessageFromInfo" language="en_US" tech="XMPP">
+ <info name="MessageFromInfo" language="en_US" tech="XMPP">
<para>Specifying a prefix of <literal>xmpp:</literal> will specify the
account defined in <literal>xmpp.conf</literal> to send the message from.
Note that this field is required for XMPP messages.</para>
--
To view, visit https://gerrit.asterisk.org/3568
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I89fd8276a3250824241a618009714267d3a8d1ea
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
More information about the asterisk-commits
mailing list