You are on page 1of 11

Search....

LOGIN | REGISTER

Home QuickLinks BusinessVOIP ResidentialVOIP SIP CallCenterSoftware

WholesaleVOIP Forums

View Discussion(3) History

AsteriskCLI
TheAsteriskcommandlineinterface(CLI)is
reachedbyusingtheLinuxshellcommand VoIPHardwareSolutions
asteriskrorrasterisk Provider SolutionDetails

Ifyouwantdebuggingoutput,addoneormany ZycooUCSolutions
ModularDesignIPPBX
v:s forSMB
asteriskvvvvvr Remoteoffice
Centralized Details
Managementsolution
3rdpartyapp
TheAsteriskserverhastoberunninginthe integration,Enterprise
Billing,Android&iOS
backgroundfortheCLItostart. client
IfyouwanttorunaCLIcommandinashellscript,
usethexoption Yeastar
Communications
asteriskrx"loggerreload" Solutions
CosteffectiveIPPBX Details
SolutionforSMB
ForhelpintheCLImode,usethecoreshow FXS,FXO,GSM,BRI
andPRIVoIPGateways
helpcommand(formerlyhelp).Togethelpon Richfeaturesand
variousapplicationsyoucanuseinthe reliableperformance

extensions.confconfigfile,usethecoreshow
applicationscommand(formerlyshow BusinessPBXSolutions
applications).
Provider SolutionDetails

Generalcommands
!<command>:Executesagivenshell
command
aborthalt:Cancelarunninghalt BecomeanITSP
addextension:Addnewextensioninto Now!
Becomeaserious
context competitorinVoIP
Immediately
addignorepat:Addnewignorepattern FULLConsultancy, Details
Installation,Training&
addindication:Addthegiven Support
SellHostedIPPBXs,Biz
indicationtothecountry Lines,CallCentre
TurnkeyProvisioningat
agentshow:Showstatusofagents yourdatacenter

debugchannel:Enabledebuggingon
3CXSoftwarePBX
achannel forWindows,Linux
dontinclude:Removeaspecified andtheCloud
OpenStandards
includefromcontext SoftwareSolution Details
EasytoInstalland
help:Displayhelplist,orspecifichelp Manage
AutoConfiguresPhones
onacommand &Trunks
Android,iOS,Windows
includecontext:Includecontextin &Macclients

othercontext *RatesshowndonotincludeE911chargesorgovernmentmandatedtaxes.
Providersofferingunlimitedcallingplansmayhaverestrictions.Read
load:Loadadynamicmodulebyname providerstermsandconditionscarefullybeforebuying.

loggerreload:Reopenlogfiles.Use
afterrotatingthelogfiles.
mixmonitor{start|stop|list}:ExecuteaMixMonitor
PageContents
command.
nodebugchannel:Disabledebuggingonachannel Generalcommands
originate:originateacall. Servermanagement
removeextension:Removeaspecifiedextension AGIcommands
removeignorepat:Removeignorepatternfromcontext Databasehandling
removeindication:Removethegivenindicationfrom commands
thecountry IAXChannelcommands
savedialplan:Overwritesyourcurrentextensions.conf H323channel
filewithanexportedversionbasedonthecurrentstate commands
ofthedialplan.Abackupcopyofyourold SIPchannelcommands
extensions.confisnotsaved.Theinitialvaluesofglobal Zapchannelcommands
variablesdefinedinthe[globals]categoryretaintheir Consolechannel
previousinitialvaluesthecurrentvaluesofglobal commands
variablesarenotwrittenintothenewextensions.conf. AsteriskchannelMGCP
(:exclaim:)Using"savedialplan"willresultinlosingany commands
commentsinyourcurrentextensions.conf.
skinnychannel
dialplansave(1.4):BROKEN,doesn'tparsecorrectly. commands
Overwritesyourcurrentextensions.conffilewithan
exportedversionbasedonthecurrentstateofthe AsteriskchannelCAPI
dialplan.Abackupcopyofyouroldextensions.confis commands
notsaved.Theinitialvaluesofglobalvariablesdefined SirrixISDNchannel
inthe[globals]categoryretaintheirpreviousinitial commands
valuesthecurrentvaluesofglobalvariablesarenot BatchfileswithCLI
writtenintothenewextensions.conf.(:exclaim:)Using Seealso
"savedialplan"willresultinlosinganycommentsinyour
currentextensions.conf.
setverbose:Setlevelofverboseness
showapplications:Showsregisteredapplications
showapplication:Describeaspecificapplication
showchannel:Displayinformationonaspecificchannel
showchannels:Displayinformationonchannels
showcodecs:Displayinformationoncodecs
showconferences:Showstatusofconferences
showdialplan:Showdialplan
showhints:Showregisteredhints
showimageformats:Displaysimageformats
showindications:Showalistofallcountry/indications
showlocals:Showstatusoflocalchannels
showmanagercommand:Showmanagercommands
showmanagerconnect:Showconnectedmanagerusers
showparkedcalls:Listsparkedcalls
showqueues:Showstatusofqueues,seedetailshere
showswitches:Showalternativeswitches
showtranslation:Displaytranslationmatrix
softhangup:RequestahanguponagivenchannelinAsterisk1.6.2:"channelrequest
hangup<name>"
showvoicemailusers:Listdefinedvoicemailboxes
showvoicemailzones:Listzonemessageformats
devstatechange:Changestateofacustomdevice(newinAsterisk1.6.0)

