<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/2033/1/7/_/styles/combined.css?spaceKey=AST&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://wiki.asterisk.org/wiki/display/AST/Connecting+to+the+CLI">Connecting to the CLI</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://wiki.asterisk.org/wiki/display/~mdavenport">Malcolm Davenport</a>
    </h4>
        <br/>
                         <h4>Changes (2)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >You can use the built-in help to get more information about the various commands. Simply type *core show help* at the Asterisk prompt for a full list of commands, or *core show help command* for help on a particular command. <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">If you&#39;d like to exit the Asterisk console, just use the &quot;quit&quot; command from the CLI. Such as: <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">If you&#39;d like to exit the Asterisk console and return to your shell, just use the *quit* command from the CLI. Such as: <br></td></tr>
            <tr><td class="diff-unchanged" > <br>{noformat} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>First, let's show you how to connect to the Asterisk command-line interface. As you should recall from the installation, Asterisk typically runs in the background as a service or daemon. If the Asterisk service is already running, type the command below to connect to its command-line interface.</p>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>[root@server ~]# asterisk -r
</pre>
</div></div>


<p>The &#45;r parameter tells the system that you want to re-connect to the Asterisk service. If the reconnection is successful, you'll see something like this:</p>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>[root@server ~]# asterisk -r
Asterisk version, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer &lt;markster@digium.com&gt;
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk version currently running on server (pid = 11187)
server*CLI&gt;
</pre>
</div></div>

<p>Notice the <b>&#42;CLI&gt;</b> text? That's your Asterisk command-line prompt. All of the Asterisk CLI commands take the form of <b>module action parameters....</b> For example, type <b>core show uptime</b> to see how long Asterisk has been running.</p>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>server*CLI&gt; core show uptime
System uptime: 1 hour, 34 minutes, 17 seconds
Last reload: 1 hour, 34 minutes, 17 seconds
</pre>
</div></div>

<p>You can use the built-in help to get more information about the various commands. Simply type <b>core show help</b> at the Asterisk prompt for a full list of commands, or <b>core show help command</b> for help on a particular command.</p>

<p>If you'd like to exit the Asterisk console and return to your shell, just use the <b>quit</b> command from the CLI. Such as:</p>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>server*CLI&gt; quit
</pre>
</div></div>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://wiki.asterisk.org/wiki/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://wiki.asterisk.org/wiki/display/AST/Connecting+to+the+CLI">View Online</a>
        |
        <a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=4817527&revisedVersion=10&originalVersion=9">View Changes</a>
                |
        <a href="https://wiki.asterisk.org/wiki/display/AST/Connecting+to+the+CLI?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>