Add Asterisk manpage
authorMark Spencer <markster@digium.com>
Sun, 18 Jul 2004 17:58:05 +0000 (17:58 +0000)
committerMark Spencer <markster@digium.com>
Sun, 18 Jul 2004 17:58:05 +0000 (17:58 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3471 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
asterisk.8.gz [new file with mode: 0755]
asterisk.c
asterisk.sgml [new file with mode: 0755]
redhat/asterisk.spec

index 4139ae7..c9b3bf9 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -108,6 +108,7 @@ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
 ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
 ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
 ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
 
 MODULES_DIR=$(ASTLIBDIR)/modules
 AGI_DIR=$(ASTVARLIBDIR)/agi-bin
@@ -203,7 +204,7 @@ _all: all
        @echo " +               $(MAKE) install                +"  
        @echo " +-------------------------------------------+"  
 
-all: depend asterisk subdirs
+all: depend asterisk subdirs 
 
 editline/config.h:
        cd editline && unset CFLAGS LIBS && ./configure ; \
@@ -240,6 +241,14 @@ cli.o: cli.c build.h
 
 asterisk.o: asterisk.c build.h
 
+manpage: asterisk.8.gz
+
+asterisk.8.gz: asterisk.sgml
+       rm -f asterisk.8
+       docbook2man asterisk.sgml
+       mv ./*.8 asterisk.8
+       gzip asterisk.8
+
 ifneq ($(strip $(ASTERISKVERSION)),)
 build.h: .version
        ./make_build_h
@@ -365,6 +374,7 @@ bininstall: all
        mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
        install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
        install -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+       install -m 644 asterisk.8.gz $(DESTDIR)$(ASTMANDIR)/man8
        if [ -d contrib/firmware/iax ]; then \
                install -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
        else \
diff --git a/asterisk.8.gz b/asterisk.8.gz
new file mode 100755 (executable)
index 0000000..916f4d1
Binary files /dev/null and b/asterisk.8.gz differ
index 62018f8..e831b65 100755 (executable)
@@ -1410,10 +1410,17 @@ static void ast_remotecontrol(char * data)
        printf("\nDisconnected from Asterisk server\n");
 }
 
+static int show_version(void)
+{
+       printf("Asterisk " ASTERISK_VERSION "\n");
+       return 0;
+}
+
 static int show_cli_help(void) {
        printf("Asterisk " ASTERISK_VERSION ", Copyright (C) 2000-2004, Digium.\n");
        printf("Usage: asterisk [OPTIONS]\n");
        printf("Valid Options:\n");
+       printf("   -V              Display version number and exit\n");
        printf("   -C <configfile> Use an alternate configuration file\n");
        printf("   -G <group>      Run as a group other than the caller\n");
        printf("   -U <user>       Run as a user other than the caller\n");
@@ -1533,7 +1540,7 @@ int main(int argc, char *argv[])
        }
        */
        /* Check for options */
-       while((c=getopt(argc, argv, "hfdvqprRgcinx:U:G:C:")) != -1) {
+       while((c=getopt(argc, argv, "hfdvVqprRgcinx:U:G:C:")) != -1) {
                switch(c) {
                case 'd':
                        option_debug++;
@@ -1585,6 +1592,9 @@ int main(int argc, char *argv[])
                case 'h':
                        show_cli_help();
                        exit(0);
+               case 'V':
+                       show_version();
+                       exit(0);
                case 'U':
                        runuser = optarg;
                        break;
diff --git a/asterisk.sgml b/asterisk.sgml
new file mode 100755 (executable)
index 0000000..fb569d5
--- /dev/null
@@ -0,0 +1,295 @@
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
+<refentry>
+<refentryinfo>
+       <date>2004-07-18</date>
+</refentryinfo>
+<refmeta>
+       <refentrytitle>
+               <application>asterisk</application>
+       </refentrytitle>
+       <manvolnum>8</manvolnum>
+       <refmiscinfo>asterisk 1.0</refmiscinfo>
+</refmeta>
+<refnamediv>
+       <refname>
+               <application>asterisk</application>
+       </refname>
+       <refpurpose>
+       All-purpose telephony server.
+       </refpurpose>
+</refnamediv>
+<refsynopsisdiv>
+       <cmdsynopsis>
+       <command>asterisk</command>
+<arg><option>-hfdvVqpRgcin</option></arg>
+<arg><option>-C </option><replaceable class="parameter">file</replaceable></arg>
+<arg><option>-U </option><replaceable class="parameter">user</replaceable></arg>
+<arg><option>-G </option><replaceable class="parameter">group</replaceable></arg>
+<arg><option>-x </option><replaceable class="parameter">command</replaceable></arg>
+       </cmdsynopsis>
+       <cmdsynopsis>
+
+       <command>asterisk -r</command>
+       <arg><option>-v</option></arg>
+<arg><option>-x </option><replaceable class="parameter">command</replaceable></arg>
+       </cmdsynopsis>
+</refsynopsisdiv>
+<refsect1>
+       <refsect1info>
+               <date>2004-07-01</date>
+       </refsect1info>
+       <title>DESCRIPTION</title>
+       <para>
+       <command>asterisk</command> is a full-featured telephony server which
+       provides Private Branch eXchange (PBX), Interactive Voice Response (IVR),
+       Automated Call Distribution (ACD), Voice over IP (VoIP) gatewaying, 
+       Conferencing, and a plethora of other telephony applications to a broad
+       range of telephony devices including packet voice (SIP, IAX, MGCP, Skinny,
+       H.323) devices (both endpoints and proxies), as well as traditional TDM
+       hardware including T1, E1, ISDN PRI, GR-303, RBS, Loopstart, Groundstart,
+       ISDN BRI, and many more.
+       </para>
+       <para>
+       Asterisk reads most of its configuration files from configuration files
+       located in /etc/asterisk.  Virtually all aspects of the operation of
+       asterisk's configuration files can be found in the sample configuration
+       files.  The format for those files is generally beyond the scope of this
+       man page.
+       </para>
+       <para>
+       When running with <command>-c</command>, <command>-r</command> or <command>-R</command>
+       options, Asterisk supplies a powerful command line, including command
+       completion, which may be used to monitors its status, perform a variety
+       of administrative actions and even explore the applications that are
+       currently loaded into the system.
+       </para>
+</refsect1>
+<refsect1>
+       <title>OPTIONS</title>
+       <variablelist>
+       <varlistentry>
+               <term>-C <replaceable class="parameter">file</replaceable></term>
+               <listitem>
+                       <para>
+                       Use <filename>file</filename> as master configuration file
+                       instead of the default, /etc/asterisk/asterisk.conf
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-c</term>
+               <listitem>
+                       <para>
+                       Provide a control console on the calling terminal.
+                       Specifying this option implies <command>-f</command> and will cause
+                       asterisk to no longer fork or detach from the controlling terminal.
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-d</term>
+               <listitem>
+                       <para>
+                       Enable extra debugging statements.
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-f</term>
+               <listitem>
+                       <para>
+                       Do not fork or detach from controlling terminal.
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-g</term>
+               <listitem>
+                       <para>
+                       Remove resource limit on core size, thus forcing Asterisk to dump
+                       core in the unlikely event of a segmentation fault or abort signal.
+                       <command>NOTE:</command> in some cases this may be incompatible
+                       with the <command>-U</command> or <command>-G</command> flags.
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-G <replaceable class="parameter">group</replaceable></term>
+               <listitem>
+                       <para>
+                       Run as group <replaceable>group</replaceable> instead of the
+                       calling group.  <command>NOTE:</command> this requires substantial work
+                       to be sure that Asterisk's environment has permission to write
+                       the files required for its operation, including logs, its comm
+                       socket, the asterisk database, etc.
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-h</term>
+               <listitem>
+                       <para>
+                       Provide brief summary of command line arguments and terminate.
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-i</term>
+               <listitem>
+                       <para>
+                       Prompt user to intialize any encrypted private keys during startup.
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-n</term>
+               <listitem>
+                       <para>
+                       Disable ANSI colors even on terminals capable of displaying them.
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-p</term>
+               <listitem>
+                       <para>
+                       If supported by the operating system (and executing as root),
+                       attempt to run with realtime priority for increased performance and
+                       responsiveness within the Asterisk process, at the expense of other
+                       programs running on the same machine.
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-q</term>
+               <listitem>
+                       <para>
+                       Reduce default console output when running in conjunction with
+                       console mode (<command>-c</command>).
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-r</term>
+               <listitem>
+                       <para>
+                       Instead of running a new Asterisk process, attempt to connect
+                       to a running Asterisk process and provide a console interface
+                       for controlling it.
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-R</term>
+               <listitem>
+                       <para>
+                       Much like <command>-r</command>.  Instead of running a new Asterisk process, attempt to connect
+                       to a running Asterisk process and provide a console interface
+                       for controlling it. Additionally, if connection to the Asterisk 
+                       process is lost, attempt to reconnect for as long as 30 seconds.
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-U <replaceable class="parameter">user</replaceable></term>
+               <listitem>
+                       <para>
+                       Run as user <replaceable>user</replaceable> instead of the
+                       calling user.  <command>NOTE:</command> this requires substantial work
+                       to be sure that Asterisk's environment has permission to write
+                       the files required for its operation, including logs, its comm
+                       socket, the asterisk database, etc.
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-v</term>
+               <listitem>
+                       <para>
+                       Increase the level of verboseness on the console.  The more times
+                       <command>-v</command> is specified, the more verbose the output is.
+                       Specifying this option implies <command>-f</command> and will cause
+                       asterisk to no longer fork or detach from the controlling terminal.
+                       This option may also be used in conjunction with <command>-r</command>
+                       and <command>-R</command>
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-V</term>
+               <listitem>
+                       <para>
+                       Display version information and exit immediately.
+                       </para>
+               </listitem>
+       </varlistentry>
+       <varlistentry>
+               <term>-x <replaceable class="parameter">command</replaceable></term>
+               <listitem>
+                       <para>
+                       Connect to a running Asterisk process and execute a command on
+                       a command line, passing any output through to standard out and
+                       then terminating when the command execution completes.  Implies
+                       <command>-r</command> when <command>-R</command> is not explicitly
+                       supplied.
+                       </para>
+               </listitem>
+       </varlistentry>
+       </variablelist>
+</refsect1>
+<refsect1>
+       <title>EXAMPLES</title>
+       <para>
+       <command>asterisk</command> - Begin Asterisk as a daemon
+       </para>
+       <para>
+       <command>asterisk -vvvgc</command> - Run on controlling terminal
+       </para>
+       <para>
+       <command>asterisk -rx "show channels"</command> - Display channels on running server
+       </para>
+</refsect1>
+<refsect1>
+       <title>BUGS</title>
+       <para>
+       Bug reports and feature requests may be filed at http://bugs.digium.com
+       </para>
+</refsect1>
+<refsect1>
+       <title>SEE ALSO</title>
+       <para>
+       *CLI&gt; <command>help</command> - Help on Asterisk CLI
+       </para>
+       <para>
+       *CLI&gt; <command>show applications</command> - Show loaded applications
+       </para>
+       <para>
+       http://www.asterisk.org - The Asterisk Home Page
+       </para>
+       <para>
+       http://www.asteriskdocs.org - The Asterisk Documentation Project
+       </para>
+       <para>
+       http://www.voip-info.org/wiki-Asterisk - The Asterisk Wiki
+       </para>
+       <para>
+       http://www.digium.com/ - Asterisk sponsor and hardware supplier
+       </para>
+       <para>
+       http://www.markocam.com/ - Asterisk author's web cam
+       </para>
+</refsect1>
+<refsect1>
+       <title>AUTHOR</title>
+       <para>
+       <author>
+               <firstname>Mark Spencer &lt;markster@digium.com&gt;</firstname> 
+       </author>
+       </para>
+       <para>
+       <author>
+               <firstname>Countless other contributers, see CREDITS with distribution for more information</firstname> 
+       </author>
+       </para>
+</refsect1>
+</refentry>
index d08792e..a7f3289 100755 (executable)
@@ -80,7 +80,10 @@ ln -sf /var/spool/asterisk/vm /var/lib/asterisk/sounds/vm
 %attr(0644,root,root)      /var/lib/asterisk/keys/*
 %attr(0755,root,root) %dir /var/lib/asterisk/agi-bin
 %attr(0755,root,root) %dir /var/lib/asterisk/agi-bin/*
-
+#
+# Man page
+#
+%attr(0644,root,root)      /usr/share/man/man8/asterisk.8.gz
 #
 # Firmware
 #