Servermanagement
restartgracefully:RestartAsteriskgracefully,i.e.stopreceivingnewcallsandrestartat
emptycallvolume
restartnow:RestartAsteriskimmediately
restartwhenconvenient:RestartAsteriskatemptycallvolume

NoteforAsterisk1.2:Restartnowislikeareload,notarealrestartitjustrunthereloadroutines(thus
openportsarenotclosed).Oftenyoudon'tneedreallyneedtorestartasterisk,insteadjustneedtoissue
e.g.'unloadchan_sip.so'and'loadchan_sip.so'.

reload:Reloadconfiguration
stopgracefully:GracefullyshutdownAsterisk,i.e.stopreceivingnewcallsandshutdown
atemptycallvolume
stopnow:ShutdownAsteriskimediately
stopwhenconvenient:ShutdownAsteriskatemptycallvolume
dialplanreload:Reloadextensionsandonlyextensions(formerlyextensionsreload)
unload:Unloadadynamicmodulebyname
showmodules:Listmodulesandinfoaboutthem
showuptime:Showuptimeinformation
showversion:DisplayAsteriskversioninfo

AGIcommands
showagi:ShowAGIcommandsorspecifichelp
dumpagihtml:Dumpsalistofagicommandinhtmlformat

Databasehandlingcommands
databasedel:Removesdatabasekey/value
databasedeltree:Removesdatabasekeytree/values
databaseget:Getsdatabasevalue
databaseput:Adds/updatesdatabasevalue
databaseshow:Showsdatabasecontents
databaseshowkey:Showsdatabasecontents:Analternativetoshowingkeysbyfamily
withdatabaseshow,thiscommandshowsallthefamilieswithaparticularkey

IAXChannelcommands
iax2debug:EnableIAXdebugging
iax2nodebug:DisableIAXdebugging
iax2setjitter:SetsIAXjitterbuffer
iax2showcache:DisplayIAXcacheddialplan
iax2showchannels:ShowactiveIAXchannels
iax2shownetstats:ShownetworkandjitterbufferstatisticsforactiveIAXcalls
iax2showpeers:ShowdefinedIAXpeers
iax2showregistry:ShowIAXregistrationstatus
iax2showstats:DisplayIAXstatistics
iax2showusers:ShowdefinedIAXusers
iax2trunkdebug:RequestIAXtrunkdebug

iaxdebug:EnableIAXdebugging
iaxnodebug:DisableIAXdebugging
iaxsetjitter:SetsIAXjitterbuffer
iaxshowcache:DisplayIAXcacheddialplan
iaxshowchannels:ShowactiveIAXchannels
iaxshowpeers:ShowdefinedIAXpeers
iaxshowregistry:ShowIAXregistrationstatus
iaxshowstats:DisplayIAXstatistics
iaxshowusers:ShowdefinedIAXusers
initkeys:InitializeRSAkeypasscodes
showkeys:DisplaysRSAkeyinformation

H323channelcommands
h.323debug:Enablechan_h323debug
h.323gkcycle:ManuallyreregisterwiththeGatekeper
h.323hangup:Manuallytrytohangupacall
h.323nodebug:Disablechan_h323debug
h.323notrace:DisableH.323StackTracing
h.323showcodecs:Showenabledcodecs
h.323showtokens:Manuallytrytohangupacall
h.323trace:EnableH.323StackTracing

SIPchannelcommands
Debugging
Enable
sipdebug
sipsetdebugon(validon1.6.2.7)
Disable
sipnodebug
sipsetdebugoff(validon1.6.2.7)
sipreload:Reloadsip.conf(addedafter0.7.1on20040123)
sipshowchannels:ShowactiveSIPchannels
sipshowchannel:ShowdetailedSIPchannelinfo
sipshowinuse:Listallinuse/limit
sipshowpeers:ShowdefinedSIPpeers(clientsthatregistertoyourAsteriskserver),see
detailshere
sipshowregistry:ShowSIPregistrationstatus(whenAsteriskregistersasaclienttoa
SIPProxy)
sipshowsubscriptions:Listsallsippresence(busylampindication)subscriptions
sipshowusers:ShowdefinedSIPusers

Zapchannelcommands

zapdestroychannel:Destroyachannel
zapshowchannels:Showactivezapatachannels
zapshowchannel:Showinformationonachannel
zapshowstatus:listsalltheZaptelspans.Aspanwillapearherewhetherornotits
channelsareconfiguredwithchan_zap.
zapshowcadences:Showtheconfiguredringcadences(availablee.gwithZap/1r2).
zapsetswgain(<=1.6):setthe(software)gainforahannel.Temporaryequivalentsof
rxgainandtxgaininzapata.conf.
zapsethwgain(<=1.6):setthehardwaregainforchannelsthatsupportit.
zapsetdnd(<=1.6)setachannel'sdonotdisturbmodeonoroff.

