Asterisk en 5 minutos

  1. Instalar
    sudo apt-get install asterisk zaptel-source asterisk-sounds-extra asterisk-prompt-es
  2. Compilar módulo zaptel (necesario para las salas)
    sudo m-a a-i zaptel
  3. Firewall
    • Entrada: 2000 TCP, 2727 UDP, 4520 UDP, 5060 UDP, 4569 UDP, 10000-20000 UDP
    • Salida: 10000-20000 UDP

  4. Editar /etc/asterisk/sip.conf

    [general] language=es
    port=5060
    bindaddr=0.0.0.0
    disallow=all
    allow=ulaw,gsm
    allowguest=no
    domain=example.com
    realm=example.com
    [on4u] type=friend
    host=dynamic
    context=users
    mailbox=1001@default
    username=on4u
    secret=passwordsupersecreta
    callerid=On4u Global Services
    nat=yes

  5. Editar /etc/asterisk/extensions.conf

    [general] static= yes
    writeprotect = yes
    autofallthrough=yes
    [echo] ;exten => number, priority, action
    exten => 600,1,Playback(demo-echotest)
    exten => 600,n,Echo
    exten => 600,n,Playback(demo-echodone)
    exten => 600,n,Hangup
    [macro-phone] exten => s,1,Dial(SIP/${MACRO_EXTEN},25)
    exten => s,n,Goto(s-${DIALSTATUS},1)
    exten => s-ANSWER,1,Hangup
    exten => s-CANCEL,1,Hangup
    exten => s-NOANSWER,1,Voicemail(${MACRO_EXTEN}@default,u)
    exten => s-BUSY,1,Voicemail(${MACRO_EXTEN}@default,b)
    exten => s-CONGESTION,1,Voicemail(${MACRO_EXTEN}@default,b)
    exten => s-CHANUNAVAIL,1,Voicemail(${MACRO_EXTEN}@default,u)
    [stations] exten => 1001,1,Goto(on4u,1)
    exten => on4u,1,Macro(phone)
    exten => _9XXX,1,MeetMe(${EXTEN},)
    exten => 4242,1,VoicemailMain(default)
    ;users context
    [users] include => stations
    include => echo

  6. Editar /etc/asterisk/voicemail.conf

    [general] format=wav
    serveremail=on4u@example.com
    attach=yes
    fromstring=Voicemail
    emailsubject=[voicemsg] Nuevo mensaje de voz ${VM_MSGNUM}
    emailbody=Tienes un mensaje de ${VM_CALLERID} el día ${VM_DATE}\n Duración: ${VM_DUR}\n
    emaildateformat= %d/%m/%Y a las %T
    [default] ; user, num, pass, email
    on4u => 1001,1001,on4u@example.com

  7. Editar /etc/asterisk/meetme.conf

    [rooms] ; conf => num, pass
    conf => 9001,4321

Referencias:

Tu email no será publicado. Campos obligatorios *

*