Beruflich Dokumente
Kultur Dokumente
1/17
ndice
INTRODUCCIN ................................................................................................................................................................... 3
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
2/17
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
*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)
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
5/17
;; 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
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
7/17
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]
8/17
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
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=
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
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:
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
10/17
11/17
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.
12/17
13/17
14/17
15/17
16/17
17/17