[Asterisk-code-review] documentation: Document built-in system and channel vars (asterisk[master])

Friendly Automation asteriskteam at digium.com
Wed Jan 12 08:20:22 CST 2022


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/17791 )

Change subject: documentation: Document built-in system and channel vars
......................................................................

documentation: Document built-in system and channel vars

Documentation for built-in special system and channel
vars is currently outdated, and updating is a manual
process since there is no XML documentation for these
anywhere.

This adds documentation for system vars to func_env
and for channel vars to func_channel so that they
appear along with the corresponding fields that would
be accessed using a function.

ASTERISK-29848 #close

Change-Id: I6997f925c4a45fffe71321861f5898a8b7182fa9
---
M funcs/func_channel.c
M funcs/func_env.c
2 files changed, 84 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, approved
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, but someone else must approve
  Friendly Automation: Approved for Submit



diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index 312806d..c6e5ec1 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -278,6 +278,41 @@
 				same => n,Log(NOTICE, This channel is: ${CHANNEL(state)})
 			</example>
 			<xi:include xpointer="xpointer(/docs/info[@name='CHANNEL_EXAMPLES'])" />
+			<para>The following channel variables are available as special built-in
+			dialplan channel variables. These variables cannot be set or modified
+			and are read-only.</para>
+			<variablelist>
+				<variable name="CALLINGPRES">
+					<para>Caller ID presentation for incoming calls (PRI channels)</para>
+				</variable>
+				<variable name="CALLINGANI2">
+					<para>Caller ANI2 (PRI channels)</para>
+				</variable>
+				<variable name="CALLINGTON">
+					<para>Caller Type of Number (PRI channels)</para>
+				</variable>
+				<variable name="CALLINGTNS">
+					<para>Transit Network Selector (PRI channels)</para>
+				</variable>
+				<variable name="EXTEN">
+					<para>Current extension</para>
+				</variable>
+				<variable name="CONTEXT">
+					<para>Current context</para>
+				</variable>
+				<variable name="PRIORITY">
+					<para>Current priority</para>
+				</variable>
+				<variable name="CHANNEL">
+					<para>Current channel name</para>
+				</variable>
+				<variable name="UNIQUEID">
+					<para>Current call unique identifier</para>
+				</variable>
+				<variable name="HANGUPCAUSE">
+					<para>Asterisk cause of hangup (inbound/outbound)</para>
+				</variable>
+			</variablelist>
 		</description>
 	</function>
  ***/
diff --git a/funcs/func_env.c b/funcs/func_env.c
index e5e3e70..f5ff3e0 100644
--- a/funcs/func_env.c
+++ b/funcs/func_env.c
@@ -49,6 +49,55 @@
 		</syntax>
 		<description>
 			<para>Variables starting with <literal>AST_</literal> are reserved to the system and may not be set.</para>
+			<para>Additionally, the following system variables are available as special built-in dialplan variables.
+			These variables cannot be set or modified and are read-only.</para>
+			<variablelist>
+				<variable name="EPOCH">
+					<para>Current unix style epoch</para>
+				</variable>
+				<variable name="SYSTEMNAME">
+					<para>value of the <literal>systemname</literal> option from <literal>asterisk.conf</literal></para>
+				</variable>
+				<variable name="ASTCACHEDIR">
+					<para>value of the <literal>astcachedir</literal> option from <literal>asterisk.conf</literal></para>
+				</variable>
+				<variable name="ASTETCDIR">
+					<para>value of the <literal>astetcdir</literal> option from <literal>asterisk.conf</literal></para>
+				</variable>
+				<variable name="ASTMODDIR">
+					<para>value of the <literal>astmoddir</literal> option from <literal>asterisk.conf</literal></para>
+				</variable>
+				<variable name="ASTVARLIBDIR">
+					<para>value of the <literal>astvarlib</literal> option from <literal>asterisk.conf</literal></para>
+				</variable>
+				<variable name="ASTDBDIR">
+					<para>value of the <literal>astdbdir</literal> option from <literal>asterisk.conf</literal></para>
+				</variable>
+				<variable name="ASTKEYDIR">
+					<para>value of the <literal>astkeydir</literal> option from <literal>asterisk.conf</literal></para>
+				</variable>
+				<variable name="ASTDATADIR">
+					<para>value of the <literal>astdatadir</literal> option from <literal>asterisk.conf</literal></para>
+				</variable>
+				<variable name="ASTAGIDIR">
+					<para>value of the <literal>astagidir</literal> option from <literal>asterisk.conf</literal></para>
+				</variable>
+				<variable name="ASTSPOOLDIR">
+					<para>value of the <literal>astspooldir</literal> option from <literal>asterisk.conf</literal></para>
+				</variable>
+				<variable name="ASTRUNDIR">
+					<para>value of the <literal>astrundir</literal> option from <literal>asterisk.conf</literal></para>
+				</variable>
+				<variable name="ASTLOGDIR">
+					<para>value of the <literal>astlogdir</literal> option from <literal>asterisk.conf</literal></para>
+				</variable>
+				<variable name="ASTSBINDIR">
+					<para>value of the <literal>astsbindir</literal> option from <literal>asterisk.conf</literal></para>
+				</variable>
+				<variable name="ENTITYID">
+					<para>Global Entity ID set automatically, or from <literal>asterisk.conf</literal></para>
+				</variable>
+			</variablelist>
 		</description>
 	</function>
 	<function name="STAT" language="en_US">

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17791
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I6997f925c4a45fffe71321861f5898a8b7182fa9
Gerrit-Change-Number: 17791
Gerrit-PatchSet: 2
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220112/e6c85563/attachment-0001.html>


More information about the asterisk-code-review mailing list