Refactor usage pattern of xmldoc info tag.
authorCorey Farrell <git@cfware.com>
Mon, 15 Aug 2016 20:29:53 +0000 (16:29 -0400)
committerCorey Farrell <git@cfware.com>
Tue, 16 Aug 2016 15:42:46 +0000 (10:42 -0500)
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

addons/chan_ooh323.c
channels/chan_dahdi.c
channels/chan_iax2.c
channels/chan_sip.c
channels/pjsip/dialplan_functions.c
channels/sip/dialplan_functions.c
doc/appdocsxml.xslt
funcs/func_channel.c
main/message.c
res/res_pjsip_messaging.c
res/res_xmpp.c

index 127ba0c..2a89565 100644 (file)
@@ -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>
index cbe7dba..8cccf84 100644 (file)
@@ -178,7 +178,7 @@ ASTERISK_REGISTER_FILE()
                        <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>
index 1b3e287..456ba8f 100644 (file)
@@ -212,7 +212,7 @@ ASTERISK_REGISTER_FILE()
                        <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>
index 2c44208..f57d467 100644 (file)
@@ -568,11 +568,11 @@ ASTERISK_REGISTER_FILE()
                        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" &lt;URI&gt;.</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>
index 322f564..4d888c8 100644 (file)
                <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>
                </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)})
index 9883788..53d15dd 100644 (file)
@@ -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>
index 6e4c5ac..f067dec 100644 (file)
@@ -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>
 
index 9831dd7..e816dca 100644 (file)
@@ -236,11 +236,7 @@ ASTERISK_REGISTER_FILE()
                                                <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 @@ ASTERISK_REGISTER_FILE()
                                ; 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>
  ***/
index 54c604c..0fc67ec 100644 (file)
@@ -123,16 +123,12 @@ ASTERISK_REGISTER_FILE()
                <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 @@ ASTERISK_REGISTER_FILE()
                        <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
index b508a2a..7efb1a2 100644 (file)
  ***/
 
 /*** 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" &lt;URI&gt;.</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>
index c2b7796..32e1dd1 100644 (file)
@@ -278,11 +278,11 @@ ASTERISK_REGISTER_FILE()
                        <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>