17
Asterisk: comandos básicos y ejemplo básico de centralita 1/17 Índice INTRODUCCIÓN ................................................................................................................................................................... 3 Comandos básicos de Asterisk ................................................................................... 3 Probar funciones por defecto ...................................................................................... 4 EJEMPLO BÁSICO DE CONFIGURACIÓN DE CENTRALITA ................................................................................................................ 5 Configuraciones de las cuentas o extensiones para el canal SIP ................................... 5 Configuraciones no tan básicas .................................................................................. 7 APÉNDICES ........................................................................................................................................................................ 9 *CLI> core show applications...................................................................................... 9 *CLI> core show Dial ............................................................................................... 12 *CLI> core show Hangup ......................................................................................... 15 *CLI> core show VoiceMail ....................................................................................... 15 *CLI> core show BackGround................................................................................... 16

Asterisk-comandos básicos y ejemplo básico.pdf

Embed Size (px)

Citation preview

  • Asterisk: comandos bsicos y ejemplo bsico de centralita 1/17

    ndice

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

    Comandos bsicos de Asterisk ................................................................................... 3

    Probar funciones por defecto ...................................................................................... 4

    EJEMPLO BSICO DE CONFIGURACIN DE CENTRALITA ................................................................................................................ 5

    Configuraciones de las cuentas o extensiones para el canal SIP ................................... 5

    Configuraciones no tan bsicas .................................................................................. 7

    APNDICES ........................................................................................................................................................................ 9

    *CLI> core show applications...................................................................................... 9

    *CLI> core show Dial ............................................................................................... 12

    *CLI> core show Hangup ......................................................................................... 15

    *CLI> core show VoiceMail ....................................................................................... 15

    *CLI> core show BackGround ................................................................................... 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 [start] #/etc/init.d/asterisk stop #/etc/init.d/asterisk restart #/etc/init.d/asterisk 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 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>

    Para ver la ayuda de un comando del CLI: *CLI> help Ej) *CLI> help core restart when convenient

    Para recargar configuraciones/parar/reiniciar Asterisk desde el CLI: *CLI> reload Reacarga todas las configuraciones. *CLI> reload chan_sip.so Reacarga sip.conf y sip_notify.conf. *CLI> reload chan_iax2.so Reacarga iax.conf y iaxprov.conf. *CLI> dialplan reload 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 (lo mismo, pero reiniciando Asterisk) *CLI> core restart gracefully

    Para ver el funcionamiento del canal SIP: *CLI> sip show settings Muetra la configuracin global del canal *CLI> sip show peer Muestra la configuracin del usuario concreto

    *CLI> sip show peers Muestra los SIP peers (incluyendo friends) *CLI> sip show registry Muestra el estado de los hosts registrados ; *CLI> sip set debug on Muetra todos los SIP messages (para depurar) ;

  • Asterisk: comandos bsicos y ejemplo bsico de centralita 4/17

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

    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): http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/DeviceConfig_id216341.html#DeviceConfig_id291081

    Tipo de extensiones o usuarios: type = Description peer Match incoming requests to a configuration entry using the source IP address and port number.

    user 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.

    friend 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 6/17

    [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

    Recargamos la configuracin con reload o sip reload.

    Para ver la configuracin resultante: *CLI> sip show *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: https://wiki.asterisk.org/wiki/display/AST/Using+Templates):

    ;; 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 7/17

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

    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] ;coincide con el contesto nombrado en sip.conf include => demo ; para llamar al exterior con el conte 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

    Por ejemplo: *CLI> sip show demo *CLI> sip show default *CLI> sip show *CLI> dialplan 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) [pbx_config] 2. Voicemail(250@usuarios-locales-vm,u) [pbx_config] '_2XX' => 1. Dial(SIP/${EXTEN},30,Ttm) [pbx_config] 2. Voicemail(${EXTEN}@usuarios-locales-vm,u) [pbx_config]

  • Asterisk: comandos bsicos y ejemplo bsico de centralita 8/17

    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]

    -= 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,[email protected] 251 => 456,Filemn Prez,[email protected] 252 => 789,Saturnino Bacterio,[email protected]

    Recargamos la configuracin con reload o voicemail reload.

    Para ver la configuracin resultante: *CLI> voicemail show

    *CLI> voicemail show users Context Mbox User Zone NewMsg default 1234 Example Mailbox 0 other 1234 Company2 User 0 usuarios-locales-vm 250 Mortadelo Pi 0 usuarios-locales-vm 251 Filemn Prez 0 usuarios-locales-vm 252 Saturnino Bacterio 0 5 voicemail users configured.

    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 http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/additional_configuration_tasks-musiconhold-conf-file.html#InitialConfig_id266259

  • 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: http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/asterisk-CHP-5-SECT-1.html#Architecture_id241422

    Para ver una breve lista de las aplicaciones bsicas o comunes: http://www.wikiasterisk.com/index.php?title=Aplicaciones_B%C3%A1sicas

    -= 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. BackgroundDetect: Background a file with talk detect. Bridge: Bridge two channels. Busy: Indicate the Busy condition. ChangeMonitor: Change monitoring filename of a channel ChanIsAvail: Check channel availability ChannelRedirect: Redirects given channel to a dialplan target ChanSpy: Listen to a channel, and optionally whisper into it. ClearHash: Clear the keys from a specified hashname. ConfBridge: Conference bridge application. Congestion: Indicate the Congestion condition. ContinueWhile: Restart a While loop. ControlPlayback: Play a file with fast forward and rewind. DAHDIAcceptR2Call: 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 Dial: Attempt to connect to another device or endpoint and bridge the call. Dictate: Virtual Dictation Machine. Directory: Provide directory of voicemail extensions. DISA: Direct Inward System Access. DumpChan: Dump Info About The Calling Channel. EAGI: Executes an EAGI compliant application Echo: Echo audio, video, DTMF back to the calling party EndWhile: End a while loop. Exec: Executes dialplan application. ExecIf: Executes dialplan application, conditionally. ExecIfTime: Conditional application execution based on the current time. ExitWhile: End a While loop.

  • Asterisk: comandos bsicos y ejemplo bsico de centralita 10/17

    ExtenSpy: Listen to a channel, and optionally whisper into it. ExternalIVR: Interfaces with an external IVR application Festival: Say text to the user. Flash: Flashes a DAHDI Trunk. FollowMe: Find-Me/Follow-Me application. ForkCDR: Forks the Call Data Record. GetCPEID: Get ADSI CPE ID. Gosub: Jump to label, saving return address. GosubIf: Conditionally jump to label, saving return address. Goto: Jump to a particular priority, extension, or context. GotoIf: Conditional goto. GotoIfTime: Conditional Goto based on the current time. Hangup: Hang up the calling channel. IAX2Provision: Provision a calling IAXy with a given template. ICES: Encode and stream using 'ices'. ImportVar: Import a variable from a channel into a new variable. Incomplete: Returns AST_PBX_INCOMPLETE value. JabberSend: Send a Jabber Message JabberStatus: Retrieve the status of a jabber list member Log: Send arbitrary text to a selected log level. Macro: Macro Implementation. MacroExclusive: Exclusive Macro Implementation. MacroExit: Exit from Macro. MacroIf: Conditional Macro implementation. MailboxExists: Check to see if Voicemail mailbox exists. MeetMe: MeetMe conference bridge. MeetMeAdmin: MeetMe conference administration. MeetMeChannelAdmin: MeetMe conference Administration (channel specific). MeetMeCount: MeetMe participant count. Milliwatt: Generate a Constant 1004Hz tone at 0dbm (mu-law). MinivmAccMess: Record account specific messages. MinivmDelete: Delete Mini-Voicemail voicemail messages. MinivmGreet: Play Mini-Voicemail prompts. MinivmMWI: Send Message Waiting Notification to subscriber(s) of 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.

  • Asterisk: comandos bsicos y ejemplo bsico de centralita 11/17

    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. RetryDial: Place a call, retrying on failure allowing an optional exit extension. Return: Return from gosub routine. Ringing: Indicate ringing tone. SayAlpha: Say Alpha. SayDigits: Say Digits. SayNumber: Say Number. SayPhonetic: Say Phonetic. SayUnixTime: Says a specified time in a custom format. SendDTMF: Sends arbitrary DTMF digits SendFAX: Send a Fax SendImage: Sends an image file. SendText: Send a Text Message. SendURL: Send a URL. Set: Set channel variable or function value. SetAMAFlags: Set the AMA Flags. SetCallerPres: Set CallerID Presentation. SetMusicOnHold: Set default Music On Hold class SIPAddHeader: Add a SIP header to the outbound call. SIPDtmfMode: Change the dtmfmode for a SIP call. SIPRemoveHeader: Remove SIP headers previously added with SIPAddHeader SLAStation: Shared Line Appearance Station. SLATrunk: Shared Line Appearance Trunk. SMS: 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 12/17

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

    *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 represents a particular channel driver, and 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 13/17

    Play an announcement to the called party, where 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 DTMF string is sent to the called party, and the 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 and the called party to the specified 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 milliseconds. Play a warning when mill iseconds are left. Repeat the warning every 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, 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, 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, specifies the sound prompt to play as a warning when time is reached. If not set, the time remaining will be announced. m([class]): Provide hold music to the calling party until a requested

  • Asterisk: comandos bsicos y ejemplo bsico de centralita 14/17

    channel answers. A specific music on hold (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 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:^^: 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 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 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 either not specified or set to '1', the originator hanging up will cause the phone to ring back immediately. With 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 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 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

  • Asterisk: comandos bsicos y ejemplo bsico de centralita 15/17

    Execute via Gosub the routine 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:^^: 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

    *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 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 16/17

    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 , 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

    *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 17/17

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

    [See Also]