login | register
Fri 09 of May, 2008 [16:23 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.
 
Google Ads
Shoutbox
  • Nick Barnes, Fri 09 of May, 2008 [11:36 UTC]: Christopher - yesterday I tried an Asterisk install on a CentOS 5.1 box with stock GUI and it all worked fine. Sorry I can't help.
  • aero, Fri 09 of May, 2008 [08:20 UTC]: can someone help me out on this, i tried to play some sound files on my asterisk box and this is the error message i got. WARNING[4429]: format_wav.c:169 check_header: Unexpected freqency 22050 May 8 11:17:39 WARNING[4433]: codec_gsm.c:194 gsmtolin_fra
  • Christopher Faust, Thu 08 of May, 2008 [14:15 UTC]: I beleive that I may have to change something in the xserver configuration. Please advise
  • Christopher Faust, Thu 08 of May, 2008 [14:14 UTC]: Everything was perfect. In the bios I have increased the memory allocated Still receive input not supported on my display.
  • Christopher Faust, Thu 08 of May, 2008 [14:13 UTC]: This would not be my main box. I am doing some testing to see if I can install zaptel and asterisk 1.4 on a full centos 5.1 box with development software Its bizzare, because before I went through the asterisk and zaptel installation everything was perfe
  • Nick Barnes, Thu 08 of May, 2008 [13:44 UTC]: Christopher - I can't see any way in which an Asterisk installation would muck your GUI, but remember that it is advised not to use a GUI on an Asterisk box anyway.
  • Christopher Faust, Wed 07 of May, 2008 [15:28 UTC]: When I try to startx I ge input not supported. Though before installing asterisk I had no video issue to start the GUI
  • Christopher Faust, Wed 07 of May, 2008 [15:26 UTC]: Hi Nick, I got centos 5.1 and asterisk up But now I cannot start startx I have set the depth from 24 to 16 for the video i810 driver for the i845 on my netvista machine but I cannot start GNOME. Please advise
  • Nick Barnes, Wed 07 of May, 2008 [10:01 UTC]: Howard - You'll need to provide a lot more information if you really want help.
  • Nick Barnes, Wed 07 of May, 2008 [10:00 UTC]: Christopher - Search the Wiki and you'll find a page I wrote detailing exactly what you have to do for Asterisk 1.4 + CentOS 5.1.
Server Stats
  • Execution time: 0.39s
  • Memory usage: 2.24MB
  • Database queries: 35
  • GZIP: Disabled
  • Server load: 0.65

Asterisk CLI


The Asterisk command line interface (CLI) is reached by using the Linux shell command
 asterisk -r

If you want debugging output, add one or many v:s
 asterisk -vvvvvr

The Asterisk server has to be running in the background for the CLI to start.

If you want to run a CLI command in a shell script, use the x option

 asterisk -rx "logger reload"

For help in the CLI mode, use the help command. To get help on various applications you can use in the extensions.conf config file, use the show applications command.


General commands

  • !<command>: Executes a given shell command
  • abort halt: Cancel a running halt
  • add extension: Add new extension into context
  • add ignorepat: Add new ignore pattern
  • add indication: Add the given indication to the country
  • debug channel: Enable debugging on a channel
  • dont include: Remove a specified include from context
  • help: Display help list, or specific help on a command
  • include context: Include context in other context
  • load: Load a dynamic module by name
  • logger reload: Reopen log files. Use after rotating the log files.
  • no debug channel: Disable debugging on a channel
  • originate: originate a call.
  • remove extension: Remove a specified extension

  • remove ignorepat: Remove ignore pattern from context
  • remove indication: Remove the given indication from the country
  • save dialplan: Overwrites your current extensions.conf file with an exported version based on the current state of the dialplan. A backup copy of your old extensions.conf is not saved. The initial values of global variables defined in the [globals] category retain their previous initial values; the current values of global variables are not written into the new extensions.conf. (:exclaim:) Using "save dialplan" will result in losing any comments in your current extensions.conf.
  • dialplan save (1.4): BROKEN, doesn't parse correctly. Overwrites your current extensions.conf file with an exported version based on the current state of the dialplan. A backup copy of your old extensions.conf is not saved. The initial values of global variables defined in the [globals] category retain their previous initial values; the current values of global variables are not written into the new extensions.conf. (:exclaim:) Using "save dialplan" will result in losing any comments in your current extensions.conf.
  • set verbose: Set level of verboseness
  • show agents: Show status of agents
  • show applications: Shows registered applications
  • show application: Describe a specific application
  • show channel: Display information on a specific channel
  • show channels: Display information on channels
  • show codecs: Display information on codecs
  • show conferences: Show status of conferences
  • show dialplan: Show dialplan
  • show hints: Show registered hints
  • show image formats: Displays image formats
  • show indications: Show a list of all country/indications
  • show locals: Show status of local channels
  • show manager command: Show manager commands
  • show manager connect: Show connected manager users
  • show parkedcalls: Lists parked calls
  • show queues: Show status of queues, see details here
  • show switches: Show alternative switches
  • show translation: Display translation matrix
  • soft hangup: Request a hangup on a given channel
  • show voicemail users: List defined voicemail boxes
  • show voicemail zones: List zone message formats

Server management

  • restart gracefully: Restart Asterisk gracefully, i.e. stop receiving new calls and restart at empty call volume
  • restart now: Restart Asterisk immediately
  • restart when convenient: Restart Asterisk at empty call volume

Note for Asterisk 1.2: Restart now is like a reload, not a real restart it just run the reload routines (thus open ports are not closed). Often you don't need really need to restart asterisk, instead just need to issue e.g. 'unload chan_sip.so' and 'load chan_sip.so'.

  • reload: Reload configuration
  • stop gracefully: Gracefully shut down Asterisk, i.e. stop receiving new calls and shut down at empty call volume
  • stop now: Shut down Asterisk imediately
  • stop when convenient: Shut down Asterisk at empty call volume
  • extensions reload: Reload extensions and only extensions
  • unload: Unload a dynamic module by name
  • show modules: List modules and info about them
  • show uptime: Show uptime information
  • show version: Display Asterisk version info

AGI commands

  • show agi: Show AGI commands or specific help
  • dump agihtml: Dumps a list of agi command in html format

Database handling commands

  • database del: Removes database key/value
  • database deltree: Removes database keytree/values
  • database get: Gets database value
  • database put: Adds/updates database value
  • database show: Shows database contents
  • database showkey: Shows database contents: An alternative to showing keys by family with database show, this command shows all the families with a particular key

IAX Channel commands

  • iax2 debug: Enable IAX debugging
  • iax2 no debug: Disable IAX debugging
  • iax2 set jitter: Sets IAX jitter buffer
  • iax2 show cache: Display IAX cached dialplan
  • iax2 show channels: Show active IAX channels
  • iax2 show netstats: Show network and jitter buffer statistics for active IAX calls
  • iax2 show peers: Show defined IAX peers
  • iax2 show registry: Show IAX registration status
  • iax2 show stats: Display IAX statistics
  • iax2 show users: Show defined IAX users
  • iax2 trunk debug: Request IAX trunk debug

  • iax debug: Enable IAX debugging
  • iax no debug: Disable IAX debugging
  • iax set jitter: Sets IAX jitter buffer
  • iax show cache: Display IAX cached dialplan
  • iax show channels: Show active IAX channels
  • iax show peers: Show defined IAX peers
  • iax show registry: Show IAX registration status
  • iax show stats: Display IAX statistics
  • iax show users: Show defined IAX users
  • init keys: Initialize RSA key passcodes
  • show keys: Displays RSA key information

H323 channel commands

  • h.323 debug: Enable chan_h323 debug
  • h.323 gk cycle: Manually re-register with the Gatekeper
  • h.323 hangup: Manually try to hang up a call
  • h.323 no debug: Disable chan_h323 debug
  • h.323 no trace: Disable H.323 Stack Tracing
  • h.323 show codecs: Show enabled codecs
  • h.323 show tokens: Manually try to hang up a call
  • h.323 trace: Enable H.323 Stack Tracing

SIP channel commands

  • sip debug: Enable SIP debugging
  • sip no debug: Disable SIP debugging
  • sip reload: Reload sip.conf (added after 0.7.1 on 2004-01-23)
  • sip show channels: Show active SIP channels
  • sip show channel: Show detailed SIP channel info
  • sip show inuse: List all inuse/limit
  • sip show peers: Show defined SIP peers (clients that register to your Asterisk server), see details here
  • sip show registry: Show SIP registration status (when Asterisk registers as a client to a SIP Proxy)
  • sip show subscriptions: Lists all sip presence (busy lamp indication) subscriptions
  • sip show users: Show defined SIP users

Zap channel commands


  • zap destroy channel: Destroy a channel
  • zap show channels: Show active zapata channels
  • zap show channel: Show information on a channel
  • zap show status: lists all the Zaptel spans. A span will apear here whether or not its channels are configured with chan_zap.
  • zap show cadences: Show the configured ring cadences (available e.g with Zap/1r2).
  • zap set swgain(<= 1.6): set the (software) gain for a hannel. Temporary equivalents of rxgain and txgain in zapata.conf.
  • zap set hwgain(<=1.6): set the hardware gain for channels that support it.
  • zap set dnd(<=1.6) set a channel's do-not-disturb mode on or off.

The following commands are available if the channel is built with support for libpri:

  • pri debug span: Enables PRI debugging on a span
  • pri intense debug span: Enables REALLY INTENSE PRI debugging
  • pri no debug span: Disables PRI debugging on a span
  • pri show spans: List spans and their status.
  • pri show span: Information about a span.
  • pri show debug: show where debug is enabled.

Bristuff adds bri debug which is an alias for pri debug.

TODO: SS7 support in 1.6.


MGCP channel commands

  • mgcp audit endpoint: Audit specified MGCP endpoint
  • mgcp debug: Enable MGCP debugging
  • mgcp no debug: Disable MGCP debugging
  • mgcp show endpoints: Show defined MGCP endpoints


skinny channel commands

  • skinny debug: Enable Skinny debugging
  • skinny no debug: Disable Skinny debugging
  • skinny show lines: Show defined Skinny lines per device

CAPI channel commands

  • capi debug: Enable CAPI debugging
  • capi no debug: Disable CAPI debugging
  • capi info: Show CAPI info

Sirrix ISDN channel commands


  • srx reload: Reload channel driver configuration; active calls are not being terminated!
  • srx show ccmsgs: Disable / enable output of incoming callcontrol messages.
  • srx show chans: Show info about B-Channels
  • srx show globals: Show info about global settings
  • srx show groups: Show info about configured groups
  • srx show layers: Show info about ISDN stack (Layer 1, 2, 3)
  • srx show sxpvts: Show private info about active channels
  • srx show timers: Show info about running timers


Batch files with CLI

If you meant "can Asterisk read a series of commands from a file" the
answer is no, but something like the following may do:

cat batch-file\
| awk '{printf "/usr/sbin/asterisk -r -x \"%s\"\n", $0}'\
| sh

The above is very slow, though. A faster option is to use socat and write the commands directly to the Asterisk socket.

  #!/bin/sh
  while read line
  do 
     echo -n "$line"
     sleep 0.001
  done \
  | socat STDIN UNIX-CONNECT:/var/run/asterisk/asterisk.ctl

The short sleep is only needed to guarantee that every line is written in a separate write() call. It will not print any output from any command, though, or even report an error. And you'll have to end your "programs" with a "quit" line.

See also




Created by oej, Last modification by JustRumours on Sat 26 of Apr, 2008 [00:12 UTC]

Comments Filter

no more 'extensions reload'

by Radu M on Thursday 30 of August, 2007 [03:28:05 UTC]
as of 1.4.11, 'extensions reload' has been replaced by 'dialplan reload'.

extensions reload

by Ashwini on Sunday 27 of August, 2006 [10:06:49 UTC]
I worked with an application where in i had to dynamically change the extensions.conf. I used #include <filename> to add more contexts to the extensions.conf. The problem i faced was that the asterisk server was executing calls all the time while i was updating the extensions.conf file. So i needed a way to reload the extensions alone without interrupting the call flow. extensions reload command does the trick for you without disturbing the call flow.

Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2008 VOIP-Info.org LLC

Powered by bitweaver