Sie sind auf Seite 1von 17

Asterisk: comandos bsicos y ejemplo bsico de centralita

1/17

ndice

INTRODUCCIN ................................................................................................................................................................... 3

Comandos bsicos de Asterisk ................................................................................... 3 Probar funciones por defecto ...................................................................................... 4


EJE P!O "#$ICO DE CON%I&URACIN DE CENTRA!ITA ................................................................................................................ 5

Confi'uraciones de (as cuentas o e)tensiones para e( cana( $IP ................................... 5 Confi'uraciones no tan bsicas .................................................................................. 7
AP*NDICE$ ........................................................................................................................................................................ 9

+C!I, core s-o. app(ications...................................................................................... 9 +C!I, core s-o. Dia( ............................................................................................... 12 +C!I, core s-o. /an'up ......................................................................................... 15 +C!I, core s-o. 0oice ai(....................................................................................... 15 +C!I, core s-o. "ack&round................................................................................... 16

Asterisk: comandos bsicos y ejemplo bsico de centralita

2/17

Asterisk: comandos bsicos y ejemplo bsico de centralita

3/17

Introduccin
Comandos bsicos de Asterisk Control de inicio/parada/estado del servidor:
# etc/init.d/asterisk #/etc/init.d/asterisk #/etc/init.d/asterisk #/etc/init.d/asterisk [start] stop restart status

# ps aux | grep asterisk

Conexin al CLI del servidor (una vez arrancado):


# asterisk r

Se puede pedir ms cantidad de informacin de realimentacin a la consola con v reiteradamente:


# asterisk rvvv Asterisk 1.8.10.1~dfsg-1ubuntu1, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> 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. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.8.10.1~dfsg-1ubuntu1 currently running on ubuntu00 (pid = 12007) Verbosity was 0 and is now 3 ubuntu00*CLI>

Para consultar comandos del CLI con el tabulador:


*CLI> <Tabulador>

Para ver la ayuda de un comando del CLI:


*CLI> help <comando> Ej) *CLI> help core restart when convenient

Para recargar configuraciones/parar/reiniciar Asterisk desde el CLI:


*CLI> *CLI> *CLI> *CLI> reload reload chan_sip.so reload chan_iax2.so dialplan reload Reacarga todas las configuraciones. Reacarga sip.conf y sip_notify.conf. Reacarga iax.conf y iaxprov.conf. Recarga extensions.conf

*CLI> core stop now Detiene Asterisk al momento. *CLI> core stop when convenient Detiene Asterisk cuando no haya actividad *CLI> core stop gracefully Detiene asterisk cuando no haya actividad y deja de aceptar peticiones de llamadas a a partir de este momento. *CLI> core restart now *CLI> core restart gracefully (lo mismo, pero reiniciando Asterisk)

Para ver el funcionamiento del canal SIP:


*CLI> sip show settings *CLI> sip show peer <usuario> *CLI> sip show peers *CLI> sip show registry ; *CLI> sip set debug on ; Muetra la configuracin global del canal Muestra la configuracin del usuario concreto Muestra los SIP peers (incluyendo friends) Muestra el estado de los hosts registrados Muetra todos los SIP messages (para depurar)

Asterisk: comandos bsicos y ejemplo bsico de centralita


*CLI> sip reload *CLI> sip Recarga el fichero de configuracin

4/17

Probar funciones por defecto Se puede probar alguna de las funciones de Asterisk con las demos que hay preparadas en los ficheros de configuracin por defecto. Para escuchar el mensaje de presentacin y seguir sus pasos en una llamada al exterior (demo de Asterisk Digium):
*CLI> console dial 1000

Otros comandos de consola que simulan el manejo de un telfono:


*CLI> console answer *CLI> console hangup

Para ver todos y una breve explicacin:


CLI> help console

Para grabar un mensaje de voz a un usuario prexistente:


*CLI> console dial 1234@default *CLI> console hangup

Para recuperar un mensaje de voz del usuario prexistente:


*CLI> console dial 1234

Asterisk: comandos bsicos y ejemplo bsico de centralita

5/17

Ejemplo bsico de configuracin de centralita


Vamos a declarar de forma bsica cuentas de usuarios locales (extensiones telefnicas), que incluyan buzn de voz y permitiremos el establecimiento de llamadas entre ellos. Ficheros a editar (en /etc/asterisk): sip.conf, extensions.conf y voicemail.conf. Crearemos los usuarios: Mortadelo Pi, Filemn Prez, Saturnino Bacterio y Ofelia Michelnez. Configuraciones de las cuentas o extensiones para el canal SIP Ref. (Asterisk: The Definitive Guide > 5. User Device Configuration > Configuring Asterisk > sip.conf):
-ttp122...3asteriskdocs3or'2en24rd5Edition2asterisk6book6-tm(6c-unk2De7iceConfi'5id89:4;93-tm(<De7iceConfi'5id8=9>?9

Tipo de extensiones o usuarios:


type = peer user friend Description Match incoming requests to a configuration entry using the source IP address and port number. Match incoming requests to a configuration entry using the username in the From header of the SIP request. This name is matched to a section in sip.conf with the same name in square brackets. This enables matching rules for both peer and user. This is the setting most commonly used for SIP phones.

;; fichero /etc/asterisk/sip.conf [general] context=default port=5060 ; puerto de escucha bindaddr=0.0.0.0 ; para que Asterisk escuche en cualquier IPv4 ; bindadd=:: ; para que Asterisk escuche en cualquier IPv4/IPv6 disallow=all allow=gsm allow=ulaw allow=alaw ;; aadir al final de sip.conf: [mortadelo] ;Mortadelo Pi type=friend username=mortadelo secret=1111 host=dynamic context=usuarios-locales [filemon] ;Mortadelo Pi type=friend username=filemon secret=2222 host=dynamic context=usuarios-locales [bacterio] ;Saturnino Bacterio type=friend username=bacterio secret=3333 host=dynamic context=usuarios-locales

Asterisk: comandos bsicos y ejemplo bsico de centralita


[ofelia] ;Ofelia Michelnez type=friend username=ofelia secret=4444 host=dynamic context=usuarios-locales [sarenet] ;proveedor type=peer host=10.11.114.200 disallow=all allow=g729 allow=gsm fromuser=ofelia secret=muysecreto

6/17

Recargamos la configuracin con reload o sip reload. Para ver la configuracin resultante:
*CLI> sip show <TABULADOR> *CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status bacterio (Unspecified) D N 0 Unmonitored filemon (Unspecified) D N 0 Unmonitored ofelia (Unspecified) D N 0 Unmonitored sarenet 10.11.114.200 N 5060 Unmonitored usuario-local (Unspecified) D N 0 Unmonitored 5 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 4 offline]

Otra forma de configurar lo de arriba con plantillas o templates (para ver cmo se usan: -ttps122.iki3asterisk3or'2.iki2disp(a@2A$T2Usin'ATemp(ates):
;; fichero /etc/asterisk/sip.conf con templates [general] context=default port=5060 ; puerto de escucha bindaddr=0.0.0.0 ; para que Asterisk escuche en cualquier IPv4 ; bindadd=:: ; para que Asterisk escuche en cualquier IPv4/IPv6 disallow=all allow=gsm allow=ulaw allow=alaw ;; aadir al final de sip.conf: [usuario-local] (!) ;Template usuario Oficina type=friend host=dynamic context=usuarios-locales [filemon](usuario-local) ;Filemon Prez secret=2222 [bacterio](usuario-local) ;Saturnino Bacterio secret=3333 [ofelia](usuario-local) ;Ofelia Michelnez secret=4444

Asterisk: comandos bsicos y ejemplo bsico de centralita


[sarenet] ;proveedor type=peer host=10.11.114.200 disallow=all allow=g729 allow=gsm fromuser=ofelia secret=muysecreto

7/17

Configuraciones del plan de marcacin (dialplan):


;; fichero /etc/asterisk/extensions.conf [general] Autofallthrough=yes Clearglobal=yes [globals] CONSOLE=Console/dsp [default] ;sin entradas an [usuarios-locales] include => demo ;coincide con el contesto nombrado en sip.conf ; para llamar al exterior con el conte<xto demo

exten => 250,1,Dial(SIP/mortadelo,30,Ttm) exten => 250,2,Voicemail(250@usuarios-locales-vm,u) exten => 251,1,Dial(SIP/filemon,30,Ttm) exten => 251,2,Voicemail(251@usuarios-locales-vm,u) exten => 252,1,Dial(SIP/bacterio,30,Ttm) exten => 252,2,Voicemail(252@usuarios-locales-vm,u) exten => 253,1,Dial(SIP/ofelia,30,Ttm) exten => 253,2,Voicemail(253@usuarios-locales-vm,u) ;; Llamadas directas entre usuarios locales: exten => _2XX,1,Dial(SIP/${EXTEN},30,Ttm) exten => _2XX,n,Voicemail(${EXTEN}@usuarios-locales-vm,u) exten => _2XX,n,Hangup ;; Recuperar mensajes de voz marcando la extensin 550: exten => 550,1,VoicemailMain(@usuarios-locales-vm)

Recargamos la configuracin con reload o dialplan reload. Para ver la configuracin resultante:
*CLI> sip show <TABULADOR>

Por ejemplo:
*CLI> *CLI> *CLI> *CLI> sip show sip show sip show dialplan demo default <TABULADOR> show [[exten@]context]

Por ejemplo para ver la configuracin de la extensin 250:


*CLI> dialplan show 250@usuarios-locales [ Context 'usuarios-locales' created by 'pbx_config' ] '250' => 1. Dial(SIP/mortadelo,30,Ttm) 2. Voicemail(250@usuarios-locales-vm,u) '_2XX' => 1. Dial(SIP/${EXTEN},30,Ttm) 2. Voicemail(${EXTEN}@usuarios-locales-vm,u)

[pbx_config] [pbx_config] [pbx_config] [pbx_config]

Asterisk: comandos bsicos y ejemplo bsico de centralita


3. Hangup() [pbx_config] [ Included context 'stdexten' created by 'pbx_config' ] '_X.' => 50000. NoOp(Start stdexten) [pbx_config] 50001. Set(LOCAL(ext)=${EXTEN}) [pbx_config] 50002. Set(LOCAL(dev)=${ARG1}) [pbx_config] 50003. Set(LOCAL(cntx)=${ARG2}) [pbx_config] 50004. Set(LOCAL(mbx)=${ext}${IF($[!${ISNULL(${cntx})}]?@${cntx})}) [pbx_config] 50005. Dial(${dev},20) [pbx_config] 50006. Goto(stdexten-${DIALSTATUS},1) [pbx_config]

8/17

-= 3 extensions (12 priorities) in 2 contexts. =-

Configuraciones de los buzones de voz:


;; fichero /etc/asterisk/voicemail.conf [general] format=wav49 skipms=3000 maxsilence=10 silencethreshold=128 maxlogins=3 [usuarios-locales-vm] ;;uso: n buzn => contrasea, usuario, cuenta de correo 250 => 123,Mortadelo Pi,mortadelo@aula.com 251 => 456,Filemn Prez,filemon@aula.com 252 => 789,Saturnino Bacterio,bacterio@aula.com

Recargamos la configuracin con reload o voicemail reload. Para ver la configuracin resultante:
*CLI> voicemail show <TABULADOR> *CLI> voicemail show users Context Mbox User default 1234 Example Mailbox other 1234 Company2 User usuarios-locales-vm 250 Mortadelo Pi usuarios-locales-vm 251 Filemn Prez usuarios-locales-vm 252 Saturnino Bacterio 5 voicemail users configured.

Zone

NewMsg 0 0 0 0 0

Para grabar un mensaje de voz a Mortadelo:


*CLI> console dial 250@default *CLI> console hangup

Para que Mortadelo recupere un mensaje de voz grabado:


*CLI> console dial 250 *CLI> console hangup

Configuraciones no tan bsicas Converting Music to a Format That Works Best with Asterisk: ver en
-ttp122...3asteriskdocs3or'2en24rd5Edition2asterisk6book6-tm(6c-unk2additiona(5confi'uration5tasks6musicon-o(d6conf6 fi(e3-tm(<Initia(Confi'5id8::8B=

Asterisk: comandos bsicos y ejemplo bsico de centralita

9/17

Apndices
*CLI> core show applications Este comando nos muestra las aplicaciones que se pueden usar en /etc/asterisk/extensions.conf para definir las acciones que se aplican a una llamada. Para ver una lista detallada y ms legible de las aplicaciones que admite Asterisk ver el enlace: -ttp122...3asteriskdocs3or'2en24rd5Edition2asterisk6book6-tm(6c-unk2asterisk6C/P6B6$ECT6
93-tm(<Arc-itecture5id8;9;88

Para ver una breve lista de las aplicaciones bsicas o comunes:


-ttp122...3.ikiasterisk3com2inde)3p-pCtit(eDAp(icaciones5"EC4EA9sicas
-= Registered Asterisk Applications =AddQueueMember: Dynamically adds queue members. ADSIProg: Load Asterisk ADSI Scripts into phone AgentLogin: Call agent login. AgentMonitorOutgoing: Record agent's outgoing call. AGI: Executes an AGI compliant application AlarmReceiver: Provide support for receiving alarm reports from a burglar or fire alarm panel. AMD: Attempt to detect answering machines. Answer: Answer a channel if ringing. Authenticate: Authenticate a user

BackGround: Play an audio file while waiting for digits of an extension to go


to.

Background a file with talk detect. Bridge two channels. Indicate the Busy condition. Change monitoring filename of a channel Check channel availability Redirects given channel to a dialplan target Listen to a channel, and optionally whisper into it. Clear the keys from a specified hashname. Conference bridge application. Indicate the Congestion condition. Restart a While loop. Play a file with fast forward and rewind. Accept an R2 call if its not already accepted (you still need to answer it) DAHDIBarge: Barge in (monitor) DAHDI channel. DAHDIRAS: Executes DAHDI ISDN RAS application. DAHDIScan: Scan DAHDI channels to monitor calls. DAHDISendKeypadFacility: Send digits out of band over a PRI. DateTime: Says a specified time in a custom format. DBdel: Delete a key from the asterisk database. DBdeltree: Delete a family or keytree from the asterisk database. DeadAGI: Executes AGI on a hungup channel

BackgroundDetect: Bridge: Busy: ChangeMonitor: ChanIsAvail: ChannelRedirect: ChanSpy: ClearHash: ConfBridge: Congestion: ContinueWhile: ControlPlayback: DAHDIAcceptR2Call:

Dial: Attempt to connect to another device or endpoint and bridge the


call.

Dictate: Directory: DISA: DumpChan: EAGI: Echo: EndWhile: Exec: ExecIf: time.

Virtual Dictation Machine. Provide directory of voicemail extensions. Direct Inward System Access. Dump Info About The Calling Channel. Executes an EAGI compliant application Echo audio, video, DTMF back to the calling party End a while loop. Executes dialplan application. Executes dialplan application, conditionally. ExecIfTime: Conditional application execution based on the current

ExitWhile: End a While loop.

Asterisk: comandos bsicos y ejemplo bsico de centralita


ExtenSpy: ExternalIVR: Festival: Flash: FollowMe: ForkCDR: GetCPEID: Gosub: GosubIf: Goto: GotoIf: GotoIfTime: Hangup: IAX2Provision: ICES: ImportVar: Incomplete: JabberSend: JabberStatus: Log: Macro: MacroExclusive: MacroExit: MacroIf: MailboxExists: MeetMe: MeetMeAdmin: MeetMeChannelAdmin: MeetMeCount: Milliwatt: MinivmAccMess: MinivmDelete: MinivmGreet: mailbox. MinivmNotify: Notify voicemail owner about new messages. MinivmRecord: Receive Mini-Voicemail and forward via e-mail. MixMonitor: Record a call and mix the audio during the recording. Use of StopMixMonitor is required to guarantee the audio file is available for processing during dialplan execution. Monitor: Monitor a channel Morsecode: Plays morse code. MP3Player: Play an MP3 file or stream. MSet: Set channel variable(s) or function value(s). MusicOnHold: Play Music On Hold indefinitely NBScat: Play an NBS local stream. NoCDR: Tell Asterisk to not maintain a CDR for the current call NoOp: Do Nothing (No Operation). ODBC_Commit: Commits a currently open database transaction. ODBC_Rollback: Rollback a currently open database transaction. ODBCFinish: Clear the resultset of a sucessful multirow query. Originate: Originate a call. Page: Page series of phones Park: Park yourself. ParkAndAnnounce: Park and Announce. ParkedCall: Answer a parked call. PauseMonitor: Pause monitoring of a channel PauseQueueMember: Pauses a queue member. Pickup: Directed extension call pickup. PickupChan: Pickup a ringing channel. Playback: Play a file. PlayTones: Play a tone list. PrivacyManager: Require phone number to be entered, if no CallerID sent Proceeding: Indicate proceeding. Progress: Indicate progress. Queue: Queue a call for a call queue. QueueLog: Writes to the queue_log file. RaiseException: Handle an exceptional condition. Listen to a channel, and optionally whisper into it. Interfaces with an external IVR application Say text to the user. Flashes a DAHDI Trunk. Find-Me/Follow-Me application. Forks the Call Data Record. Get ADSI CPE ID. Jump to label, saving return address. Conditionally jump to label, saving return address. Jump to a particular priority, extension, or context. Conditional goto. Conditional Goto based on the current time. Hang up the calling channel. Provision a calling IAXy with a given template. Encode and stream using 'ices'. Import a variable from a channel into a new variable. Returns AST_PBX_INCOMPLETE value. Send a Jabber Message Retrieve the status of a jabber list member Send arbitrary text to a selected log level. Macro Implementation. Exclusive Macro Implementation. Exit from Macro. Conditional Macro implementation. Check to see if Voicemail mailbox exists. MeetMe conference bridge. MeetMe conference administration. MeetMe conference Administration (channel specific). MeetMe participant count. Generate a Constant 1004Hz tone at 0dbm (mu-law). Record account specific messages. Delete Mini-Voicemail voicemail messages. Play Mini-Voicemail prompts. MinivmMWI: Send Message Waiting Notification to subscriber(s) of

10/17

Asterisk: comandos bsicos y ejemplo bsico de centralita


Read: Read a variable. ReadExten: Read an extension into a variable. ReadFile: Read the contents of a text file into a channel variable. ReceiveFAX: Receive a Fax Record: Record to a file. RemoveQueueMember: Dynamically removes queue members. ResetCDR: Resets the Call Data Record.

11/17

RetryDial: Place a call, retrying on failure allowing an optional exit


extension.

Return: Ringing: SayAlpha: SayDigits: SayNumber: SayPhonetic: SayUnixTime: SendDTMF: SendFAX: SendImage: SendText: SendURL: Set: SetAMAFlags: SetCallerPres: SetMusicOnHold: SIPAddHeader: SIPDtmfMode: SIPRemoveHeader: SLAStation: SLATrunk: SMS:

Return from gosub routine. Indicate ringing tone. Say Alpha. Say Digits. Say Number. Say Phonetic. Says a specified time in a custom format. Sends arbitrary DTMF digits Send a Fax Sends an image file. Send a Text Message. Send a URL. Set channel variable or function value. Set the AMA Flags. Set CallerID Presentation. Set default Music On Hold class Add a SIP header to the outbound call. Change the dtmfmode for a SIP call. Remove SIP headers previously added with SIPAddHeader Shared Line Appearance Station. Shared Line Appearance Trunk. Communicates with SMS service centres and SMS capable

analogue phones.
SoftHangup: Hangs up the requested channel. SpeechActivateGrammar: Activate a grammar. SpeechBackground: Play a sound file and wait for speech to be recognized. SpeechCreate: Create a Speech Structure. SpeechDeactivateGrammar: Deactivate a grammar. SpeechDestroy: End speech recognition. SpeechLoadGrammar: Load a grammar. SpeechProcessingSound: Change background processing sound. SpeechStart: Start recognizing voice in the audio stream. SpeechUnloadGrammar: Unload a grammar. StackPop: Remove one address from gosub stack. StartMusicOnHold: Play Music On Hold StopMixMonitor: Stop recording a call through MixMonitor, and free the recording's file handle. StopMonitor: Stop monitoring a channel StopMusicOnHold: Stop Playing Music On Hold StopPlayTones: Stop playing a tone list. System: Execute a system command. TestClient: Execute Interface Test Client. TestServer: Execute Interface Test Server. Transfer: Transfer caller to remote extension. TryExec: Executes dialplan application, always returning. TrySystem: Try executing a system command. UnpauseMonitor: Unpause monitoring of a channel UnpauseQueueMember: Unpauses a queue member. UserEvent: Send an arbitrary event to the manager interface. Verbose: Send arbitrary text to verbose output. VMAuthenticate: Authenticate with Voicemail passwords. VoiceMail: Leave a Voicemail message. VoiceMailMain: Check Voicemail messages. Wait: Waits for some time. WaitExten: Waits for an extension to be entered. WaitForNoise: Waits for a specified amount of noise. WaitForRing: Wait for Ring Application. WaitForSilence: Waits for a specified amount of silence. WaitMusicOnHold: Wait, playing Music On Hold WaitUntil: Wait (sleep) until the current time is the given epoch.

Asterisk: comandos bsicos y ejemplo bsico de centralita


While: Start a while loop. Zapateller: Block telemarketers with SIT. -= 176 Applications Registered =-

12/17

*CLI> core show Dial


-= Info about application 'Dial' =[Synopsis] Attempt to connect to another device or endpoint and bridge the call. [Description] This application will place calls to one or more specified channels. As soon as one of the requested channels answers, the originating channel will be answered, if it has not already been answered. These two channels will then be active in a bridged call. All other channels that were requested will then be hung up. Unless there is a timeout specified, the Dial application will wait indefinitely until one of the called channels answers, the user hangs up, or if all of the called channels are busy or unavailable. Dialplan executing will continue if no requested channels can be called, or if the timeout expires. This application will report normal termination if the originating channel hangs up, or if the call is bridged and either of the parties in the bridge ends the call. If the ${OUTBOUND_GROUP} variable is set, all peer channels created by this application will be put into that group (as in Set(GROUP()=...). If the ${OUTBOUND_GROUP_ONCE} variable is set, all peer channels created by this application will be put into that group (as in Set(GROUP()=...). Unlike OUTBOUND_GROUP, however, the variable will be unset after use. This application sets the following channel variables: ${DIALEDTIME}: This is the time from dialing a channel until when it is disconnected. ${ANSWEREDTIME}: This is the amount of time for actual call. ${DIALSTATUS}: This is the status of the call CHANUNAVAIL CONGESTION NOANSWER BUSY ANSWER CANCEL DONTCALL: For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the 'Go Away' script. TORTURE: For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the 'torture' script. INVALIDARGS [Syntax] Dial(Technology/Resource[&Technology2/Resource2[&...]][,timeout[,options[,URL]]]) [Arguments] Technology/Resource Specification of the device(s) to dial. These must be in the format of 'Technology/Resource', where <Technology> represents a particular channel driver, and <Resource> represents a resource available to that particular channel driver. Technology2/Resource2 Optional extra devices to dial in parallel If you need more then one enter them as Technology2/Resource2&Te chnology3/Resourse3&..... timeout Specifies the number of seconds we attempt to dial the specified devices If not specified, this defaults to 136 years. options A(x): x - The file to play to the called party

Asterisk: comandos bsicos y ejemplo bsico de centralita


Play an announcement to the called party, where <x> is the prompt to be played C: Reset the call detail record (CDR) for this call. c: If the Dial() application cancels this call, always set the flag to tell the channel driver that the call is answered elsewhere. d: Allow the calling user to dial a 1 digit extension while waiting for a call to be answered. Exit to that extension if it exists in the current context, or the context defined in the ${EXITCONTEXT} variable, if it exists. D([called][:calling]): Send the specified DTMF strings *after* the called party has answered, but before the call gets bridged. The <called> DTMF string is sent to the called party, and the <calling> DTMF string is sent to the calling party. Both arguments can be used alone. e: Execute the 'h' extension for peer after the call ends f: Force the callerid of the *calling* channel to be set as the extension associated with the channel using a dialplan 'hint'. For example, some PSTNs do not allow CallerID to be set to anything other than the number assigned to the caller. F([[context^]exten^]priority): When the caller hangs up, transfer the called party to the specified destination and continue execution at that location. g: Proceed with dialplan execution at the next priority in the current extension if the destination channel hangs up. G([[context^]exten^]priority): If the call is answered, transfer the calling party to the specified <priority> and the called party to the specified <priority> plus one. NOTE: You cannot use any additional action post answer options in conjunction with this option. h: Allow the called party to hang up by sending the '*' DTMF digit. H: Allow the calling party to hang up by hitting the '*' DTMF digit. i: Asterisk will ignore any forwarding requests it may receive on this dial attempt. k: Allow the called party to enable parking of the call by sending the DTMF sequence defined for call parking in "features.conf". K: Allow the calling party to enable parking of the call by sending the DTMF sequence defined for call parking in "features.conf". L(x[:y[:z]]): x - Maximum call time, in milliseconds y - Warning time, in milliseconds z - Repeat time, in milliseconds Limit the call to <x> milliseconds. Play a warning when <y> mill iseconds are left. Repeat the warning every <z> milliseconds until time expires. This option is affected by the following variables: ${LIMIT_PLAYAUDIO_CALLER}: yes no If set, this variable causes Asterisk to play the prompts to the caller. ${LIMIT_PLAYAUDIO_CALLEE}: yes no If set, this variable causes Asterisk to play the prompts to the callee. ${LIMIT_TIMEOUT_FILE}: filename If specified, <filename> specifies the sound prompt to play when the timeout is reached. If not set, the time remaining will be announced. ${LIMIT_CONNECT_FILE}: filename If specified, <filename> specifies the sound prompt to play when the call begins. If not set, the time remaining will be announced. ${LIMIT_WARNING_FILE}: filename If specified, <filename> specifies the sound prompt to play as a warning when time <x> is reached. If not set, the time remaining will be announced. m([class]): Provide hold music to the calling party until a requested

13/17

Asterisk: comandos bsicos y ejemplo bsico de centralita


channel answers. A specific music on hold <class> (as defined in "mus iconhold.conf") can be specified. M(macro[^arg[^...]]): macro - Name of the macro that should be executed. arg - Macro arguments Execute the specified <macro> for the *called* channel before connecting to the calling channel. Arguments can be specified to the Macro using '^' as a delimiter. The macro can set the variable ${MACRO_RESULT} to specify the following actions after the macro is finished executing: ${MACRO_RESULT}: If set, this action will be taken after the macro finished executing. ABORT: Hangup both legs of the call CONGESTION: Behave as if line congestion was encountered BUSY: Behave as if a busy signal was encountered CONTINUE: Hangup the called party and allow the calling party to continue dialplan execution at the next priority GOTO:<context>^<exten>^<priority>: Transfer the call to the specified destination. NOTE: You cannot use any additional action post answer options in conjunction with this option. Also, pbx services are not run on the peer (called) channel, so you will not be able to set timeouts via the TIMEOUT() function in this macro. WARNING!!!: Be aware of the limitations that macros have, specifically with regards to use of the 'WaitExten' application. For more information, see the documentation for Macro() n([delete]): delete - With <delete> either not specified or set to '0', the recorded introduction will not be deleted if the caller hangs up while the remote party has not yet answered. With <delete> set to '1', the introduction will always be deleted. This option is a modifier for the call screening/privacy mode. (See the 'p' and 'P' options.) It specifies that no introductions are to be saved in the "priv-callerintros" directory. N: This option is a modifier for the call screening/privacy mode. It specifies that if Caller*ID is present, do not screen the call. o: Specify that the Caller*ID that was present on the *calling* channel be set as the Caller*ID on the *called* channel. This was the behavior of Asterisk 1.0 and earlier. O([mode]): mode - With <mode> either not specified or set to '1', the originator hanging up will cause the phone to ring back immediately. With <mode> set to '2', when the operator flashes the trunk, it will ring their phone back. Enables *operator services* mode. This option only works when bridging a DAHDI channel to another DAHDI channel only. if specified on non-DAHDI interfaces, it will be ignored. When the destination answers (presumably an operator services station), the originator no longer has control of their line. They may hang up, but the switch will not release their line until the destination party (the operator) hangs up. p: This option enables screening mode. This is basically Privacy mode without memory. P([x]): Enable privacy mode. Use <x> as the family/key in the AstDB database if it is provided. The current extension is used if a database family/key is not specified. r: Indicate ringing to the calling party, even if the called party isn't actually ringing. Pass no audio to the calling party until the called channel has answered. S(x): Hang up the call <x> seconds *after* the called party has answered the call. t: Allow the called party to transfer the calling party by sending the DTMF sequence defined in "features.conf". This setting does not perform policy enforcement on transfers initiated by other methods. T: Allow the calling party to transfer the called party by sending the DTMF sequence defined in "features.conf". This setting does not perform policy enforcement on transfers initiated by other methods. U(x[^arg[^...]]): x - Name of the subroutine to execute via Gosub arg - Arguments for the Gosub routine

14/17

Asterisk: comandos bsicos y ejemplo bsico de centralita


Execute via Gosub the routine <x> for the *called* channel before connecting to the calling channel. Arguments can be specified to the Gosub using '^' as a delimiter. The Gosub routine can set the variable ${GOSUB_RESULT} to specify the following actions after the Gosub returns. ${GOSUB_RESULT}: ABORT: Hangup both legs of the call. CONGESTION: Behave as if line congestion was encountered. BUSY: Behave as if a busy signal was encountered. CONTINUE: Hangup the called party and allow the calling party to continue dialplan execution at the next priority. GOTO:<context>^<exten>^<priority>: Transfer the call to the specified priority. Optionally, an extension, or extension and priority can be specified. NOTE: You cannot use any additional action post answer options in conjunction with this option. Also, pbx services are not run on the peer (called) channel, so you will not be able to set timeouts via the TIMEOUT() function in this routine. w: Allow the called party to enable recording of the call by sending the DTMF sequence defined for one-touch recording in "features.conf". W: Allow the calling party to enable recording of the call by sending the DTMF sequence defined for one-touch recording in "features.conf". x: Allow the called party to enable recording of the call by sending the DTMF sequence defined for one-touch automixmonitor in "features.conf". X: Allow the calling party to enable recording of the call by sending the DTMF sequence defined for one-touch automixmonitor in "features.conf". URL The optional URL will be sent to the called party if the channel driver supports it. [See Also] Not available

15/17

*CLI> core show Hangup


-= Info about application 'Hangup' =[Synopsis] Hang up the calling channel. [Description] This application will hang up the calling channel. [Syntax] Hangup([causecode]) [Arguments] causecode If a <causecode> is given the channel's hangup cause will be set to the given value. [See Also] Answer(), Busy(), Congestion()

*CLI> core show VoiceMail


-= Info about application 'VoiceMail' =[Synopsis] Leave a Voicemail message. [Description] This application allows the calling party to leave a message for the specified

Asterisk: comandos bsicos y ejemplo bsico de centralita


list of mailboxes. When multiple mailboxes are specified, the greeting will be taken from the first mailbox specified. Dialplan execution will stop if the specified mailbox does not exist. The Voicemail application will exit if any of the following DTMF digits are received: 0 - Jump to the 'o' extension in the current dialplan context. * - Jump to the 'a' extension in the current dialplan context. This application will set the following channel variable upon completion: ${VMSTATUS}: This indicates the status of the execution of the VoiceMail application. SUCCESS USEREXIT FAILED [Syntax] VoiceMail(mailbox[@context][&mailbox[@context][&...]][,options]) [Arguments] options b: Play the 'busy' greeting to the calling party. d([c]): Accept digits for a new extension in context <c>, if played during the greeting. Context defaults to the current context. g(#): Use the specified amount of gain when recording the voicemail message. The units are whole-number decibels (dB). Only works on supported technologies, which is DAHDI only. s: Skip the playback of instructions for leaving a message to the calling party. u: Play the 'unavailable' greeting. U: Mark message as 'URGENT'. P: Mark message as 'PRIORITY'. [See Also] Not available

16/17

*CLI> core show BackGround


-= Info about application 'BackGround' =[Synopsis] Play an audio file while waiting for digits of an extension to go to. [Description] This application will play the given list of files *(do not put extension)* while waiting for an extension to be dialed by the calling channel. To continue waiting for digits after this application has finished playing files, the 'WaitExten' application should be used. If one of the requested sound files does not exist, call processing will be terminated. This application sets the following channel variable upon completion: ${BACKGROUNDSTATUS}: The status of the background attempt as a text string. SUCCESS FAILED [Syntax] BackGround(filename1[&filename2[&...]][,options[,langoverride[,context]]]) [Arguments] options s: Causes the playback of the message to be skipped if the channel is not in the 'up' state (i.e. it hasn't been answered yet). If this happens, the application will return immediately. n: Don't answer the channel before playing the files. m: Only break if a digit hit matches a one digit extension in the destination context. langoverride Explicitly specifies which language to attempt to use for the

Asterisk: comandos bsicos y ejemplo bsico de centralita


requested sound files. context This is the dialplan context that this application will use when exiting to a dialed extension. [See Also]

17/17

Das könnte Ihnen auch gefallen