Thefollowingcommandsareavailableifthechannelisbuiltwithsupportforlibpri:

pridebugspan:EnablesPRIdebuggingonaspan
priintensedebugspan:EnablesREALLYINTENSEPRIdebugging
prinodebugspan:DisablesPRIdebuggingonaspan
prishowspans:Listspansandtheirstatus.
prishowspan:Informationaboutaspan.
prishowdebug:showwheredebugisenabled.

Seesection3ofAT&Ttr41459_99tobetterunderstandwhattheoutputgeneratedbythepridebug
commandmeans.

Bristuffaddsbridebugwhichisanaliasforpridebug.

TODO:SS7supportin1.6.

Consolechannelcommands
dial:Dialsthegivenextension,ifspecified,fromtheconsole.Canbeusedtoinitiateacall,
ortodialdigitsduringanexistingcall.
answer:Answeracallifoneiscurrentlyringingontheconsole.
hangup:Hangupthecallifthereiscurrentlyoneontheconsole.

AsteriskchannelMGCPcommands
mgcpauditendpoint:AuditspecifiedMGCPendpoint
mgcpdebug:EnableMGCPdebugging
mgcpnodebug:DisableMGCPdebugging
mgcpshowendpoints:ShowdefinedMGCPendpoints

skinnychannelcommands
skinnydebug:EnableSkinnydebugging
skinnynodebug:DisableSkinnydebugging
skinnyshowlines:ShowdefinedSkinnylinesperdevice

AsteriskchannelCAPIcommands
capidebug:EnableCAPIdebugging
capinodebug:DisableCAPIdebugging
capiinfo:ShowCAPIinfo

SirrixISDNchannelcommands

srxreload:Reloadchanneldriverconfigurationactivecallsarenotbeingterminated!
srxshowccmsgs:Disable/enableoutputofincomingcallcontrolmessages.
srxshowchans:ShowinfoaboutBChannels
srxshowglobals:Showinfoaboutglobalsettings
srxshowgroups:Showinfoaboutconfiguredgroups
srxshowlayers:ShowinfoaboutISDNstack(Layer1,2,3)
srxshowsxpvts:Showprivateinfoaboutactivechannels
srxshowtimers:Showinfoaboutrunningtimers

BatchfileswithCLI
Ifyoumeant"canAsteriskreadaseriesofcommandsfromafile"the
answerisno,butsomethinglikethefollowingmaydo:

catbatchfile\
|awk'{printf"/usr/sbin/asteriskrx\"%s\"\n",$0}'\
|sh

Theaboveisveryslow,though.Afasteroptionistousesocatandwritethecommandsdirectlytothe
Asterisksocket.

#!/bin/sh
whilereadline
do
echon"$line"
sleep0.001
done\
|socatSTDINUNIXCONNECT:/var/run/asterisk/asterisk.ctl

Anotherversionwithoutsocat:
#!/bin/sh
whilereadline;do
echo"$line"|tr'\n''\0'
sleep0.001
done|ncU/var/run/asterisk/asterisk.ctl

Theshortsleepisonlyneededtoguaranteethateverylineiswritteninaseparatewrite()call.Itwillnotprint
anyoutputfromanycommand,though,orevenreportanerror.Andyou'llhavetoendyour"programs"with
a"quit"line.

Seealso
Developmentbranch:CLIfilteringandpatch8849
PhoneGenieforAsteriskWebBasedControllerforAsteriskCLI.WorksfinewithAsterisk
1.2.x.
HowtochangetheCLIprompt

Asterisk|Tips&Tricks|FAQ|Applications|Introduction

Createdby:oej,Lastmodification:Fri15ofMay,2015(21:58UTC)byadmin

Linkstothispage...

Pleaseupdatethispagewithnewinformation,justloginandclickonthe"Edit"or"Discussion"tab.Geta
freeloginhere:RegisterThanks!FindusonGoogle+

PageChanges | Comments

Featured

BUSINESSVOIP
RESIDENTIALVOIP

LASTMODIFPAGES
1.IPPBX
2.VoIPHardware
3.HostedPBX
4.VoIPProvidersinVirginia
5.VoIPProvidersinAlaska
6.VoIPProvidersinUtah
7.voipinfo.org
8.ThirdlaneMultiTenant
PBX
9.ThirdlaneBusinessPBX
10.ThirdLane
ShowMore

VOIPSPEEDTEST

GETHELP

Askaquestion
VOIPgatewaycomparisons
byarlestercFri03ofMar,
2017
Re:WhydoeseveryonesayI
can't?
bypetikeFri24ofFeb,2017

Re:WhydoeseveryonesayI
can't?
bybutchmobileThu23of
Feb,2017

ViewMore...

TermsofService|PrivacyPolicy
20032017VOIPInfo.orgLLC

Poweredbybitweaver

You might also like